X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;ds=sidebyside;f=opendaylight%2Fconfig%2Fconfig-manager%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fconfig%2Fmanager%2Fimpl%2Futil%2FInterfacesHelper.java;h=4d94c6d2655650ece2f9bcb1a26a3e0b872a7d60;hb=0a16f37f1baa4a2616e9b7289a445649b4f3132d;hp=510fdf9373f46a7dc0c5f1aa61aabd15d31fbb25;hpb=1d913b4ae95e8ce80645dd96df5b28750c3053e2;p=controller.git diff --git a/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/util/InterfacesHelper.java b/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/util/InterfacesHelper.java index 510fdf9373..4d94c6d265 100644 --- a/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/util/InterfacesHelper.java +++ b/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/util/InterfacesHelper.java @@ -21,6 +21,9 @@ import java.util.Set; public class InterfacesHelper { + private InterfacesHelper() { + } + public static Set> getAllInterfaces(Class clazz) { if (clazz.isInterface()) { throw new IllegalArgumentException(clazz @@ -38,17 +41,17 @@ public class InterfacesHelper { } private static Set> getAllSuperInterfaces(Set> ifcs) { - ifcs = new HashSet<>(ifcs); // create copy to modify + Set> interfaces = new HashSet<>(ifcs); // create copy to modify // each interface can extend other interfaces Set> result = new HashSet<>(); - while (ifcs.size() > 0) { - Iterator> iterator = ifcs.iterator(); + while (!interfaces.isEmpty()) { + Iterator> iterator = interfaces.iterator(); Class ifc = iterator.next(); iterator.remove(); if (ifc.isInterface() == false) { throw new IllegalArgumentException(ifc + " should be an interface"); } - ifcs.addAll(Arrays.asList(ifc.getInterfaces())); + interfaces.addAll(Arrays.asList(ifc.getInterfaces())); result.add(ifc); } return result;