diff options
author | 2018-03-29 20:26:02 -0500 | |
---|---|---|
committer | 2018-03-29 20:26:11 -0500 | |
commit | 36b62be84b398044e1feae657c662dba6247782f (patch) | |
tree | d537940a473259de2f2d97579607d7cbfa9906d1 /cadi/client/src | |
parent | d86dd644e1543743cfcbc83b230bd4f2cb2e5d4e (diff) |
Clean up Sonar results 2
Issue-ID: AAF-206
Change-Id: Ia000b144be58af970f4a5264ca5a9718fdbf9f5d
Signed-off-by: Instrumental <jcgmisc@stl.gathman.org>
Diffstat (limited to 'cadi/client/src')
-rw-r--r-- | cadi/client/src/main/java/org/onap/aaf/cadi/locator/PropertyLocator.java | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/cadi/client/src/main/java/org/onap/aaf/cadi/locator/PropertyLocator.java b/cadi/client/src/main/java/org/onap/aaf/cadi/locator/PropertyLocator.java index 244a43bd..5820bf29 100644 --- a/cadi/client/src/main/java/org/onap/aaf/cadi/locator/PropertyLocator.java +++ b/cadi/client/src/main/java/org/onap/aaf/cadi/locator/PropertyLocator.java @@ -193,17 +193,21 @@ public class PropertyLocator implements Locator<URI> { port = "https".equalsIgnoreCase(o.getScheme())?443:80; } socket.connect(new InetSocketAddress(realname,port),3000); - if(socket.isConnected()) { - n = new URI( - o.getScheme(), - o.getUserInfo(), - realname, - o.getPort(), - o.getPath(), - o.getQuery(), - o.getFragment() - ); - resolve.add(n); + try { + if(socket.isConnected()) { + n = new URI( + o.getScheme(), + o.getUserInfo(), + realname, + o.getPort(), + o.getPath(), + o.getQuery(), + o.getFragment() + ); + resolve.add(n); + } + } finally { + socket.close(); } } catch (IOException e) { } finally { |