diff options
author | Parshad Patel <pars.patel@samsung.com> | 2018-11-12 21:02:13 +0900 |
---|---|---|
committer | Tal Gitelman <tal.gitelman@att.com> | 2018-11-19 16:12:25 +0000 |
commit | d9dc69b70251551160466fd76a51a8ff16b4bdd0 (patch) | |
tree | 44922b1933d767d505b36ab58d0a8e72dfd832e3 /common-app-api/src/main | |
parent | 3864c21cfc866d706d989906e6fec6f88a5d8587 (diff) |
Fix sonar critical issue in common-app-api
Fix use "isAssignableFrom" instead issue
Issue-ID: SDC-1895
Change-Id: Ifb51c4bca8df5dd7cdb95bbf5baa1b39004dd1ea
Signed-off-by: Parshad Patel <pars.patel@samsung.com>
Diffstat (limited to 'common-app-api/src/main')
-rw-r--r-- | common-app-api/src/main/java/org/openecomp/sdc/common/log/elements/LoggerFactory.java | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/common-app-api/src/main/java/org/openecomp/sdc/common/log/elements/LoggerFactory.java b/common-app-api/src/main/java/org/openecomp/sdc/common/log/elements/LoggerFactory.java index de02c067c8..d294f41e98 100644 --- a/common-app-api/src/main/java/org/openecomp/sdc/common/log/elements/LoggerFactory.java +++ b/common-app-api/src/main/java/org/openecomp/sdc/common/log/elements/LoggerFactory.java @@ -15,19 +15,19 @@ public class LoggerFactory { @SuppressWarnings("unchecked") public static <T, V> V getLogger(Class<T> type, Logger logger) { - if (type.getName().equals(LoggerAudit.class.getName())) { + if (type.isAssignableFrom(LoggerAudit.class)) { return (V) new LoggerAudit(new LogFieldsMdcHandler(), logger); } - if (type.getName().equals(LoggerDebug.class.getName())) { + if (type.isAssignableFrom(LoggerDebug.class)) { return (V) new LoggerDebug(new LogFieldsMdcHandler(), logger); } - if (type.getName().equals(LoggerMetric.class.getName())) { + if (type.isAssignableFrom(LoggerMetric.class)) { return (V) new LoggerMetric(new LogFieldsMdcHandler(), logger); } - if (type.getName().equals(LoggerError.class.getName())) { + if (type.isAssignableFrom(LoggerError.class)) { return (V) new LoggerError(new LogFieldsMdcHandler(), logger); } @@ -37,19 +37,19 @@ public class LoggerFactory { @SuppressWarnings("unchecked") public static <T, V> V getMdcLogger(Class<T> type, Logger logger) { - if (type.getName().equals(LoggerAudit.class.getName())) { + if (type.isAssignableFrom(LoggerAudit.class)) { return (V) new LoggerAudit(LogFieldsMdcHandler.getInstance(), logger); } - if (type.getName().equals(LoggerDebug.class.getName())) { + if (type.isAssignableFrom(LoggerDebug.class)) { return (V) new LoggerDebug(LogFieldsMdcHandler.getInstance(), logger); } - if (type.getName().equals(LoggerMetric.class.getName())) { + if (type.isAssignableFrom(LoggerMetric.class)) { return (V) new LoggerMetric(LogFieldsMdcHandler.getInstance(), logger); } - if (type.getName().equals(LoggerError.class.getName())) { + if (type.isAssignableFrom(LoggerError.class)) { return (V) new LoggerError(LogFieldsMdcHandler.getInstance(), logger); } |