From: jenkins Date: Thu, 28 Jan 2021 12:56:07 +0000 (+0100) Subject: Merge branch 'release/5.19.0' X-Git-Tag: 5.19.0~1 X-Git-Url: https://dev.e-taxonomy.eu/gitweb/taxeditor.git/commitdiff_plain/0e8e733e3382d50cc12579e114400286252cdf69 Merge branch 'release/5.19.0' --- 0e8e733e3382d50cc12579e114400286252cdf69 diff --cc eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/description/SourceComparator.java index 3e37e3acd,8f4e885cb..a01f31295 --- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/description/SourceComparator.java +++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/description/SourceComparator.java @@@ -11,22 -18,29 +18,30 @@@ import eu.etaxonomy.cdm.model.reference /** * @author pplitzner * @date Apr 13, 2016 - * */ public class SourceComparator implements Comparator { + @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;