From 253187391a2a65cded398272b2f14b86f3ba8c95 Mon Sep 17 00:00:00 2001 From: Munir Ahmad Date: Wed, 7 Mar 2018 18:55:19 -0500 Subject: Swap Collection.sort with list.sort Change-Id: Id56bcc3ad3696b5068b9465e9951f211ac467cb3 Issue-ID: SO-437 Signed-off-by: Munir Ahmad --- .../src/main/java/org/openecomp/mso/db/catalog/CatalogDatabase.java | 6 +++--- .../java/org/openecomp/mso/db/catalog/test/MavenVersioningTest.java | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'mso-catalog-db') diff --git a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/CatalogDatabase.java b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/CatalogDatabase.java index c556ddadb5..97e1443000 100644 --- a/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/CatalogDatabase.java +++ b/mso-catalog-db/src/main/java/org/openecomp/mso/db/catalog/CatalogDatabase.java @@ -1195,7 +1195,7 @@ public class CatalogDatabase implements Closeable { return null; } - Collections.sort(resultList, new MavenLikeVersioningComparator()); + resultList.sort(new MavenLikeVersioningComparator()); Collections.reverse(resultList); LOGGER.recordMetricEvent(startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Successfully", "CatalogDB", "getVnfRecipe", null); @@ -4576,7 +4576,7 @@ public class CatalogDatabase implements Closeable { return null; } - Collections.sort (resultList, new MavenLikeVersioningComparator ()); + resultList.sort(new MavenLikeVersioningComparator()); Collections.reverse (resultList); return resultList.get (0); @@ -5161,7 +5161,7 @@ public class CatalogDatabase implements Closeable { return null; } - Collections.sort (resultList, new MavenLikeVersioningComparator ()); + resultList.sort(new MavenLikeVersioningComparator()); Collections.reverse (resultList); return resultList.get (0); diff --git a/mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/test/MavenVersioningTest.java b/mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/test/MavenVersioningTest.java index 3dddb17d7c..c99a714b11 100644 --- a/mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/test/MavenVersioningTest.java +++ b/mso-catalog-db/src/test/java/org/openecomp/mso/db/catalog/test/MavenVersioningTest.java @@ -167,7 +167,7 @@ public class MavenVersioningTest { list.add(test11); list.add(test12); - Collections.sort(list,new MavenLikeVersioningComparator()); + list.sort(new MavenLikeVersioningComparator()); //Collections.reverse(list); assertTrue(list.get(0).getVersion().equals("0.02")); assertTrue(list.get(1).getVersion().equals("1.1")); -- cgit 1.2.3-korg