From b61cc21c17744ef927d4fca32aef6149f1b3910c Mon Sep 17 00:00:00 2001 From: mojahidi Date: Mon, 11 Dec 2017 19:08:11 +0530 Subject: Fixed sonar issues - LoggerFactory Refactored as per previous patch comment Change-Id: Ia971105a56df62575cd3871e3488b6d2c6903d3c Issue-ID: SDC-343 Signed-off-by: mojahidi --- .../openecomp/sdc/logging/api/LoggerFactory.java | 36 ++++++++++++++++++++-- 1 file changed, 33 insertions(+), 3 deletions(-) (limited to 'openecomp-be') 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) { -- cgit 1.2.3-korg