From 6b04a5675e035277a90f8378fd6cf333066fd1c7 Mon Sep 17 00:00:00 2001 From: amshegokar Date: Tue, 26 Sep 2017 16:23:38 +0530 Subject: Sonar Blocker Fix Sonar Blocker for resource leak Sonar Link: https://sonar.onap.org/component_issues/index?id=org.openecomp.appc%3Aappc#resolved=false|severities=BLOCKER|rules=squid%3AS2095 Change-Id: Id73e2153b13716706b0dce4204d8c7519850afe5 Issue-ID: APPC-236 Signed-off-by: amshegokar --- .../java/org/openecomp/appc/ccadaptor/ConfigComponentAdaptor.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'appc-config/appc-config-adaptor/provider/src/main/java') diff --git a/appc-config/appc-config-adaptor/provider/src/main/java/org/openecomp/appc/ccadaptor/ConfigComponentAdaptor.java b/appc-config/appc-config-adaptor/provider/src/main/java/org/openecomp/appc/ccadaptor/ConfigComponentAdaptor.java index 4e59dd345..ec8727fa6 100644 --- a/appc-config/appc-config-adaptor/provider/src/main/java/org/openecomp/appc/ccadaptor/ConfigComponentAdaptor.java +++ b/appc-config/appc-config-adaptor/provider/src/main/java/org/openecomp/appc/ccadaptor/ConfigComponentAdaptor.java @@ -1008,14 +1008,12 @@ public class ConfigComponentAdaptor implements SvcLogicAdaptor { StringBuffer strBuff = new StringBuffer(); String line; - try + try(BufferedReader in = new BufferedReader(new FileReader(fileName))) { - BufferedReader in = new BufferedReader(new FileReader(fileName)); while ((line = in.readLine()) != null) { strBuff.append(line+"\n"); } - in.close(); } catch (IOException e) { -- cgit 1.2.3-korg