Sonar fixes in CCAActivator 15/28915/3
authorwejs <maciej.wejs@nokia.com>
Tue, 23 Jan 2018 13:32:16 +0000 (14:32 +0100)
committerTakamune Cho <tc012c@att.com>
Thu, 25 Jan 2018 01:07:04 +0000 (01:07 +0000)
Change-Id: I27643c8f8cf0a97b5e6bf374aee1388386f88db0
Issue-ID: APPC-454
Signed-off-by: wejs <maciej.wejs@nokia.com>
appc-config/appc-config-adaptor/provider/src/main/java/org/onap/appc/ccadaptor/CCAActivator.java

index 0b022c8..fdf14fe 100644 (file)
@@ -44,7 +44,6 @@ public class CCAActivator implements BundleActivator
   @SuppressWarnings("rawtypes")
   private ServiceRegistration registration = null;
 
-  //private static final Logger log = LoggerFactory.getLogger(CCAActivator.class);
   private static final EELFLogger log = EELFManager.getInstance().getLogger(CCAActivator.class);
 
   @Override
@@ -70,8 +69,7 @@ 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);
     }
@@ -79,24 +77,8 @@ public class CCAActivator implements BundleActivator
     {
       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: ");
-    /*for (Object key : props.keySet())
-    {
-      Object value = props.get(key);
-      log.info("    " + key + "=" + value);
-    }*/
 
     // Advertise adaptor
     ConfigComponentAdaptor adaptor = new ConfigComponentAdaptor(props);