From 5ff414eb2c19ce794548fa8b59d37c42c45fce72 Mon Sep 17 00:00:00 2001 From: Arundathi Patil Date: Fri, 16 Nov 2018 14:53:30 +0530 Subject: Sonar fix: Application.java Fixed sonar issues across this file Issue-ID: CCSDK-726 Change-Id: I416500a26f258cba87576a80c9da371a8a8f1a88 Signed-off-by: Arundathi Patil --- .../java/org/onap/ccsdk/apps/ms/neng/core/Application.java | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'ms/neng/src/main/java') diff --git a/ms/neng/src/main/java/org/onap/ccsdk/apps/ms/neng/core/Application.java b/ms/neng/src/main/java/org/onap/ccsdk/apps/ms/neng/core/Application.java index 6efa94de..0edc38a3 100644 --- a/ms/neng/src/main/java/org/onap/ccsdk/apps/ms/neng/core/Application.java +++ b/ms/neng/src/main/java/org/onap/ccsdk/apps/ms/neng/core/Application.java @@ -21,6 +21,9 @@ package org.onap.ccsdk.apps.ms.neng.core; import java.util.Arrays; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.boot.CommandLineRunner; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @@ -38,6 +41,9 @@ import org.springframework.scheduling.annotation.EnableAsync; @ComponentScan(basePackages = "org.onap.ccsdk") @EnableAsync public class Application extends SpringBootServletInitializer { + + private Logger logger = LoggerFactory.getLogger(Application.class); + /** * Configures the application. */ @@ -49,7 +55,7 @@ public class Application extends SpringBootServletInitializer { /** * Entry point for the application. */ - public static void main(String[] args) throws Exception { + public static void main(String[] args) { SpringApplication.run(Application.class, args); } @@ -59,14 +65,14 @@ public class Application extends SpringBootServletInitializer { @Bean public CommandLineRunner commandLineRunner(ApplicationContext ctx) { return args -> { - System.out.println("################################"); - System.out.println("Inspecting the beans provided by Spring Boot:"); + logger.info("################################"); + logger.info("Inspecting the beans provided by Spring Boot:"); String[] beanNames = ctx.getBeanDefinitionNames(); Arrays.sort(beanNames); for (String beanName : beanNames) { System.out.println(beanName); } - System.out.println("################################"); + logger.info("################################"); }; } -- cgit 1.2.3-korg