feature request #922closed
Implement compareTo method in IdentifiableEntity properly
At the moment there is just one method that uses case differentiation instead of using the inheritance.
Either overwrite compoareTo or use abstract methods to get relevant information from subclasses
Updated by Andreas Müller over 13 years ago
Implementing compareTo in identifiable entity by implementing Comparable creates problems in OrderedTermBase (OrderedTermBase is identifiable now, too). Therefore we should rethink this implementation. Do we really need to compare ident.entities of different classes?
Updated by Andreas Müller almost 6 years ago
- Description updated (diff)
- Status changed from New to Resolved
- Target version changed from cdmlib - Old Next Major Release to Release 4.6
- % Done changed from 0 to 80
Revision showed that
- the method was never used by different classes and therefore the parameter does not need to be IdentifiableEntity
- the method was only used by TaxonNameBase and TaxonBase but created problems with the very similar compareTo method in DefinedTermBase
Therefore we moved the method down to TaxonNameBase and TaxonBase and implemented it properly for each of these classes. Also it was renamed to avoid mistakes thinking it implements Comparable (#4232, #6311).
The semantics was only slightly changed were NPEs were expected otherwise.
Updated by Katja Luther almost 6 years ago
- Status changed from Resolved to Feedback
- Assignee changed from Katja Luther to Andreas Müller
Looks fine, the only thing that should be moved, are the tests for the new methods. At the moment the methods are still tested in IdentifiableEntityTest class.