summaryrefslogtreecommitdiffstats
path: root/src/main/java
diff options
context:
space:
mode:
authorSandeep J <sandeejh@in.ibm.com>2018-11-14 17:57:06 +0530
committerSandeep J <sandeejh@in.ibm.com>2018-11-14 17:57:33 +0530
commit635c6f910914be675c340709baf1fb1d2cb89162 (patch)
treef85cad8cef42d90c18673dc7b0f89d2c802ec57c /src/main/java
parent49a5bf8abc9a1f69695ed1d1b22268871b49eb11 (diff)
fixed sonar issues in ZkStatelessLockService.java
fix sonar issues as detailed in MUSIC-185 Issue-ID: MUSIC-185 Change-Id: I5e1696e8d737008acd605b25a07003aa00a49d4b Signed-off-by: Sandeep J <sandeejh@in.ibm.com>
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/org/onap/music/lockingservice/ZkStatelessLockService.java12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/main/java/org/onap/music/lockingservice/ZkStatelessLockService.java b/src/main/java/org/onap/music/lockingservice/ZkStatelessLockService.java
index b09668b7..2aae4969 100644
--- a/src/main/java/org/onap/music/lockingservice/ZkStatelessLockService.java
+++ b/src/main/java/org/onap/music/lockingservice/ZkStatelessLockService.java
@@ -1,7 +1,10 @@
/*
* ============LICENSE_START========================================== org.onap.music
- * =================================================================== Copyright (c) 2017 AT&T
- * Intellectual Property ===================================================================
+ * ===================================================================
+ * Copyright (c) 2017 AT&T Intellectual Property
+ * ===================================================================
+ * Modifications Copyright (c) 2018 IBM.
+ * ===================================================================
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
*
@@ -72,6 +75,7 @@ public class ZkStatelessLockService extends ProtocolSupport {
}
}
+ @Override
public void close() {
try {
zookeeper.close();
@@ -198,7 +202,7 @@ public class ZkStatelessLockService extends ProtocolSupport {
names = zookeeper.getChildren(id, false);
if (names.isEmpty())
return "";
- SortedSet<ZNodeName> sortedNames = new TreeSet<ZNodeName>();
+ SortedSet<ZNodeName> sortedNames = new TreeSet<>();
for (String name : names) {
sortedNames.add(new ZNodeName(id + "/" + name));
}
@@ -328,7 +332,7 @@ public class ZkStatelessLockService extends ProtocolSupport {
// lets sort them explicitly (though they do seem to come back in order
// ususally :)
ZNodeName idName = new ZNodeName(id);
- SortedSet<ZNodeName> sortedNames = new TreeSet<ZNodeName>();
+ SortedSet<ZNodeName> sortedNames = new TreeSet<>();
for (String name : names) {
sortedNames.add(new ZNodeName(dir + "/" + name));
}