Fixed sonar issues in ApplicationConfig 42/73042/4
authorezhil <ezhrajam@in.ibm.com>
Mon, 19 Nov 2018 14:51:49 +0000 (20:21 +0530)
committerEzhilarasi R <ezhrajam@in.ibm.com>
Tue, 20 Nov 2018 08:28:53 +0000 (08:28 +0000)
Replace logger for Sysout
Issue-ID: CCSDK-731
Change-Id: Iaa6b7c93332a051134b4507d5b814ed20085980a
Signed-off-by: ezhil <ezhrajam@in.ibm.com>
ms/neng/src/main/java/org/onap/ccsdk/apps/ms/neng/core/persistence/ApplicationConfig.java

index f68add7..0bdf40a 100644 (file)
@@ -4,6 +4,9 @@
  * ================================================================================
  * Copyright (C) 2018 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
+ * *================================================================================
+ * 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
@@ -45,6 +48,9 @@ import org.springframework.orm.jpa.JpaVendorAdapter;
 import org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean;
 import org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter;
 import org.springframework.transaction.annotation.EnableTransactionManagement;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
 
 /**
  * Manages the overall configuration of the application related to persistence.
@@ -57,6 +63,7 @@ public class ApplicationConfig {
 
     @Autowired
     private Environment environment;
+    private Logger logger = LoggerFactory.getLogger(ApplicationConfig.class);
 
     @SuppressWarnings("rawtypes")
     void debugProperties() {
@@ -66,8 +73,8 @@ public class ApplicationConfig {
                 .filter(ps -> ps instanceof EnumerablePropertySource)
                 .map(ps -> ((EnumerablePropertySource) ps).getPropertyNames())
                 .flatMap(Arrays::<String>stream)
-                .forEach(propName -> props.setProperty(propName, this.environment.getProperty(propName)));   
-        System.out.println("Properties: " + props);
+                .forEach(propName -> props.setProperty(propName, this.environment.getProperty(propName)));
+        logger.info("Properties: " + props);
     }
     
     /**