aboutsummaryrefslogtreecommitdiffstats
path: root/policy-utils/src/main/java/org
diff options
context:
space:
mode:
authorPamela Dragosh <pdragosh@research.att.com>2018-02-01 15:10:57 -0500
committerPamela Dragosh <pdragosh@research.att.com>2018-02-01 16:34:30 -0500
commit8309dc93f39f8fbe5ba899f8311781ab9729986d (patch)
tree2db3c3c628a731540b4f3061d5af133467d0b7f6 /policy-utils/src/main/java/org
parentb8cf385b8df2ab67e345bbf16f30117dc0afe4c9 (diff)
Reduce technical debt add coverage
* add empty constructor message * remove unnecessary exception declaration * add @FunctionalInterface declaration * switched around public static per java conventions * fixed up JUnit ordering * added some trivial JUnit tests to bump coverage > 70% Issue-ID: POLICY-460 Change-Id: I13b6de29f66d692143b06180feed76dd6332d6cf Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
Diffstat (limited to 'policy-utils/src/main/java/org')
-rw-r--r--policy-utils/src/main/java/org/onap/policy/drools/utils/LoggerUtil.java4
-rw-r--r--policy-utils/src/main/java/org/onap/policy/drools/utils/NetworkUtil.java3
-rw-r--r--policy-utils/src/main/java/org/onap/policy/drools/utils/OrderedService.java1
-rw-r--r--policy-utils/src/main/java/org/onap/policy/drools/utils/ReflectionUtil.java6
4 files changed, 10 insertions, 4 deletions
diff --git a/policy-utils/src/main/java/org/onap/policy/drools/utils/LoggerUtil.java b/policy-utils/src/main/java/org/onap/policy/drools/utils/LoggerUtil.java
index 257d2dae..681a2b20 100644
--- a/policy-utils/src/main/java/org/onap/policy/drools/utils/LoggerUtil.java
+++ b/policy-utils/src/main/java/org/onap/policy/drools/utils/LoggerUtil.java
@@ -32,6 +32,10 @@ public class LoggerUtil {
* Root logger
*/
public static final String ROOT_LOGGER = "ROOT";
+
+ private LoggerUtil() {
+ // Empty constructor
+ }
/**
* set the log level of a logger
diff --git a/policy-utils/src/main/java/org/onap/policy/drools/utils/NetworkUtil.java b/policy-utils/src/main/java/org/onap/policy/drools/utils/NetworkUtil.java
index bd5b8aac..6734226d 100644
--- a/policy-utils/src/main/java/org/onap/policy/drools/utils/NetworkUtil.java
+++ b/policy-utils/src/main/java/org/onap/policy/drools/utils/NetworkUtil.java
@@ -39,6 +39,9 @@ public class NetworkUtil {
*/
public static final String IPv4_WILDCARD_ADDRESS = "0.0.0.0";
+ private NetworkUtil() {
+ // Empty constructor
+ }
/**
* try to connect to $host:$port $retries times while we are getting connection failures.
diff --git a/policy-utils/src/main/java/org/onap/policy/drools/utils/OrderedService.java b/policy-utils/src/main/java/org/onap/policy/drools/utils/OrderedService.java
index 75a3cd7d..7a6ca0a0 100644
--- a/policy-utils/src/main/java/org/onap/policy/drools/utils/OrderedService.java
+++ b/policy-utils/src/main/java/org/onap/policy/drools/utils/OrderedService.java
@@ -25,6 +25,7 @@ package org.onap.policy.drools.utils;
* of services (features) discovered via 'ServiceLoader'. See
* 'OrderedServiceImpl' for more details.
*/
+@FunctionalInterface
public interface OrderedService
{
/**
diff --git a/policy-utils/src/main/java/org/onap/policy/drools/utils/ReflectionUtil.java b/policy-utils/src/main/java/org/onap/policy/drools/utils/ReflectionUtil.java
index 50135e84..bf59ec96 100644
--- a/policy-utils/src/main/java/org/onap/policy/drools/utils/ReflectionUtil.java
+++ b/policy-utils/src/main/java/org/onap/policy/drools/utils/ReflectionUtil.java
@@ -45,8 +45,7 @@ public class ReflectionUtil {
* @throws IllegalArgumentException if an invalid parameter has been passed in
*/
public static Class<?> fetchClass(ClassLoader classLoader,
- String className)
- throws IllegalArgumentException {
+ String className) {
if (classLoader == null)
throw new IllegalArgumentException("A class loader must be provided");
@@ -70,8 +69,7 @@ public class ReflectionUtil {
* @return true if exists
* @throws IllegalArgumentException if an invalid parameter has been passed in
*/
- public static boolean isClass(ClassLoader classLoader, String classname)
- throws IllegalArgumentException {
+ public static boolean isClass(ClassLoader classLoader, String classname) {
return fetchClass(classLoader, classname) != null;
}