Fixing sonar issues
[yangtools.git] / code-generator / binding-generator-impl / src / main / java / org / opendaylight / yangtools / sal / binding / yang / types / UnionDependencySort.java
index c23a46563a32817d5fe3569adf1b2fb95df20ec7..74b4c77b10624a9caf8f5473985ffda5ce1831dc 100644 (file)
@@ -25,7 +25,7 @@ import com.google.common.collect.Maps;
 import com.google.common.collect.Sets;
 
 public class UnionDependencySort {
-    private static final Logger logger = LoggerFactory.getLogger(UnionDependencySort.class);
+    private static final Logger LOGGER = LoggerFactory.getLogger(UnionDependencySort.class);
 
     /**
      * Sorts union types by mutual dependencies.
@@ -40,9 +40,9 @@ public class UnionDependencySort {
      * @throws IllegalArgumentException
      *             if <code>typeDefinitions</code> equals <code>null</code>
      */
-    public static List<ExtendedType> sort(final Set<TypeDefinition<?>> typeDefinitions) {
+    public List<ExtendedType> sort(final Set<TypeDefinition<?>> typeDefinitions) {
         if (typeDefinitions == null) {
-            logger.error("Set of Type Definitions cannot be NULL!");
+            LOGGER.error("Set of Type Definitions cannot be NULL!");
             throw new IllegalArgumentException("Set of Type Definitions " + "cannot be NULL!");
         }
 
@@ -66,14 +66,13 @@ public class UnionDependencySort {
      *            set of all type definitions
      * @return set of extended type which are union type definition
      */
-    private static Set<ExtendedType> unionsFromTypeDefinitions(final Set<TypeDefinition<?>> typeDefinitions) {
+    private Set<ExtendedType> unionsFromTypeDefinitions(final Set<TypeDefinition<?>> typeDefinitions) {
         final Set<ExtendedType> unions = Sets.newHashSet();
 
         for (final TypeDefinition<?> typedef : typeDefinitions) {
-            if ((typedef != null) && (typedef.getBaseType() != null)) {
-                if (typedef instanceof ExtendedType && typedef.getBaseType() instanceof UnionTypeDefinition) {
-                    unions.add((ExtendedType) typedef);
-                }
+            if ((typedef != null) && (typedef.getBaseType() != null) && (typedef instanceof ExtendedType)
+                    && (typedef.getBaseType() instanceof UnionTypeDefinition)) {
+                unions.add((ExtendedType) typedef);
             }
         }
         return unions;
@@ -97,7 +96,7 @@ public class UnionDependencySort {
      * @return set of nodes which contains wrapped union types set of node where
      *         each one contains wrapped one union type
      */
-    private static Set<Node> unionTypesToNodes(final Set<ExtendedType> extUnionTypes) {
+    private Set<Node> unionTypesToNodes(final Set<ExtendedType> extUnionTypes) {
         final Map<ExtendedType, Node> nodeMap = Maps.newHashMap();
         final Set<Node> resultNodes = Sets.newHashSet();