From 7a0a44eac6167cfeff935c39f2c3f20d3a893c3e Mon Sep 17 00:00:00 2001 From: liamfallon Date: Wed, 4 Dec 2019 09:20:04 +0000 Subject: Minor changes for new Eclipse checkstyle checks The laest Eclipse checkstyle version 8.26.0 does more thorough checking and identified a number of small issues in the apex-pdp codebase. This review fixes those issues. Issue-ID: POLICY-1913 Change-Id: I30ba25e3e425c6d54c77f925e8da3ab841a8357c Signed-off-by: liamfallon --- .../infrastructure/java/classes/ClassUtils.java | 4 +++- .../messaging/util/MessagingUtils.java | 24 ++++++++++++---------- .../infrastructure/threading/ThreadUtilities.java | 4 +++- 3 files changed, 19 insertions(+), 13 deletions(-) (limited to 'core/core-infrastructure') diff --git a/core/core-infrastructure/src/main/java/org/onap/policy/apex/core/infrastructure/java/classes/ClassUtils.java b/core/core-infrastructure/src/main/java/org/onap/policy/apex/core/infrastructure/java/classes/ClassUtils.java index 16a3369fb..6da92d55e 100644 --- a/core/core-infrastructure/src/main/java/org/onap/policy/apex/core/infrastructure/java/classes/ClassUtils.java +++ b/core/core-infrastructure/src/main/java/org/onap/policy/apex/core/infrastructure/java/classes/ClassUtils.java @@ -60,7 +60,9 @@ public abstract class ClassUtils { /** * Private constructor used to prevent sub class instantiation. */ - private ClassUtils() {} + private ClassUtils() { + // Private constructor to block subclassing + } /** * Get the class names of all classes on the class path. WARNING: This is a heavy call, use sparingly diff --git a/core/core-infrastructure/src/main/java/org/onap/policy/apex/core/infrastructure/messaging/util/MessagingUtils.java b/core/core-infrastructure/src/main/java/org/onap/policy/apex/core/infrastructure/messaging/util/MessagingUtils.java index a6c3c5854..1c5f2a3a6 100644 --- a/core/core-infrastructure/src/main/java/org/onap/policy/apex/core/infrastructure/messaging/util/MessagingUtils.java +++ b/core/core-infrastructure/src/main/java/org/onap/policy/apex/core/infrastructure/messaging/util/MessagingUtils.java @@ -29,12 +29,13 @@ import java.net.NetworkInterface; import java.net.Socket; import java.net.UnknownHostException; import java.util.Enumeration; + import org.slf4j.ext.XLogger; import org.slf4j.ext.XLoggerFactory; /** - * The Class MessagingUtils is a class with static methods used in IPC messaging for finding free - * ports, translating host names to addresses, serializing objects and flushing object streams. + * The Class MessagingUtils is a class with static methods used in IPC messaging for finding free ports, translating + * host names to addresses, serializing objects and flushing object streams. * * @author Sajeevan Achuthan (sajeevan.achuthan@ericsson.com) */ @@ -53,11 +54,13 @@ public final class MessagingUtils { /** * Private constructor used to prevent sub class instantiation. */ - private MessagingUtils() {} + private MessagingUtils() { + // Private constructor to block subclassing + } /** - * This method searches the availability of the port, if the requested port not available, this - * method will throw an exception. + * This method searches the availability of the port, if the requested port not available, this method will throw an + * exception. * * @param port the port to check * @return the port verified as being free @@ -75,9 +78,9 @@ public final class MessagingUtils { } /** - * This method searches the availability of the port, if the requested port not available,this - * method will increment the port number and check the availability of that port, this process - * will continue until it reaches max port range which is MAX_PORT_RANGE. + * This method searches the availability of the port, if the requested port not available,this method will increment + * the port number and check the availability of that port, this process will continue until it reaches max port + * range which is MAX_PORT_RANGE. * * @param port the first port to check * @return the port that was found @@ -129,9 +132,8 @@ public final class MessagingUtils { } /** - * This method searches the availability of the port, if the requested port not available,this - * method will increment the port number and check the availability, this process will continue - * until it find port available. + * This method searches the availability of the port, if the requested port not available,this method will increment + * the port number and check the availability, this process will continue until it find port available. * * @param port the first port to check * @return the port that was found diff --git a/core/core-infrastructure/src/main/java/org/onap/policy/apex/core/infrastructure/threading/ThreadUtilities.java b/core/core-infrastructure/src/main/java/org/onap/policy/apex/core/infrastructure/threading/ThreadUtilities.java index b5663e452..eb4e0210b 100644 --- a/core/core-infrastructure/src/main/java/org/onap/policy/apex/core/infrastructure/threading/ThreadUtilities.java +++ b/core/core-infrastructure/src/main/java/org/onap/policy/apex/core/infrastructure/threading/ThreadUtilities.java @@ -30,7 +30,9 @@ public final class ThreadUtilities { /** * Private constructor to prevent sub-classing of this class. */ - private ThreadUtilities() {} + private ThreadUtilities() { + // Private constructor to prevent subclassing + } /** * Sleeps for the specified number of milliseconds, hiding interrupt handling. -- cgit 1.2.3-korg