diff options
author | Seshu Kumar M <seshu.kumar.m@huawei.com> | 2018-03-08 06:54:51 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2018-03-08 06:54:51 +0000 |
commit | a0d5b691308483bb029e4e8785756af2be394fa4 (patch) | |
tree | 626a717b6ef32f8e2d4dccf260837bda61020c91 | |
parent | ec4e6d2e150639ec4cdc09aeaea01a66f484f2f6 (diff) | |
parent | 253187391a2a65cded398272b2f14b86f3ba8c95 (diff) |
Merge "Swap Collection.sort with list.sort"
3 files changed, 11 insertions, 11 deletions
diff --git a/asdc-controller/src/main/java/org/openecomp/mso/asdc/installer/heat/ToscaResourceInstaller.java b/asdc-controller/src/main/java/org/openecomp/mso/asdc/installer/heat/ToscaResourceInstaller.java index e0f338e27c..591db355c5 100644 --- a/asdc-controller/src/main/java/org/openecomp/mso/asdc/installer/heat/ToscaResourceInstaller.java +++ b/asdc-controller/src/main/java/org/openecomp/mso/asdc/installer/heat/ToscaResourceInstaller.java @@ -419,30 +419,30 @@ public class ToscaResourceInstaller {// implements IVfResourceInstaller { toscaResourceStruct.getSdcCsarHelper().getVfModulesByVf(vfCustomizationUUID);
logger.debug("vfGroups:" + vfGroups.toString());
- Collections.sort(vfGroups, new Comparator<org.openecomp.sdc.toscaparser.api.Group>() {
+ vfGroups.sort(new Comparator<Group>() {
@Override
- public int compare(org.openecomp.sdc.toscaparser.api.Group group1,
- org.openecomp.sdc.toscaparser.api.Group group2) {
+ public int compare(Group group1,
+ Group group2) {
// Field name1Field = group1.class.getDeclaredField("name");
// name1Field.setAccessible(true);
String thisName = group1.getName(); // (String)
- // name1Field.get(group1);
+ // name1Field.get(group1);
String thatName = group2.getName(); // (String)
- // name1Field.get(group2);
+ // name1Field.get(group2);
Matcher m = lastDigit.matcher(thisName);
Matcher m2 = lastDigit.matcher(thatName);
String thisDigit = "0";
String thatDigit = "0";
- if(m.find()) {
+ if (m.find()) {
thisDigit = m.group();
} else {
return -1;
}
- if(m2.find()) {
+ if (m2.find()) {
thatDigit = m2.group();
} else {
return 1;
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")); |