Cleanup checkstyle warnings and turn enforcement on in yang-data-impl
[yangtools.git] / yang / yang-data-impl / src / main / java / org / opendaylight / yangtools / yang / data / impl / leafref / LeafRefUtils.java
index 58a6f1538a3a94228efca49203dbc10b7e343fdb..8f41856bd88ee656ed1372feea4412b6927457de 100644 (file)
@@ -26,6 +26,8 @@ public final class LeafRefUtils {
     }
 
     /**
+     * Create an absolute leafref path.
+     *
      * @param leafRefPath leafRefPath
      * @param contextNodeSchemaPath contextNodeSchemaPath
      * @param module module
@@ -41,11 +43,7 @@ public final class LeafRefUtils {
 
         final Deque<QNameWithPredicate> absoluteLeafRefTargetPathList = schemaPathToXPathQNames(
                 contextNodeSchemaPath, module);
-
-        final Iterable<QNameWithPredicate> leafRefTargetPathFromRoot = leafRefPath
-                .getPathFromRoot();
-        final Iterator<QNameWithPredicate> leafRefTgtPathFromRootIterator = leafRefTargetPathFromRoot
-                .iterator();
+        final Iterator<QNameWithPredicate> leafRefTgtPathFromRootIterator = leafRefPath.getPathFromRoot().iterator();
 
         while (leafRefTgtPathFromRootIterator.hasNext()) {
             final QNameWithPredicate qname = leafRefTgtPathFromRootIterator.next();
@@ -59,11 +57,6 @@ public final class LeafRefUtils {
         return LeafRefPath.create(absoluteLeafRefTargetPathList, true);
     }
 
-    /**
-     * @param currentNodePath
-     * @param module
-     * @param absoluteLeafRefTargetPathList
-     */
     private static Deque<QNameWithPredicate> schemaPathToXPathQNames(
             final SchemaPath nodePath, final Module module) {
 
@@ -114,11 +107,7 @@ public final class LeafRefUtils {
         return xpath;
     }
 
-    public static LeafRefPath schemaPathToLeafRefPath(final SchemaPath nodePath,
-            final Module module) {
-        final Deque<QNameWithPredicate> xpathQNames = schemaPathToXPathQNames(
-                nodePath, module);
-        return LeafRefPath.create(xpathQNames, true);
+    public static LeafRefPath schemaPathToLeafRefPath(final SchemaPath nodePath, final Module module) {
+        return LeafRefPath.create(schemaPathToXPathQNames(nodePath, module), true);
     }
-
 }