summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorshashikanth <shashikanth.vh@huawei.com>2017-09-26 13:41:49 +0530
committerPatrick Brady <pb071s@att.com>2017-09-27 22:05:28 +0000
commit3f8e7fc7d4bdc18d14504e5189ac242f28ea328a (patch)
tree20590f6518190c1df27354e16a4ae4e4a2a1725e
parent5c0ab1dfa4aab9cd83d5baac17710963a11b22d9 (diff)
Fix Blocker/Critical sonar issues
Fix Blocker/Critical sonar issues in appc module https://sonar.onap.org/component_issues?id=org.openecomp.appc%3Aappc#resolved=false|severities=BLOCKER|fileUuids=AV36PknS89V-MRZU58_f Fixed issue Close "FileInputStream". Issue-Id: APPC-186 Change-Id: I2fab5e54735992a4cbf2972628574edd17905fe3 Signed-off-by: shashikanth.vh <shashikanth.vh@huawei.com>
-rw-r--r--appc-config/appc-config-adaptor/provider/src/main/java/org/openecomp/appc/ccadaptor/CCAActivator.java18
1 files changed, 2 insertions, 16 deletions
diff --git a/appc-config/appc-config-adaptor/provider/src/main/java/org/openecomp/appc/ccadaptor/CCAActivator.java b/appc-config/appc-config-adaptor/provider/src/main/java/org/openecomp/appc/ccadaptor/CCAActivator.java
index 5863c1d7d..96cda9ca2 100644
--- a/appc-config/appc-config-adaptor/provider/src/main/java/org/openecomp/appc/ccadaptor/CCAActivator.java
+++ b/appc-config/appc-config-adaptor/provider/src/main/java/org/openecomp/appc/ccadaptor/CCAActivator.java
@@ -70,28 +70,14 @@ public class CCAActivator implements BundleActivator
if (!propFile.exists())
throw new ConfigurationException("Missing configuration properties file: " + propFile);
- InputStream in = new FileInputStream(propFile);
- try
- {
+ try(InputStream in = new FileInputStream(propFile)) {
props.load(in);
+ log.info("Loaded properties: ");
}
catch (Exception e)
{
throw new ConfigurationException("Could not load properties file " + propFileName, e);
}
- finally
- {
- try
- {
- in.close();
- }
- catch (Exception e)
- {
- log.warn("Could not close FileInputStream", e);
- }
- }
-
- log.info("Loaded properties: ");
// Advertise adaptor
ConfigComponentAdaptor adaptor = new ConfigComponentAdaptor(props);