Sonar issues clean-up
[yangtools.git] / yang / yang-parser-impl / src / main / java / org / opendaylight / yangtools / yang / parser / stmt / rfc6020 / AugmentUtils.java
index d4d59d630deea46085e2783e945f73dc3a2b26ee..373ec1f40e78b894f4b0e12620c864e6c57c94d1 100644 (file)
@@ -32,12 +32,12 @@ import org.opendaylight.yangtools.yang.parser.stmt.reactor.StatementContextBase;
 
 public final class AugmentUtils {
 
-    private AugmentUtils() {
-    }
-
     private static final String REGEX_PATH_REL1 = "\\.\\.?\\s*/(.+)";
     private static final String REGEX_PATH_REL2 = "//.*";
 
+    private AugmentUtils() {
+    }
+
     public static Iterable<QName> parseAugmentPath(StmtContext<?, ?, ?> ctx, String path) {
 
         if (path.matches(REGEX_PATH_REL1) || path.matches(REGEX_PATH_REL2)) {
@@ -111,19 +111,17 @@ public final class AugmentUtils {
         noCopyDefSet.add(Rfc6020Mapping.USES);
 
         StatementDefinition def = stmtContext.getPublicDefinition();
-        return (!noCopyDefSet.contains(def));
+        return !noCopyDefSet.contains(def);
     }
 
     public static boolean isReusedByAugment(StmtContext<?, ?, ?> stmtContext) {
 
-        HashSet<StatementDefinition> reusedDefSet = new HashSet<>();
+        Set<StatementDefinition> reusedDefSet = new HashSet<>();
         reusedDefSet.add(Rfc6020Mapping.TYPEDEF);
 
         StatementDefinition def = stmtContext.getPublicDefinition();
-        if (reusedDefSet.contains(def))
-            return true;
-        else
-            return false;
+
+        return reusedDefSet.contains(def);
     }
 
     public static StatementContextBase<?, ?, ?> getAugmentTargetCtx(