Fixed sonar issues - LoggerFactory 43/26043/4
authormojahidi <mojahidul.islam@amdocs.com>
Mon, 11 Dec 2017 13:38:11 +0000 (19:08 +0530)
committerMojahidul Islam <mojahidul.islam@amdocs.com>
Wed, 13 Dec 2017 04:55:47 +0000 (04:55 +0000)
Refactored as per previous patch comment

Change-Id: Ia971105a56df62575cd3871e3488b6d2c6903d3c
Issue-ID: SDC-343
Signed-off-by: mojahidi <mojahidul.islam@amdocs.com>
openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-api/src/main/java/org/openecomp/sdc/logging/api/LoggerFactory.java

index 65df789..1be2fa2 100644 (file)
@@ -58,9 +58,9 @@ public class LoggerFactory extends BaseFactory {
   }
 
   private static class NoOpLoggerCreationService implements LoggerCreationService {
+    private static final Logger NO_OP_LOGGER = new NoOpLogger();
 
-    private static final Logger NO_OP_LOGGER = new Logger() {
-
+    private static class NoOpLogger implements Logger {
       @Override
       public String getName() {
         return "No-Op Logger";
@@ -73,22 +73,27 @@ public class LoggerFactory extends BaseFactory {
 
       @Override
       public void metrics(String msg) {
+        //this is no_op_method
       }
 
       @Override
       public void metrics(String msg, Object arg) {
+        //this is no_op_method
       }
 
       @Override
       public void metrics(String msg, Object arg1, Object arg2) {
+        //this is no_op_method
       }
 
       @Override
       public void metrics(String msg, Object... arguments) {
+        //this is no_op_method
       }
 
       @Override
       public void metrics(String msg, Throwable t) {
+        //this is no_op_method
       }
 
       @Override
@@ -98,22 +103,27 @@ public class LoggerFactory extends BaseFactory {
 
       @Override
       public void audit(String msg) {
+        //this is no_op_method
       }
 
       @Override
       public void audit(String msg, Object arg) {
+        //this is no_op_method
       }
 
       @Override
       public void audit(String msg, Object arg1, Object arg2) {
+        //this is no_op_method
       }
 
       @Override
       public void audit(String msg, Object... arguments) {
+        //this is no_op_method
       }
 
       @Override
       public void audit(String msg, Throwable t) {
+        //this is no_op_method
       }
 
       @Override
@@ -123,22 +133,27 @@ public class LoggerFactory extends BaseFactory {
 
       @Override
       public void debug(String msg) {
+        //this is no_op_method
       }
 
       @Override
       public void debug(String msg, Object arg) {
+        //this is no_op_method
       }
 
       @Override
       public void debug(String msg, Object arg1, Object arg2) {
+        //this is no_op_method
       }
 
       @Override
       public void debug(String msg, Object... arguments) {
+        //this is no_op_method
       }
 
       @Override
       public void debug(String msg, Throwable t) {
+        //this is no_op_method
       }
 
       @Override
@@ -148,22 +163,27 @@ public class LoggerFactory extends BaseFactory {
 
       @Override
       public void info(String msg) {
+        //this is no_op_method
       }
 
       @Override
       public void info(String msg, Object arg) {
+        //this is no_op_method
       }
 
       @Override
       public void info(String msg, Object arg1, Object arg2) {
+        //this is no_op_method
       }
 
       @Override
       public void info(String msg, Object... arguments) {
+        //this is no_op_method
       }
 
       @Override
       public void info(String msg, Throwable t) {
+        //this is no_op_method
       }
 
       @Override
@@ -173,22 +193,27 @@ public class LoggerFactory extends BaseFactory {
 
       @Override
       public void warn(String msg) {
+        //this is no_op_method
       }
 
       @Override
       public void warn(String msg, Object arg) {
+        //this is no_op_method
       }
 
       @Override
       public void warn(String msg, Object... arguments) {
+        //this is no_op_method
       }
 
       @Override
       public void warn(String msg, Object arg1, Object arg2) {
+        //this is no_op_method
       }
 
       @Override
       public void warn(String msg, Throwable t) {
+        //this is no_op_method
       }
 
       @Override
@@ -198,24 +223,29 @@ public class LoggerFactory extends BaseFactory {
 
       @Override
       public void error(String msg) {
+        //this is no_op_method
       }
 
       @Override
       public void error(String msg, Object arg) {
+        //this is no_op_method
       }
 
       @Override
       public void error(String msg, Object arg1, Object arg2) {
+        //this is no_op_method
       }
 
       @Override
       public void error(String msg, Object... arguments) {
+        //this is no_op_method
       }
 
       @Override
       public void error(String msg, Throwable t) {
+        //this is no_op_method
       }
-    };
+    }
 
     @Override
     public Logger getLogger(String className) {