Fixed few sonar warnings.
[controller.git] / opendaylight / config / config-manager / src / main / java / org / opendaylight / controller / config / manager / impl / dynamicmbean / AnnotationsHelper.java
index fba9844dbfaf9d7fc8cef7ed54e223c73c7431b2..6859e4caf3f37dd086a512651146290e8306b53a 100644 (file)
@@ -45,14 +45,15 @@ public class AnnotationsHelper {
                 }
                 // we need to go deeper
                 inspectedClass = inspectedClass.getSuperclass();
+                // no need to go further
             } catch (NoSuchMethodException e) {
-                inspectedClass = Object.class; // no need to go further
+                inspectedClass = Object.class;
             }
         } while (!inspectedClass.equals(Object.class));
 
         // inspect interfaces
         for (Class<?> ifc : inspectedInterfaces) {
-            if (ifc.isInterface() == false) {
+            if (!ifc.isInterface()) {
                 throw new IllegalArgumentException(ifc + " is not an interface");
             }
             try {
@@ -78,7 +79,7 @@ public class AnnotationsHelper {
      */
     static <T extends Annotation> List<T> findClassAnnotationInSuperClassesAndIfcs(
             final Class<?> clazz, final Class<T> annotationType, final Set<Class<?>> interfaces) {
-        List<T> result = new ArrayList<T>();
+        List<T> result = new ArrayList<>();
         Class<?> declaringClass = clazz;
         do {
             T annotation = declaringClass.getAnnotation(annotationType);
@@ -86,10 +87,10 @@ public class AnnotationsHelper {
                 result.add(annotation);
             }
             declaringClass = declaringClass.getSuperclass();
-        } while (declaringClass.equals(Object.class) == false);
+        } while (!declaringClass.equals(Object.class));
         // inspect interfaces
         for (Class<?> ifc : interfaces) {
-            if (ifc.isInterface() == false) {
+            if (!ifc.isInterface()) {
                 throw new IllegalArgumentException(ifc + " is not an interface");
             }
             T annotation = ifc.getAnnotation(annotationType);