Description
Every subclass of ISOMetadata should provide a copy constructor. Problem is that those copy constructors are very tedious to write. The shallowCopy(Object) method working with Java reflection has been created for making that easier. However shallowCopy can not be invoked from the constructor (actually it can, but this is dangerous because shallowCopy invokes in turn overrideable methods before the subclasses have been initialized).
This task can be subdivided in the following sub-tasks:
- Write a small program generating most of the copy constructor code automatically.
- Write a small program generating most of the test code automatically (probably the same program in a modified form).
- Update all castOrCopy methods to use the new copy constructor.
- Transform the shallowCopy method into an append method, which may be more useful. The difference would be that new items are added into existing collections instead than overwriting the previous ones.
Attachments
Issue Links
- is related to
-
SIS-113 Support deep copy of metadata objects
- Closed