commit 6e52cede503d4542c25d49ee7322072e2d792404
Author: Patrick Plitzner <p.plitzner@bgbm.org>
Date:   Thu May 3 15:00:47 2018 +0200

    ref #6330 Adapt comparator to specific sorting

diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/description/DescriptionElementSourceSection.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/description/DescriptionElementSourceSection.java
index 5801b439b..2cb8d8d15 100644
--- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/description/DescriptionElementSourceSection.java
+++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/description/DescriptionElementSourceSection.java
@@ -3,11 +3,8 @@
  */
 package eu.etaxonomy.taxeditor.ui.section.description;
 
-import java.util.ArrayList;
 import java.util.Collection;
-import java.util.Collections;
 import java.util.Comparator;
-import java.util.List;
 
 import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.common.OriginalSourceType;
@@ -16,7 +13,6 @@ import eu.etaxonomy.cdm.model.description.DescriptionElementSource;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
 import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection;
-import eu.etaxonomy.taxeditor.ui.section.DefaultCdmBaseComparator;
 
 /**
  * <p>
@@ -61,14 +57,12 @@ public class DescriptionElementSourceSection extends
     /** {@inheritDoc} */
     @Override
     public Collection<DescriptionElementSource> getCollection(DescriptionElementBase entity) {
-        List<DescriptionElementSource> sources = new ArrayList<DescriptionElementSource>(entity.getSources());
-        Collections.sort(sources, new SourceComparator());
-        return sources;
+        return entity.getSources();
     }
 
     @Override
     public Comparator<DescriptionElementSource> getComparator() {
-        return new DefaultCdmBaseComparator<>();
+        return new SourceComparator();
     }
 
     /** {@inheritDoc} */
diff --git 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
index d40e41084..1f927e330 100644
--- 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
@@ -12,9 +12,9 @@ import eu.etaxonomy.cdm.model.reference.Reference;
  * @date Apr 13, 2016
  *
  */
-public class SourceComparator implements Comparator<OriginalSourceBase> {
+public class SourceComparator  <T extends OriginalSourceBase> implements Comparator<T> {
     @Override
-    public int compare(OriginalSourceBase o1, OriginalSourceBase o2) {
+    public int compare(T o1, T o2) {
         int id1 = o1.getId();
         int id2 = o2.getId();
         OriginalSourceType type1 = o1.getType();
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/supplemental/SourceSection.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/supplemental/SourceSection.java
index 7f15f6d4d..cfc9fb384 100644
--- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/supplemental/SourceSection.java
+++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/supplemental/SourceSection.java
@@ -3,11 +3,8 @@
  */
 package eu.etaxonomy.taxeditor.ui.section.supplemental;
 
-import java.util.ArrayList;
 import java.util.Collection;
-import java.util.Collections;
 import java.util.Comparator;
-import java.util.List;
 
 import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.model.common.IIdentifiableEntity;
@@ -17,7 +14,6 @@ import eu.etaxonomy.cdm.model.media.Media;
 import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
 import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
 import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection;
-import eu.etaxonomy.taxeditor.ui.section.DefaultCdmBaseComparator;
 import eu.etaxonomy.taxeditor.ui.section.description.SourceComparator;
 
 /**
@@ -60,14 +56,12 @@ public class SourceSection extends AbstractEntityCollectionSection<IIdentifiable
 	@Override
 	public Collection<IdentifiableSource> getCollection(
 			IIdentifiableEntity entity) {
-		List<IdentifiableSource> sources = new ArrayList<IdentifiableSource>(entity.getSources());
-		Collections.sort(sources, new SourceComparator());
-        return sources;
+		return entity.getSources();
 	}
 
 	@Override
 	public Comparator<IdentifiableSource> getComparator() {
-        return new DefaultCdmBaseComparator<>();
+        return new SourceComparator();
 	}
 
 	/** {@inheritDoc} */
