|
For cloning classes that are based on auto-generated source code that you cannot edit, cloning based on reflection might be the best approach. It does not require the classes to be declared Serializable or Cloneable and the performance it generally better than cloning via serialization (sometimes much better). It does, however, require sufficient security privileges in order to manipulate non-public class fields.
|