aboutsummaryrefslogtreecommitdiffstats
path: root/common-logging/src/main/java
diff options
context:
space:
mode:
authorJim Hahn <jrh3@att.com>2020-06-17 08:37:15 -0400
committerJim Hahn <jrh3@att.com>2020-06-17 11:45:16 -0400
commit611f63a4bb71d677cf2665b1794e91148ba42a51 (patch)
treec6f82e5ffcd10712e0279c40bf8e59ed49f2332e /common-logging/src/main/java
parent3bd6679bd7d8f67b4827a610c25ed9671b74d89c (diff)
Cleanup various sonar issues in policy-common
Addressed the following issues: - unused imports - unused method parameters - use assertEquals, assertSame instead of assertTrue - provide the parametrized type for this generic Also fixed some checkstyle issues: - removed blank lines between "import" groups Issue-ID: POLICY-2650 Change-Id: I004bb650ac10c49ccd0fc405f6959896fec39f9b Signed-off-by: Jim Hahn <jrh3@att.com>
Diffstat (limited to 'common-logging/src/main/java')
-rw-r--r--common-logging/src/main/java/org/onap/policy/common/logging/OnapLoggingContext.java3
-rw-r--r--common-logging/src/main/java/org/onap/policy/common/logging/eelf/PolicyLogger.java2
-rw-r--r--common-logging/src/main/java/org/onap/policy/common/logging/flexlogger/EelfLogger.java2
-rw-r--r--common-logging/src/main/java/org/onap/policy/common/logging/flexlogger/FlexLogger.java8
-rw-r--r--common-logging/src/main/java/org/onap/policy/common/logging/flexlogger/Logger.java1
-rw-r--r--common-logging/src/main/java/org/onap/policy/common/logging/flexlogger/SystemOutLogger.java2
-rw-r--r--common-logging/src/main/java/org/onap/policy/common/logging/nsa/impl/SharedContext.java7
7 files changed, 6 insertions, 19 deletions
diff --git a/common-logging/src/main/java/org/onap/policy/common/logging/OnapLoggingContext.java b/common-logging/src/main/java/org/onap/policy/common/logging/OnapLoggingContext.java
index 0373abfe..47c05041 100644
--- a/common-logging/src/main/java/org/onap/policy/common/logging/OnapLoggingContext.java
+++ b/common-logging/src/main/java/org/onap/policy/common/logging/OnapLoggingContext.java
@@ -2,7 +2,7 @@
* ============LICENSE_START=======================================================
* ONAP-Logging
* ================================================================================
- * Copyright (C) 2017-2019 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2017-2020 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -24,7 +24,6 @@ import java.text.SimpleDateFormat;
import java.time.Duration;
import java.time.Instant;
import java.util.Date;
-
import org.onap.policy.common.logging.nsa.LoggingContextFactory;
import org.onap.policy.common.logging.nsa.SharedLoggingContext;
import org.slf4j.MDC;
diff --git a/common-logging/src/main/java/org/onap/policy/common/logging/eelf/PolicyLogger.java b/common-logging/src/main/java/org/onap/policy/common/logging/eelf/PolicyLogger.java
index 7bc2c1dc..c582ea85 100644
--- a/common-logging/src/main/java/org/onap/policy/common/logging/eelf/PolicyLogger.java
+++ b/common-logging/src/main/java/org/onap/policy/common/logging/eelf/PolicyLogger.java
@@ -54,10 +54,8 @@ import java.net.UnknownHostException;
import java.text.SimpleDateFormat;
import java.time.Duration;
import java.time.Instant;
-import java.util.Arrays;
import java.util.Date;
import java.util.Iterator;
-import java.util.Map;
import java.util.Properties;
import java.util.Timer;
import java.util.UUID;
diff --git a/common-logging/src/main/java/org/onap/policy/common/logging/flexlogger/EelfLogger.java b/common-logging/src/main/java/org/onap/policy/common/logging/flexlogger/EelfLogger.java
index df60fa9c..837a584f 100644
--- a/common-logging/src/main/java/org/onap/policy/common/logging/flexlogger/EelfLogger.java
+++ b/common-logging/src/main/java/org/onap/policy/common/logging/flexlogger/EelfLogger.java
@@ -21,10 +21,8 @@
package org.onap.policy.common.logging.flexlogger;
import com.att.eelf.configuration.EELFLogger.Level;
-
import java.io.Serializable;
import java.util.UUID;
-
import org.onap.policy.common.logging.eelf.MessageCodes;
import org.onap.policy.common.logging.eelf.PolicyLogger;
diff --git a/common-logging/src/main/java/org/onap/policy/common/logging/flexlogger/FlexLogger.java b/common-logging/src/main/java/org/onap/policy/common/logging/flexlogger/FlexLogger.java
index 62459bcc..eb6daee9 100644
--- a/common-logging/src/main/java/org/onap/policy/common/logging/flexlogger/FlexLogger.java
+++ b/common-logging/src/main/java/org/onap/policy/common/logging/flexlogger/FlexLogger.java
@@ -29,7 +29,6 @@ import java.util.Date;
import java.util.Properties;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
-
import org.onap.policy.common.logging.eelf.PolicyLogger;
import org.onap.policy.common.logging.flexlogger.PropertyUtil.Listener;
@@ -73,10 +72,8 @@ public class FlexLogger extends SecurityManager {
/**
* Returns an instance of Logger.
- *
- * @param name the name of the logger
*/
- public static Logger getLogger(String name) {
+ public static Logger getLogger() {
Logger logger = null;
displayMessage(GET_LOGGER_PREFIX + loggerType);
switch (loggerType) {
@@ -121,10 +118,9 @@ public class FlexLogger extends SecurityManager {
/**
* Returns an instance of Logger.
*
- * @param name the name of the logger
* @param isNewTransaction is a new transaction
*/
- public static Logger getLogger(String name, boolean isNewTransaction) {
+ public static Logger getLogger(boolean isNewTransaction) {
Logger logger = null;
displayMessage(GET_LOGGER_PREFIX + loggerType);
switch (loggerType) {
diff --git a/common-logging/src/main/java/org/onap/policy/common/logging/flexlogger/Logger.java b/common-logging/src/main/java/org/onap/policy/common/logging/flexlogger/Logger.java
index 315cd935..ad155a4c 100644
--- a/common-logging/src/main/java/org/onap/policy/common/logging/flexlogger/Logger.java
+++ b/common-logging/src/main/java/org/onap/policy/common/logging/flexlogger/Logger.java
@@ -21,7 +21,6 @@
package org.onap.policy.common.logging.flexlogger;
import java.util.UUID;
-
import org.onap.policy.common.logging.eelf.MessageCodes;
/**
diff --git a/common-logging/src/main/java/org/onap/policy/common/logging/flexlogger/SystemOutLogger.java b/common-logging/src/main/java/org/onap/policy/common/logging/flexlogger/SystemOutLogger.java
index bc7633da..a059bd77 100644
--- a/common-logging/src/main/java/org/onap/policy/common/logging/flexlogger/SystemOutLogger.java
+++ b/common-logging/src/main/java/org/onap/policy/common/logging/flexlogger/SystemOutLogger.java
@@ -23,11 +23,9 @@ package org.onap.policy.common.logging.flexlogger;
import static org.onap.policy.common.logging.flexlogger.DisplayUtils.displayMessage;
import com.att.eelf.configuration.EELFLogger.Level;
-
import java.io.Serializable;
import java.util.Arrays;
import java.util.UUID;
-
import org.onap.policy.common.logging.OnapLoggingUtils;
import org.onap.policy.common.logging.eelf.MessageCodes;
import org.onap.policy.common.logging.eelf.PolicyLogger;
diff --git a/common-logging/src/main/java/org/onap/policy/common/logging/nsa/impl/SharedContext.java b/common-logging/src/main/java/org/onap/policy/common/logging/nsa/impl/SharedContext.java
index e5f5e65b..13b38fc0 100644
--- a/common-logging/src/main/java/org/onap/policy/common/logging/nsa/impl/SharedContext.java
+++ b/common-logging/src/main/java/org/onap/policy/common/logging/nsa/impl/SharedContext.java
@@ -2,14 +2,14 @@
* ============LICENSE_START=======================================================
* ONAP-Logging
* ================================================================================
- * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2017-2018, 2020 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -22,7 +22,6 @@ package org.onap.policy.common.logging.nsa.impl;
import java.util.HashMap;
import java.util.Map.Entry;
-
import org.onap.policy.common.logging.nsa.LoggingContext;
import org.onap.policy.common.logging.nsa.SharedLoggingContext;