From 635c6f910914be675c340709baf1fb1d2cb89162 Mon Sep 17 00:00:00 2001 From: Sandeep J Date: Wed, 14 Nov 2018 17:57:06 +0530 Subject: 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 --- .../onap/music/lockingservice/ZkStatelessLockService.java | 12 ++++++++---- 1 file 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 sortedNames = new TreeSet(); + SortedSet 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 sortedNames = new TreeSet(); + SortedSet sortedNames = new TreeSet<>(); for (String name : names) { sortedNames.add(new ZNodeName(dir + "/" + name)); } -- cgit 1.2.3-korg