Project

General

Profile

task #9567

Unify HomotypicGroupTaxonComparator and HomotypicGroupNameComparator

Added by Andreas Müller 3 months ago. Updated 28 days ago.

Status:
Closed
Priority:
New
Category:
cdmlib
Target version:
Start date:
03/29/2021
Due date:
% Done:

50%

Severity:
normal

Description

Both classes have mostly the same code so they are very redundant. HGNameComparator seems to be an adapted copy of HGTaxonComparator.


Related issues

Related to Edit - bug #9566: Handle nomenclatural standing correctly in cdmlight / sorting algorithms Closed 03/29/2021
Related to Edit - task #9576: Add tests for homotypic group name comparator Rejected 04/01/2021

Associated revisions

Revision 8432293f (diff)
Added by Andreas Müller 3 months ago

fix #9567 unify HomotypicGroupTaxonComparator and HomotypicGroupNameComparator

Revision ee68d8ba (diff)
Added by Katja Luther 3 months ago

ref #9567: fix handleSameBasionym comparison

Revision 7555e895 (diff)
Added by Andreas Müller 3 months ago

ref #9567 fix potential NPE in TaxonComparator if used in HomotypicGroupNameComparator

Revision e0c610f1 (diff)
Added by Andreas Müller 3 months ago

fix #9567 fix missing defined order if names differ only in hybrid sign

Revision c5bd49b5 (diff)
Added by Andreas Müller 3 months ago

ref #9567 slightly adapt the last fix

Revision c441f66b (diff)
Added by Andreas Müller 3 months ago

ref #9567 adapt javadoc

History

#1 Updated by Andreas Müller 3 months ago

  • Status changed from New to Resolved
  • % Done changed from 0 to 50

#2 Updated by Andreas Müller 3 months ago

  • Related to bug #9566: Handle nomenclatural standing correctly in cdmlight / sorting algorithms added

#3 Updated by Andreas Müller 3 months ago

  • Assignee changed from Andreas Müller to Katja Luther

please review

#4 Updated by Katja Luther 3 months ago

  • Status changed from Resolved to Feedback
  • Assignee changed from Katja Luther to Andreas Müller

In handleSameBasionym a return was missing. After fixing that the result is correct.
But maybe the NPE should be avoid if no taxonBases available?

#5 Updated by Andreas Müller 3 months ago

Katja Luther wrote:

In handleSameBasionym a return was missing. After fixing that the result is correct.
But maybe the NPE should be avoid if no taxonBases available?

Which NPE do you mean? Which line?

#6 Updated by Katja Luther 3 months ago

Andreas Müller wrote:

Katja Luther wrote:

In handleSameBasionym a return was missing. After fixing that the result is correct.
But maybe the NPE should be avoid if no taxonBases available?

Which NPE do you mean? Which line?
if in compareNames the value of compareResult == 0 the taxa should be compared, but if there are no taxa a NPE is thrown. (line 142)

#7 Updated by Katja Luther 3 months ago

Katja Luther wrote:

Andreas Müller wrote:

Katja Luther wrote:

In handleSameBasionym a return was missing. After fixing that the result is correct.
But maybe the NPE should be avoid if no taxonBases available?

Which NPE do you mean? Which line?
if in compareNames the value of compareResult == 0 the taxa should be compared, but if there are no taxa a NPE is thrown. (line 142)

for example the comparison of Opuntia ×rubiflora Davidson and Opuntia rubiflora Davidson returns 0 and then the taxa should be compared. Also that the comparison results 0 is not correct?

#8 Updated by Katja Luther 3 months ago

I would add another comparison if the first two comparisons return 0 to compare the not normalized titleCache, do you agree?

#9 Updated by Andreas Müller 3 months ago

  • Status changed from Feedback to Resolved

#10 Updated by Andreas Müller 3 months ago

  • Status changed from Resolved to Feedback

I fixed the potetial NPE and adapted the compare to include hybrid sign if names do not differ in any other part.

#11 Updated by Andreas Müller 3 months ago

  • Status changed from Feedback to Resolved
  • Assignee changed from Andreas Müller to Katja Luther

The mentioned issues should be fixed.

Maybe you can still add some tests for HomotypicGroupNameComparator which explicitly handle specific issues for name comparison so the HomotypicGroupNameComparator is also covered by tests. Especially the NPE case should be covered.

#12 Updated by Katja Luther 3 months ago

  • Status changed from Resolved to Closed
  • Assignee changed from Katja Luther to Andreas Müller

this issue seems to be fixed. add a new ticket for the tests.

#13 Updated by Katja Luther 3 months ago

  • Related to task #9576: Add tests for homotypic group name comparator added

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 40 MB)