Merge branch 'release/5.19.0'
authorjenkins <jenkins-int@bgbm.org>
Thu, 28 Jan 2021 12:56:07 +0000 (13:56 +0100)
committerjenkins <jenkins-int@bgbm.org>
Thu, 28 Jan 2021 12:56:07 +0000 (13:56 +0100)
1  2 
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/newWizard/NewTaxonNodeWizard.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/description/SourceComparator.java

index 3e37e3acd665dac8e89c5c64d1bb0f1bc2eefa38,8f4e885cbd5f357b76d381bfc89e85d6b658f0b7..a01f31295166e1319578efb49b51f14275ca2d1e
@@@ -11,22 -18,29 +18,30 @@@ import eu.etaxonomy.cdm.model.reference
  /**
   * @author pplitzner
   * @date Apr 13, 2016
-  *
   */
  public class SourceComparator  <T extends OriginalSourceBase> implements Comparator<T> {
      @Override
      public int compare(T o1, T o2) {
-         int id1 = o1.getId();
-         int id2 = o2.getId();
+         //same and null compare, to be on the save side
+         if (o1 == o2){
+             return 0;
+         }else if (o1 == null){
+             return -1;
+         }else if (o2 == null){
+             return 1;
+         }
          boolean isDescriptionElementSource1 = false;
          boolean isDescriptionElementSource2 = false;
-         if (o1 instanceof DescriptionElementSource){
+         if (o1.isInstanceOf(DescriptionElementSource.class)){
              isDescriptionElementSource1 = true;
          }
-         if (o2 instanceof DescriptionElementSource){
+         if (o2.isInstanceOf(DescriptionElementSource.class)){
              isDescriptionElementSource2 = true;
          }
 +        int result = 0;
          if (isDescriptionElementSource1 != isDescriptionElementSource2){
              if (isDescriptionElementSource1){
                  return -1;