Hide constructor of utility classes 13/24013/1
authorRyan Moats <rmoats@us.ibm.com>
Fri, 10 Jul 2015 18:25:32 +0000 (13:25 -0500)
committerRyan Moats <rmoats@us.ibm.com>
Fri, 10 Jul 2015 18:25:32 +0000 (13:25 -0500)
From squid:
"Utility classes, which are a collection of static members,
are not meant to be instantiated. Even abstract utility
classes, which can be extended, should not have public constructors.

Java adds an implicit public constructor to every class
which does not define at least one explicitly. Hence,
at least one non-public constructor should be defined."

Change-Id: Ibc83dfbf6f1777acccd41e89ef5a371eabfa51d4
Signed-off-by: Ryan Moats <rmoats@us.ibm.com>
northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/NeutronUtil.java
northbound-api/src/main/java/org/opendaylight/neutron/northbound/api/PaginatedRequestFactory.java

index 6b51c20bf0436e16063c3ebe98dc77b78f20ece1..cd1ce98f5d25c315991670ed587fd7ec0a3b1f65 100644 (file)
@@ -9,6 +9,10 @@ import org.slf4j.LoggerFactory;
 public class NeutronUtil {
     private static final Logger LOGGER = LoggerFactory
             .getLogger(NeutronUtil.class);
+
+    private NeutronUtil() {
+    }
+
     public static Object[] getInstances(Class<?> clazz,Object bundle) {
         Object instances[] = null;
         try {
index 95ff0ebe8deb9c24664871e832c495808f83fe5a..22fe429a360d77a084baf83a48f5e3bed746f413 100644 (file)
@@ -22,6 +22,7 @@ import org.opendaylight.neutron.spi.NeutronPort;
 import org.opendaylight.neutron.spi.NeutronSubnet;
 
 public class PaginatedRequestFactory {
+
     private static final Comparator<INeutronObject> NEUTRON_OBJECT_COMPARATOR = new Comparator<INeutronObject>() {
         @Override
         public int compare(INeutronObject o1, INeutronObject o2) {
@@ -57,6 +58,9 @@ public class PaginatedRequestFactory {
         }
     }
 
+    private PaginatedRequestFactory() {
+    }
+
     /*
      * SuppressWarnings is needed because the compiler does not understand that we
      * are actually safe here.