From 9575e4473c7cd151ca2b22d621c0ff16c8cede62 Mon Sep 17 00:00:00 2001
From: felmer <felmer>
Date: Thu, 23 Aug 2012 10:44:54 +0000
Subject: [PATCH] remove Sample comparators because Sample implements
 Comparable

SVN: 26432
---
 .../resultset/TableForUpdateExporter.java       | 17 ++++++-----------
 .../openbis/systemtest/SamplesListingTest.java  | 10 +---------
 2 files changed, 7 insertions(+), 20 deletions(-)

diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/resultset/TableForUpdateExporter.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/resultset/TableForUpdateExporter.java
index cbdbec733b7..e5f44af38a1 100644
--- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/resultset/TableForUpdateExporter.java
+++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/client/web/server/resultset/TableForUpdateExporter.java
@@ -20,7 +20,6 @@ import java.io.Serializable;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
-import java.util.Comparator;
 import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
@@ -183,8 +182,11 @@ public class TableForUpdateExporter
             {
                 builder.append("[").append(entry.getKey()).append("]").append(lineSeparator);
             }
-            builder.append(getTableForSamples(entry, lineSeparator, getAllPropertyTypes(rowMap
-                    .get(entry.getKey()), commonServer.listSampleTypes(sessionToken))));
+            builder.append(getTableForSamples(
+                    entry,
+                    lineSeparator,
+                    getAllPropertyTypes(rowMap.get(entry.getKey()),
+                            commonServer.listSampleTypes(sessionToken))));
         }
         return builder.toString();
     }
@@ -201,14 +203,7 @@ public class TableForUpdateExporter
         builder.columnGroup("").addColumnsForPropertyTypesForUpdate(allPropertyTypes);
 
         List<Sample> samples = entry.getValue();
-        Collections.sort(samples, new Comparator<Sample>()
-            {
-                @Override
-                public int compare(Sample s1, Sample s2)
-                {
-                    return s1.getIdentifier().compareTo(s2.getIdentifier());
-                }
-            });
+        Collections.sort(samples);
         for (Sample sample : samples)
         {
             builder.addRow(sample);
diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/SamplesListingTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/SamplesListingTest.java
index 1581144dacd..ffdc381c971 100644
--- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/SamplesListingTest.java
+++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/systemtest/SamplesListingTest.java
@@ -20,7 +20,6 @@ import static org.testng.AssertJUnit.assertEquals;
 
 import java.util.Arrays;
 import java.util.Collections;
-import java.util.Comparator;
 import java.util.List;
 import java.util.Set;
 import java.util.TreeSet;
@@ -69,14 +68,7 @@ public class SamplesListingTest extends SystemTestCase
         assertSamples(resultSet, "/CISD/CHILD-PLATE1", "/CISD/CHILD-PLATE2",
                 "/CISD/PLATE-WITH_EXPERIMENT");
         List<Sample> samples = asList(resultSet);
-        Collections.sort(samples, new Comparator<Sample>()
-            {
-                @Override
-                public int compare(Sample s1, Sample s2)
-                {
-                    return s1.getIdentifier().compareTo(s2.getIdentifier());
-                }
-            });
+        Collections.sort(samples);
         assertEquals("[COMMENT: my plate child]", samples.get(0).getProperties().toString());
         assertEquals("/CISD/PLATE-WITH_EXPERIMENT", samples.get(0).getParents().iterator().next()
                 .getIdentifier());
-- 
GitLab