Java's "clone()" method generator for Eclipse Galileo

Denis picture Denis · Jul 5, 2010 · Viewed 7.8k times · Source

What is the best tool for java's clone() method generation in Eclipse Galileo available from repositories? What is the reason, that prevents Eclipse developers from including this tool in standard release?

Answer

Bozho picture Bozho · Jul 5, 2010

It's very hard to implement clone() right. It is considered not a good practice to do so. Bloch (Effective Java) suggest that using clone() should be avoided. Use other means of shallow cloning, like copy-constructors or utilities like commons-beanutils.