From: mojahidi Date: Mon, 11 Dec 2017 13:38:11 +0000 (+0530) Subject: Fixed sonar issues - LoggerFactory X-Git-Tag: v1.2.0~660 X-Git-Url: https://gerrit.onap.org/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F43%2F26043%2F4;p=sdc.git Fixed sonar issues - LoggerFactory Refactored as per previous patch comment Change-Id: Ia971105a56df62575cd3871e3488b6d2c6903d3c Issue-ID: SDC-343 Signed-off-by: mojahidi --- diff --git a/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-api/src/main/java/org/openecomp/sdc/logging/api/LoggerFactory.java b/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-api/src/main/java/org/openecomp/sdc/logging/api/LoggerFactory.java index 65df7899fa..1be2fa21dc 100644 --- a/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-api/src/main/java/org/openecomp/sdc/logging/api/LoggerFactory.java +++ b/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-api/src/main/java/org/openecomp/sdc/logging/api/LoggerFactory.java @@ -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) {