Project

General

Profile

feature request #922

Implement compareTo method in IdentifiableEntity properly

Added by Andreas Müller over 9 years ago. Updated almost 2 years ago.

Status:
Closed
Priority:
Priority12
Category:
cdmlib
Target version:
Start date:
08/17/2009
Due date:
% Done:

100%

Severity:
major

Description

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


Related issues

Related to Edit - bug #6311: Refactor IdentifiableEntity.compareTo method Rejected 01/05/2017
Related to Edit - task #6401: Update working environment to jdk 1.8 Closed 02/01/2017

Associated revisions

Revision dfc40f67 (diff)
Added by Andreas Müller almost 2 years ago

fix #6311 move compareToEntity method to TaxonName and TaxonBase classes and refactor

Revision 44e2abe8 (diff)
Added by Andreas Müller almost 2 years ago

ref #6311 further refactoring for compareToEntity

Revision b5b4a36c (diff)
Added by Andreas Müller almost 2 years ago

ref #922 move compareTo test to subclasses

History

#1 Updated by Andreas Müller over 9 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?

#2 Updated by Katja Luther about 9 years ago

  • Assignee changed from Anahit Babadshanjan to k.luther -
  • Target version changed from CDM lib Release 2.0 to CDM lib Release 2.3

#3 Updated by Andreas Müller almost 2 years ago

  • Related to bug #6311: Refactor IdentifiableEntity.compareTo method added

#4 Updated by Andreas Müller almost 2 years ago

  • Description updated (diff)
  • Status changed from New to Resolved
  • Target version changed from cdmlib - 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.

#5 Updated by Andreas Müller almost 2 years ago

  • Related to task #6401: Update working environment to jdk 1.8 added

#6 Updated by Katja Luther almost 2 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.

#7 Updated by Andreas Müller almost 2 years ago

  • Status changed from Feedback to Closed
  • % Done changed from 80 to 100

Moved the tests down to the subclasses

#8 Updated by Andreas Müller almost 2 years ago

  • Private changed from Yes to No

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 40 MB)