#1105 NullPointerException when sorting IAtomContainer's in a *Set

cdk-1.4.x
closed
nobody
None
5
2013-05-25
2010-10-22
Egon Willighagen
No

Patch attached.

The patch also highlights another problem, that sorting of IAtomContainer subclasses does not work with the unit test... that should be explored too...

Discussion

  • Mark Rijnbeek
    Mark Rijnbeek
    2010-10-22

    Suggested change for the first lines of the compare method in AtomContainerComparator

    public int compare(Object o1, Object o2) {
    // Check for nulls
    if (o1 == null && o2 == null)
    return 0;
    if (o1 == null)
    return 1;
    if (o2 == null)
    return -1;

     
  • A fix based on Mark's comment below is now also attached to that patch tracker issue #3413835.

     
  • John May
    John May
    2013-05-25

    Fixed by linked patch.

     
  • John May
    John May
    2013-05-25

    • status: open --> closed