aboutsummaryrefslogtreecommitdiffstats
path: root/src/main
diff options
context:
space:
mode:
authorThomas Nelson <nelson24@att.com>2018-11-15 07:18:33 +0000
committerGerrit Code Review <gerrit@onap.org>2018-11-15 07:18:33 +0000
commitf2fd25b81e941fdb96091657220b5a3992b02a63 (patch)
treeff606a9a1c9bafa4874bd5038b48921bec0c3c6c /src/main
parentb6e548fb52f035062ce08fceaa8fe5bcfdfcd386 (diff)
parent635c6f910914be675c340709baf1fb1d2cb89162 (diff)
Merge "fixed sonar issues in ZkStatelessLockService.java"
Diffstat (limited to 'src/main')
-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));
}