Fix checkstyle issues reported by odlparent-3.0.0's checkstyle 90/65490/1
authorRobert Varga <robert.varga@pantheon.tech>
Mon, 13 Nov 2017 16:08:58 +0000 (17:08 +0100)
committerRobert Varga <robert.varga@pantheon.tech>
Mon, 13 Nov 2017 16:12:01 +0000 (17:12 +0100)
This is a preparatory patch, cleaning up violations which will be
enforced by odlparent-3.0.0.

Change-Id: I0ea6b387c9d3095ff01c8e00d10c6d9d0c29aec9
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Signed-off-by: Stephen Kitt <skitt@redhat.com>
72 files changed:
common/util/src/main/java/org/opendaylight/yangtools/util/DurationStatisticsTracker.java
common/util/src/main/java/org/opendaylight/yangtools/util/MutableOffsetMap.java
common/util/src/main/java/org/opendaylight/yangtools/util/SharedSingletonMap.java
common/util/src/test/java/org/opendaylight/yangtools/util/concurrent/QueuedNotificationManagerTest.java
common/util/src/test/java/org/opendaylight/yangtools/util/concurrent/ThreadPoolExecutorTest.java
yang/rfc8040-model-api/src/main/java/org/opendaylight/yangtools/rfc8040/model/api/YangDataConstants.java
yang/yang-common/src/main/java/org/opendaylight/yangtools/yang/common/QNameModule.java
yang/yang-common/src/main/java/org/opendaylight/yangtools/yang/common/RpcResultBuilder.java
yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/DataContainerNode.java
yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/tree/DataTreeCandidateNode.java
yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/tree/EmptyDataTreeCandidateNode.java
yang/yang-data-api/src/main/java/org/opendaylight/yangtools/yang/data/api/schema/tree/NormalizedNodeDataTreeCandidateNode.java
yang/yang-data-api/src/test/java/org/opendaylight/yangtools/yang/data/api/YangInstanceIdentifierTest.java
yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/leafref/LeafRefContextBuilder.java
yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/leafref/LeafRefPath.java
yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/leafref/LeafRefPathErrorListener.java
yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/impl/AbstractImmutableDataContainerNodeAttrBuilder.java
yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/impl/AbstractImmutableDataContainerNodeBuilder.java
yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/impl/AbstractImmutableNormalizedNodeBuilder.java
yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/impl/ImmutableAnyXmlNodeSchemaAwareBuilder.java
yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/impl/ImmutableAugmentationNodeSchemaAwareBuilder.java
yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/impl/ImmutableChoiceNodeSchemaAwareBuilder.java
yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/impl/ImmutableContainerNodeSchemaAwareBuilder.java
yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/impl/ImmutableLeafNodeBuilder.java
yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/impl/ImmutableLeafNodeSchemaAwareBuilder.java
yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/impl/ImmutableLeafSetEntryNodeSchemaAwareBuilder.java
yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/impl/ImmutableLeafSetNodeBuilder.java
yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/impl/ImmutableLeafSetNodeSchemaAwareBuilder.java
yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/impl/ImmutableMapEntryNodeBuilder.java
yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/impl/ImmutableMapEntryNodeSchemaAwareBuilder.java
yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/impl/ImmutableMapNodeBuilder.java
yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/impl/ImmutableMapNodeSchemaAwareBuilder.java
yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/impl/ImmutableOrderedLeafSetNodeBuilder.java
yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/impl/ImmutableOrderedLeafSetNodeSchemaAwareBuilder.java
yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/impl/ImmutableOrderedMapNodeBuilder.java
yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/impl/ImmutableOrderedMapNodeSchemaAwareBuilder.java
yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/builder/impl/ImmutableUnkeyedListNodeBuilder.java
yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/nodes/AbstractImmutableNormalizedValueNode.java
yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/tree/AbstractCursorAware.java
yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/tree/ModifiedNode.java
yang/yang-data-impl/src/test/java/org/opendaylight/yangtools/yang/data/impl/leafref/context/LeafRefContextTreeBuilderTest.java
yang/yang-data-impl/src/test/java/org/opendaylight/yangtools/yang/data/impl/schema/tree/Bug4454Test.java
yang/yang-data-jaxen/src/main/java/org/opendaylight/yangtools/yang/data/jaxen/LeafrefXPathStringParsingPathArgumentBuilder.java
yang/yang-maven-plugin/src/test/java/org/opendaylight/yangtools/yang2sources/plugin/GenerateSourcesTest.java
yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/api/SchemaPath.java
yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/api/stmt/SchemaNodeIdentifier.java
yang/yang-model-util/src/main/java/org/opendaylight/yangtools/yang/model/repo/util/SchemaSourceTransformer.java
yang/yang-model-util/src/main/java/org/opendaylight/yangtools/yang/model/util/type/LengthRestrictedTypeBuilder.java
yang/yang-model-util/src/main/java/org/opendaylight/yangtools/yang/model/util/type/RangeRestrictedTypeBuilder.java
yang/yang-model-util/src/main/java/org/opendaylight/yangtools/yang/model/util/type/RestrictedTypes.java
yang/yang-model-util/src/main/java/org/opendaylight/yangtools/yang/model/util/type/StringTypeBuilder.java
yang/yang-model-util/src/test/java/org/opendaylight/yangtools/yang/model/repo/util/SchemaSourceTransformerTest.java
yang/yang-model-util/src/test/java/org/opendaylight/yangtools/yang/model/util/DataNodeIteratorTest.java
yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/repo/SharedSchemaContextFactory.java
yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/repo/YangTextSchemaContextResolver.java
yang/yang-parser-reactor/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/reactor/BuildGlobalContext.java
yang/yang-parser-reactor/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/reactor/ModifierImpl.java
yang/yang-parser-reactor/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/reactor/RootStatementContext.java
yang/yang-parser-reactor/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/reactor/StatementContextBase.java
yang/yang-parser-reactor/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/reactor/StatementMap.java
yang/yang-parser-rfc7950/src/main/java/org/opendaylight/yangtools/yang/parser/rfc7950/repo/StatementSourceReferenceHandler.java
yang/yang-parser-rfc7950/src/main/java/org/opendaylight/yangtools/yang/parser/rfc7950/repo/YangErrorListener.java
yang/yang-parser-rfc7950/src/main/java/org/opendaylight/yangtools/yang/parser/rfc7950/repo/YangModelDependencyInfo.java
yang/yang-parser-rfc7950/src/main/java/org/opendaylight/yangtools/yang/parser/rfc7950/repo/YangStatementParserListenerImpl.java
yang/yang-parser-rfc7950/src/main/java/org/opendaylight/yangtools/yang/parser/rfc7950/stmt/AbstractEffectiveModule.java
yang/yang-parser-rfc7950/src/main/java/org/opendaylight/yangtools/yang/parser/rfc7950/stmt/UnknownEffectiveStatementBase.java
yang/yang-parser-rfc7950/src/main/java/org/opendaylight/yangtools/yang/parser/rfc7950/stmt/action/ActionEffectiveStatementImpl.java
yang/yang-parser-rfc7950/src/main/java/org/opendaylight/yangtools/yang/parser/rfc7950/stmt/module/AbstractModuleStatementSupport.java
yang/yang-parser-rfc7950/src/main/java/org/opendaylight/yangtools/yang/parser/rfc7950/stmt/notification/NotificationEffectiveStatementImpl.java
yang/yang-parser-rfc7950/src/test/java/org/opendaylight/yangtools/yang/stmt/OrderingTest.java
yang/yang-parser-rfc7950/src/test/java/org/opendaylight/yangtools/yang/stmt/StmtTestUtils.java
yang/yang-parser-rfc7950/src/test/java/org/opendaylight/yangtools/yang/stmt/TypesResolutionTest.java

index c376afc2ade0f22b03884cc0f72ded2e6e67daa6..e3d121d68935bce66b867f3bbe2d835e0fac86e4 100644 (file)
@@ -207,7 +207,7 @@ public abstract class DurationStatisticsTracker {
             case NANOSECONDS:
                 return "ns";
             case MICROSECONDS:
-                return "\u03bcs"; // Î¼s
+                return "μs";
             case MILLISECONDS:
                 return "ms";
             case SECONDS:
index 8a04f3230784366401ad6e8b1c85831eb893af34..648b76d99f3c120211ad82241ee30e3e7d87138a 100644 (file)
@@ -63,13 +63,13 @@ public abstract class MutableOffsetMap<K, V> extends AbstractMap<K, V> implement
         }
 
         @Override
-        UnmodifiableMapPhase<K, V> modifiedMap(final List<K> keys, final V[] objects) {
-            return new ImmutableOffsetMap.Ordered<>(OffsetMapCache.orderedOffsets(keys), objects);
+        UnmodifiableMapPhase<K, V> modifiedMap(final List<K> keys, final V[] values) {
+            return new ImmutableOffsetMap.Ordered<>(OffsetMapCache.orderedOffsets(keys), values);
         }
 
         @Override
-        UnmodifiableMapPhase<K, V> unmodifiedMap(final Map<K, Integer> offsets, final V[] objects) {
-            return new ImmutableOffsetMap.Ordered<>(offsets, objects);
+        UnmodifiableMapPhase<K, V> unmodifiedMap(final Map<K, Integer> offsetMap, final V[] values) {
+            return new ImmutableOffsetMap.Ordered<>(offsetMap, values);
         }
 
         @Override
@@ -97,14 +97,14 @@ public abstract class MutableOffsetMap<K, V> extends AbstractMap<K, V> implement
         }
 
         @Override
-        UnmodifiableMapPhase<K, V> modifiedMap(final List<K> keys, final V[] objects) {
+        UnmodifiableMapPhase<K, V> modifiedMap(final List<K> keys, final V[] values) {
             final Map<K, Integer> offsets = OffsetMapCache.unorderedOffsets(keys);
-            return new ImmutableOffsetMap.Unordered<>(offsets, OffsetMapCache.adjustedArray(offsets, keys, objects));
+            return new ImmutableOffsetMap.Unordered<>(offsets, OffsetMapCache.adjustedArray(offsets, keys, values));
         }
 
         @Override
-        UnmodifiableMapPhase<K, V> unmodifiedMap(final Map<K, Integer> offsets, final V[] objects) {
-            return new ImmutableOffsetMap.Unordered<>(offsets, objects);
+        UnmodifiableMapPhase<K, V> unmodifiedMap(final Map<K, Integer> offsetMap, final V[] values) {
+            return new ImmutableOffsetMap.Unordered<>(offsetMap, values);
         }
 
         @Override
@@ -179,9 +179,9 @@ public abstract class MutableOffsetMap<K, V> extends AbstractMap<K, V> implement
 
     abstract Object removedObject();
 
-    abstract UnmodifiableMapPhase<K, V> modifiedMap(List<K> keys, V[] objects);
+    abstract UnmodifiableMapPhase<K, V> modifiedMap(List<K> keys, V[] values);
 
-    abstract UnmodifiableMapPhase<K, V> unmodifiedMap(Map<K, Integer> offsets, V[] objects);
+    abstract UnmodifiableMapPhase<K, V> unmodifiedMap(Map<K, Integer> offsetMap, V[] values);
 
     abstract SharedSingletonMap<K, V> singletonMap();
 
index 0b7a5900fa0d1ece3414f1311bd98e49271565df..8e36661c3ac61b146d64985076cb417d73cad798 100644 (file)
@@ -120,6 +120,7 @@ public abstract class SharedSingletonMap<K, V> implements Serializable, Unmodifi
     }
 
     @Override
+    @SuppressWarnings("checkstyle:hiddenField")
     public final boolean containsValue(final Object value) {
         return this.value.equals(value);
     }
@@ -140,6 +141,7 @@ public abstract class SharedSingletonMap<K, V> implements Serializable, Unmodifi
     }
 
     @Override
+    @SuppressWarnings("checkstyle:hiddenField")
     public final V put(final K key, final V value) {
         throw new UnsupportedOperationException();
     }
index 8d6c9d473fad50d862011be480cfaec7f768bd41..8ce87cab59c213dee9aa26c51ca3ef7365a47a97 100644 (file)
@@ -56,9 +56,9 @@ public class QueuedNotificationManagerTest {
             reset(expCount);
         }
 
-        void reset(final int expCount) {
-            this.expCount = expCount;
-            latch = new CountDownLatch(expCount);
+        void reset(final int newExpCount) {
+            this.expCount = newExpCount;
+            latch = new CountDownLatch(newExpCount);
             actual.clear();
         }
 
index 05c4abd0f0c0862ed4c27f04e398f2cf9edc8dc6..3042e8457d149ed7174a3d6b74536629117125a8 100644 (file)
@@ -71,10 +71,10 @@ public class ThreadPoolExecutorTest {
 
     @Test(expected = RejectedExecutionException.class)
     public void testCachedThreadRejectingTask() throws InterruptedException {
-        ExecutorService executor = SpecialExecutors.newBoundedCachedThreadPool(1, 1, "TestPool");
+        ExecutorService localExecutor = SpecialExecutors.newBoundedCachedThreadPool(1, 1, "TestPool");
 
         for (int i = 0; i < 5; i++) {
-            executor.execute(new Task(null, null, null, null, TimeUnit.MICROSECONDS.convert(5, TimeUnit.SECONDS)));
+            localExecutor.execute(new Task(null, null, null, null, TimeUnit.MICROSECONDS.convert(5, TimeUnit.SECONDS)));
         }
     }
 
@@ -83,12 +83,12 @@ public class ThreadPoolExecutorTest {
         testThreadPoolExecution(SpecialExecutors.newBlockingBoundedCachedThreadPool(2, 1, "TestPool"), 1000, null, 10);
     }
 
-    void testThreadPoolExecution(final ExecutorService executor, final int numTasksToRun, final String expThreadPrefix,
-            final long taskDelay) throws InterruptedException {
+    void testThreadPoolExecution(final ExecutorService executorToTest, final int numTasksToRun,
+            final String expThreadPrefix, final long taskDelay) throws InterruptedException {
 
-        this.executor = executor;
+        this.executor = executorToTest;
 
-        LOG.debug("Testing {} with {} tasks.", executor.getClass().getSimpleName(), numTasksToRun);
+        LOG.debug("Testing {} with {} tasks.", executorToTest.getClass().getSimpleName(), numTasksToRun);
 
         final CountDownLatch tasksRunLatch = new CountDownLatch(numTasksToRun);
         final ConcurrentMap<Thread, AtomicLong> taskCountPerThread = new ConcurrentHashMap<>();
@@ -104,7 +104,7 @@ public class ThreadPoolExecutorTest {
 //                        Uninterruptibles.sleepUninterruptibly(20, TimeUnit.MICROSECONDS);
 //                    }
 
-                    executor.execute(new Task(tasksRunLatch, taskCountPerThread, threadError, expThreadPrefix,
+                    executorToTest.execute(new Task(tasksRunLatch, taskCountPerThread, threadError, expThreadPrefix,
                         taskDelay));
                 }
             }
@@ -127,7 +127,7 @@ public class ThreadPoolExecutorTest {
             LOG.debug("  {} - {} tasks", e.getKey().getName(), e.getValue());
         }
 
-        LOG.debug("{}", executor);
+        LOG.debug("{}", executorToTest);
         LOG.debug("Elapsed time: {}", stopWatch);
     }
 
index 13f52dbdccfefcf20b32fb8857251f5290251f92..48a87fce5fb127d3f58d68f34392e74b7f1722b3 100644 (file)
@@ -20,7 +20,7 @@ import org.opendaylight.yangtools.yang.model.repo.api.SourceIdentifier;
  *
  * @author Robert Varga
  */
-public class YangDataConstants {
+public final class YangDataConstants {
     private static final String MODULE_NAME = "ietf-restconf";
     private static final URI MODULE_NAMESPACE = URI.create("urn:ietf:params:xml:ns:yang:ietf-restconf");
     private static final Revision RFC8040_REVISION = Revision.of("2017-01-26");
index 240778136f23764776964dd70ea6335ac03ce901..ef94e82aec3e7dde762b753ce2042932b987d146 100644 (file)
@@ -128,10 +128,11 @@ public final class QNameModule implements Comparable<QNameModule>, Immutable, Se
     }
 
     /**
-     * Returns a namespace in form defined by section 5.6.4. of {@link https://tools.ietf.org/html/rfc6020}, for example
+     * Returns a namespace in form defined by section 5.6.4. of
+     * <a href=https://tools.ietf.org/html/rfc6020">RFC6020</a>, for example
      * {@code http://example.acme.com/system?revision=2008-04-01}.
      *
-     * @return Namespace in form defined by section 5.6.4. of {@link https://tools.ietf.org/html/rfc6020}.
+     * @return Namespace in form defined by section 5.6.4. of RFC6020.
      * @throws URISyntaxException on incorrect namespace definition
      *
      */
index be6801fc86580bea267a2130adc47ae93928c516..7b877ecb2ee315c500f8a935f9f77cc032b9723f 100644 (file)
@@ -264,6 +264,7 @@ public final class RpcResultBuilder<T> implements Builder<RpcResult<T>> {
      *
      * @param result the result value
      */
+    @SuppressWarnings("checkstyle:hiddenField")
     public RpcResultBuilder<T> withResult(final T result) {
         this.result = result;
         return this;
@@ -395,11 +396,11 @@ public final class RpcResultBuilder<T> implements Builder<RpcResult<T>> {
     /**
      * Adds RpcErrors.
      *
-     * @param errors the list of RpcErrors
+     * @param rpcErrors the list of RpcErrors
      */
-    public RpcResultBuilder<T> withRpcErrors(final Collection<RpcError> errors) {
-        if (errors != null) {
-            for (RpcError error : errors) {
+    public RpcResultBuilder<T> withRpcErrors(final Collection<RpcError> rpcErrors) {
+        if (rpcErrors != null) {
+            for (RpcError error : rpcErrors) {
                 addError(error);
             }
         }
index df43be8819447361f66d9c9c50acddccf9259003..60210617f07c1c3048adbf9ed1c537a68a4311af 100644 (file)
@@ -28,7 +28,7 @@ import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgum
  *
  * @param <K> {@link PathArgument} which identifies instance of {@link DataContainerNode}
  */
-public interface DataContainerNode<K extends PathArgument> extends //
+public interface DataContainerNode<K extends PathArgument> extends
         NormalizedNodeContainer<K, PathArgument, DataContainerChild<? extends PathArgument, ?>> {
     /**
      * Returns iteration of all child nodes.
index 849f7ad4a6a38a966b9717ed502d3807f098d5fe..1f5ec6a47a0b82766d63596cd3247348c41aaa46 100644 (file)
@@ -40,10 +40,10 @@ public interface DataTreeCandidateNode {
      * Returns modified child or null if child was not modified
      * / does not exists.
      *
-     * @param identifier Identifier of child node
+     * @param childIdentifier Identifier of child node
      * @return Modified child or null if child was not modified.
      */
-    @Nullable DataTreeCandidateNode getModifiedChild(PathArgument identifier);
+    @Nullable DataTreeCandidateNode getModifiedChild(PathArgument childIdentifier);
 
     /**
      * Return the type of modification this node is undergoing.
index 580f926f7e93fd7f4f3a52407561e4fb82603688..b77f5c0654d4d4e44e74a6969f8e135921ba36ca 100644 (file)
@@ -39,7 +39,7 @@ final class EmptyDataTreeCandidateNode implements DataTreeCandidateNode {
 
     @Nullable
     @Override
-    public DataTreeCandidateNode getModifiedChild(final PathArgument identifier) {
+    public DataTreeCandidateNode getModifiedChild(final PathArgument childIdentifier) {
         return null;
     }
 
index 546b0e88eceb4f26a2d8169a1cc36b0006fc5c66..68bcdc2dea4e5e78e40381c355b62ec54147b8e3 100644 (file)
@@ -51,10 +51,11 @@ final class NormalizedNodeDataTreeCandidateNode implements DataTreeCandidateNode
     }
 
     @Override
-    public DataTreeCandidateNode getModifiedChild(final PathArgument identifier) {
+    public DataTreeCandidateNode getModifiedChild(final PathArgument childIdentifier) {
         if (data instanceof NormalizedNodeContainer) {
             @SuppressWarnings({ "rawtypes", "unchecked" })
-            final Optional<? extends NormalizedNode<?, ?>> child = ((NormalizedNodeContainer)data).getChild(identifier);
+            final Optional<? extends NormalizedNode<?, ?>> child =
+                ((NormalizedNodeContainer)data).getChild(childIdentifier);
             return child.map(input -> new NormalizedNodeDataTreeCandidateNode(input)).orElse(null);
         }
         return null;
index 1c18036cb7465b37b1351757532119617160568b..857dd727b3aaa465b9beb642d3ee7a46c61d3a0d 100644 (file)
@@ -178,7 +178,8 @@ public class YangInstanceIdentifierTest {
         assertEquals("Path size", 1, newID.getPathArguments().size());
         assertEquals("PathArg 1 node type", NODENAME1, newID.getPathArguments().get(0).getNodeType());
 
-        assertNotNull(newID.toString()); // for code coverage
+        // for code coverage
+        assertNotNull(newID.toString());
     }
 
     @Test
@@ -243,7 +244,8 @@ public class YangInstanceIdentifierTest {
         assertFalse("equals", node1.equals(new NodeIdentifierWithPredicates(NODENAME1, KEY1, "bar")));
         assertFalse("equals", node1.equals(new Object()));
 
-        assertNotNull(node1.toString()); // for code coverage
+        // for code coverage
+        assertNotNull(node1.toString());
         assertNotNull(node1.toRelativeString(node2));
 
         NodeIdentifierWithPredicates node3 = new NodeIdentifierWithPredicates(NODENAME1,
@@ -286,7 +288,8 @@ public class YangInstanceIdentifierTest {
         assertFalse("equals", node1.equals(new NodeWithValue<>(NODENAME2, "foo")));
         assertFalse("equals", node1.equals(new Object()));
 
-        assertNotNull(node1.toString()); // for code coverage
+        // for code coverage
+        assertNotNull(node1.toString());
         assertNotNull(node1.toRelativeString(node2));
 
         NodeWithValue<?> node3 = new NodeWithValue<>(NODENAME1, new byte[]{1,2});
@@ -318,7 +321,8 @@ public class YangInstanceIdentifierTest {
         assertFalse("equals", node1.equals(new NodeIdentifier(NODENAME3)));
         assertFalse("equals", node1.equals(new Object()));
 
-        assertNotNull(node1.toString()); // for code coverage
+        // for code coverage
+        assertNotNull(node1.toString());
     }
 
     @Test(expected = UnsupportedOperationException.class)
@@ -352,7 +356,8 @@ public class YangInstanceIdentifierTest {
         assertEquals("compareTo", 1, node1.compareTo(node4));
         assertEquals("compareTo", -1, node4.compareTo(node1));
 
-        assertNotNull(node1.toString()); // for code coverage
+        // for code coverage
+        assertNotNull(node1.toString());
         assertNotNull(node1.toRelativeString(node5));
     }
 
index ba8dd12a395698faf33c5c403956f9ac4bc5880a..e29fa3a28e7e443c0a1b96e64b57720d610ea25a 100644 (file)
@@ -69,16 +69,16 @@ class LeafRefContextBuilder implements Builder<LeafRefContext> {
         return isReferencedBy;
     }
 
-    public void setReferencedBy(final boolean isReferencedBy) {
-        this.isReferencedBy = isReferencedBy;
+    public void setReferencedBy(final boolean referencedBy) {
+        this.isReferencedBy = referencedBy;
     }
 
     public boolean isReferencing() {
         return isReferencing;
     }
 
-    public void setReferencing(final boolean isReferencing) {
-        this.isReferencing = isReferencing;
+    public void setReferencing(final boolean referencing) {
+        this.isReferencing = referencing;
     }
 
     public void addReferencingChild(final LeafRefContext child, final QName childQName) {
index 00d4b3cc8172756c77ae21928db1a2c726f74cad..5d70ef206e066affcf8ba31b3f79282b9bf69dc0 100644 (file)
@@ -35,9 +35,9 @@ public abstract class LeafRefPath implements Immutable {
         }
 
         @Override
-        protected LeafRefPath createInstance(final LeafRefPath parent,
-                final QNameWithPredicate qname) {
-            return new AbsoluteLeafRefPath(parent, qname);
+        protected LeafRefPath createInstance(final LeafRefPath newParent,
+                final QNameWithPredicate newQname) {
+            return new AbsoluteLeafRefPath(newParent, newQname);
         }
     }
 
@@ -56,9 +56,9 @@ public abstract class LeafRefPath implements Immutable {
         }
 
         @Override
-        protected LeafRefPath createInstance(final LeafRefPath parent,
-                final QNameWithPredicate qname) {
-            return new RelativeLeafRefPath(parent, qname);
+        protected LeafRefPath createInstance(final LeafRefPath newParent,
+                final QNameWithPredicate newQname) {
+            return new RelativeLeafRefPath(newParent, newQname);
         }
     }
 
@@ -92,7 +92,7 @@ public abstract class LeafRefPath implements Immutable {
     private final int hash;
 
     /**
-     * Cached legacy path, filled-in when {@link #getPath()} or
+     * Cached legacy path, filled-in when {@link #getPathFromRoot()} or
      * {@link #getPathTowardsRoot()} is invoked.
      */
     private volatile ImmutableList<QNameWithPredicate> legacyPath;
@@ -157,14 +157,14 @@ public abstract class LeafRefPath implements Immutable {
     /**
      * Create a new instance.
      *
-     * @param parent
+     * @param newParent
      *            Parent LeafRefPath
-     * @param qname
+     * @param newQname
      *            next path element
      * @return A new LeafRefPath instance
      */
-    protected abstract LeafRefPath createInstance(LeafRefPath parent,
-            QNameWithPredicate qname);
+    protected abstract LeafRefPath createInstance(LeafRefPath newParent,
+            QNameWithPredicate newQname);
 
     /**
      * Create a child path based on concatenation of this path and a relative
@@ -179,12 +179,12 @@ public abstract class LeafRefPath implements Immutable {
             return this;
         }
 
-        LeafRefPath parent = this;
-        for (QNameWithPredicate qname : relative) {
-            parent = parent.createInstance(parent, qname);
+        LeafRefPath newParent = this;
+        for (QNameWithPredicate relativeQname : relative) {
+            newParent = newParent.createInstance(newParent, relativeQname);
         }
 
-        return parent;
+        return newParent;
     }
 
     /**
@@ -198,12 +198,12 @@ public abstract class LeafRefPath implements Immutable {
     public LeafRefPath createChild(final LeafRefPath relative) {
         checkArgument(!relative.isAbsolute(), "Child creation requires relative path");
 
-        LeafRefPath parent = this;
-        for (QNameWithPredicate qname : relative.getPathFromRoot()) {
-            parent = parent.createInstance(parent, qname);
+        LeafRefPath newParent = this;
+        for (QNameWithPredicate relativeQname : relative.getPathFromRoot()) {
+            newParent = newParent.createInstance(newParent, relativeQname);
         }
 
-        return parent;
+        return newParent;
     }
 
     /**
@@ -316,8 +316,8 @@ public abstract class LeafRefPath implements Immutable {
 
         sb.append(isAbsolute() ? "Absolute path:" : "Relative path:");
 
-        for (QNameWithPredicate qname : getPathFromRoot()) {
-            sb.append('/').append(qname);
+        for (QNameWithPredicate qnameWithPredicate : getPathFromRoot()) {
+            sb.append('/').append(qnameWithPredicate);
         }
 
         return sb.toString();
index 839ee43c2fa763909c9e36923e0d685f4010cdc4..59476496ccf92d5c7010d00242e1f1549dc2cad7 100644 (file)
@@ -46,11 +46,11 @@ class LeafRefPathErrorListener extends BaseErrorListener {
         }
 
         final StringBuilder sb = new StringBuilder();
-        String module = null;
+        String exceptionModule = null;
         boolean first = true;
         for (final LeafRefPathSyntaxErrorException e : exceptions) {
-            if (module == null) {
-                module = e.getModule();
+            if (exceptionModule == null) {
+                exceptionModule = e.getModule();
             }
             if (first) {
                 first = false;
@@ -61,7 +61,7 @@ class LeafRefPathErrorListener extends BaseErrorListener {
             sb.append(e.getFormattedMessage());
         }
 
-        throw new LeafRefPathSyntaxErrorException(module, 0, 0, sb.toString());
+        throw new LeafRefPathSyntaxErrorException(exceptionModule, 0, 0, sb.toString());
     }
 
 }
index ac72aee1040de4b869164c4ec0f76b4a671815d1..274cdd7e67cac105b69483e9bd1f901aae513a94 100644 (file)
@@ -40,15 +40,15 @@ abstract class AbstractImmutableDataContainerNodeAttrBuilder<I extends PathArgum
     }
 
     @Override
-    public DataContainerNodeAttrBuilder<I, R> withAttributes(final Map<QName, String> attributes) {
-        this.attributes = attributes;
+    public DataContainerNodeAttrBuilder<I, R> withAttributes(final Map<QName, String> withAttributes) {
+        this.attributes = withAttributes;
         return this;
     }
 
     @Override
     public DataContainerNodeAttrBuilder<I, R> withValue(
-            final Collection<DataContainerChild<? extends PathArgument, ?>> value) {
-        return (DataContainerNodeAttrBuilder<I, R>) super.withValue(value);
+            final Collection<DataContainerChild<? extends PathArgument, ?>> withValue) {
+        return (DataContainerNodeAttrBuilder<I, R>) super.withValue(withValue);
     }
 
     @Override
@@ -57,7 +57,7 @@ abstract class AbstractImmutableDataContainerNodeAttrBuilder<I extends PathArgum
     }
 
     @Override
-    public DataContainerNodeAttrBuilder<I, R> withNodeIdentifier(final I nodeIdentifier) {
-        return (DataContainerNodeAttrBuilder<I, R>) super.withNodeIdentifier(nodeIdentifier);
+    public DataContainerNodeAttrBuilder<I, R> withNodeIdentifier(final I withNodeIdentifier) {
+        return (DataContainerNodeAttrBuilder<I, R>) super.withNodeIdentifier(withNodeIdentifier);
     }
 }
index 64dc2e4175e936686a499abfebf6651a4b624601..ebd5d2d073c71640eee347ea32aa711a05969701 100644 (file)
@@ -98,9 +98,9 @@ abstract class AbstractImmutableDataContainerNodeBuilder<I extends PathArgument,
 
     @Override
     public DataContainerNodeBuilder<I, R> withValue(
-            final Collection<DataContainerChild<? extends PathArgument, ?>> value) {
+            final Collection<DataContainerChild<? extends PathArgument, ?>> withValue) {
         // TODO Replace or putAll ?
-        for (final DataContainerChild<? extends PathArgument, ?> dataContainerChild : value) {
+        for (final DataContainerChild<? extends PathArgument, ?> dataContainerChild : withValue) {
             withChild(dataContainerChild);
         }
         return this;
@@ -121,8 +121,8 @@ abstract class AbstractImmutableDataContainerNodeBuilder<I extends PathArgument,
     }
 
     @Override
-    public DataContainerNodeBuilder<I, R> withNodeIdentifier(final I nodeIdentifier) {
-        this.nodeIdentifier = nodeIdentifier;
+    public DataContainerNodeBuilder<I, R> withNodeIdentifier(final I withNodeIdentifier) {
+        this.nodeIdentifier = withNodeIdentifier;
         return this;
     }
 
index 0f817a52f2f38f3796ae135c99591c8eb54faf3d..b686b982038ac21f2faffb16c83c5b067c4fbd57 100644 (file)
@@ -39,20 +39,20 @@ abstract class AbstractImmutableNormalizedNodeBuilder<I extends PathArgument, V,
     }
 
     @Override
-    public NormalizedNodeAttrBuilder<I, V, R> withValue(final V value) {
-        this.value = requireNonNull(value);
+    public NormalizedNodeAttrBuilder<I, V, R> withValue(final V withValue) {
+        this.value = requireNonNull(withValue);
         return this;
     }
 
     @Override
-    public NormalizedNodeAttrBuilder<I, V, R> withNodeIdentifier(final I nodeIdentifier) {
-        this.nodeIdentifier = requireNonNull(nodeIdentifier);
+    public NormalizedNodeAttrBuilder<I, V, R> withNodeIdentifier(final I withNodeIdentifier) {
+        this.nodeIdentifier = requireNonNull(withNodeIdentifier);
         return this;
     }
 
     @Override
-    public NormalizedNodeAttrBuilder<I, V, R> withAttributes(final Map<QName, String> attributes) {
-        this.attributes = requireNonNull(attributes);
+    public NormalizedNodeAttrBuilder<I, V, R> withAttributes(final Map<QName, String> withAttributes) {
+        this.attributes = requireNonNull(withAttributes);
         return this;
     }
 }
index d18a00b945c6a202f5a377fdbe25bbcd74f74406..19b3179e1992ca30d77e63f885fc599014f76a77 100644 (file)
@@ -25,13 +25,13 @@ public final class ImmutableAnyXmlNodeSchemaAwareBuilder extends ImmutableAnyXml
     }
 
     @Override
-    public NormalizedNodeAttrBuilder<NodeIdentifier, DOMSource, AnyXmlNode> withValue(final DOMSource value) {
-        return super.withValue(value);
+    public NormalizedNodeAttrBuilder<NodeIdentifier, DOMSource, AnyXmlNode> withValue(final DOMSource withValue) {
+        return super.withValue(withValue);
     }
 
     @Override
     public NormalizedNodeAttrBuilder<NodeIdentifier, DOMSource, AnyXmlNode> withNodeIdentifier(
-            final NodeIdentifier nodeIdentifier) {
+            final NodeIdentifier withNodeIdentifier) {
         throw new UnsupportedOperationException("Node identifier created from schema");
     }
 }
index 0b76b8298ca368d28a0f3ca115e4eb356990d5eb..b717078b26c744e3590643e69833e5d2fd263b50 100644 (file)
@@ -26,7 +26,7 @@ public class ImmutableAugmentationNodeSchemaAwareBuilder extends ImmutableAugmen
 
     @Override
     public DataContainerNodeBuilder<AugmentationIdentifier, AugmentationNode> withNodeIdentifier(
-            final AugmentationIdentifier nodeIdentifier) {
+            final AugmentationIdentifier withNodeIdentifier) {
         throw new UnsupportedOperationException("Node identifier created from schema");
     }
 
index 6e2e586dfc0cd8826496d5961ca3ba3358e2396d..4ae76f7266a837e4c76a7b0b33a0a874f2974916 100644 (file)
@@ -32,7 +32,7 @@ public class ImmutableChoiceNodeSchemaAwareBuilder extends ImmutableChoiceNodeBu
 
     @Override
     public DataContainerNodeBuilder<NodeIdentifier, ChoiceNode> withNodeIdentifier(
-            final NodeIdentifier nodeIdentifier) {
+            final NodeIdentifier withNodeIdentifier) {
         throw new UnsupportedOperationException("Node identifier created from schema");
     }
 
index 9143a36c4f3db2ea8f1d392ddcb0686b00b6b2ee..3a1072cd9965affca97d73b196d3ab7d3b8cddf2 100644 (file)
@@ -44,7 +44,7 @@ public final class ImmutableContainerNodeSchemaAwareBuilder extends ImmutableCon
 
     @Override
     public DataContainerNodeAttrBuilder<NodeIdentifier, ContainerNode> withNodeIdentifier(
-            final NodeIdentifier nodeIdentifier) {
+            final NodeIdentifier withNodeIdentifier) {
         throw new UnsupportedOperationException("Node identifier created from schema");
     }
 
index 258d408bfaaf6e7e8d0f4af7a90223791457aaac..06cbc1e356cd832901124ad0545745b302390e43 100644 (file)
@@ -47,8 +47,8 @@ public class ImmutableLeafNodeBuilder<T>
         }
 
         @Override
-        protected byte[] wrapValue(final byte[] value) {
-            return value.clone();
+        protected byte[] wrapValue(final byte[] valueToWrap) {
+            return valueToWrap.clone();
         }
     }
 }
index fdc174099a756979306cae2e06681a2d84171882..c31fe77ac82083d12c53d1b1f88caa241e641274 100644 (file)
@@ -23,14 +23,14 @@ public final class ImmutableLeafNodeSchemaAwareBuilder<T> extends ImmutableLeafN
     }
 
     @Override
-    public NormalizedNodeAttrBuilder<NodeIdentifier, T, LeafNode<T>> withValue(final T value) {
+    public NormalizedNodeAttrBuilder<NodeIdentifier, T, LeafNode<T>> withValue(final T withValue) {
         // TODO: check value type
-        return super.withValue(value);
+        return super.withValue(withValue);
     }
 
     @Override
     public NormalizedNodeAttrBuilder<NodeIdentifier, T, LeafNode<T>> withNodeIdentifier(
-            final NodeIdentifier nodeIdentifier) {
+            final NodeIdentifier withNodeIdentifier) {
         throw new UnsupportedOperationException("Node identifier created from schema");
     }
 }
index 0dc17e921a8874595764854f3c56a7e50580316c..62baf847d485926470ebd174a7d7f6f42cf46d87 100644 (file)
@@ -28,15 +28,15 @@ public final class ImmutableLeafSetEntryNodeSchemaAwareBuilder<T> extends Immuta
     }
 
     @Override
-    public NormalizedNodeAttrBuilder<NodeWithValue, T, LeafSetEntryNode<T>> withValue(final T value) {
-        super.withNodeIdentifier(new NodeWithValue<>(schema.getQName(), value));
+    public NormalizedNodeAttrBuilder<NodeWithValue, T, LeafSetEntryNode<T>> withValue(final T withValue) {
+        super.withNodeIdentifier(new NodeWithValue<>(schema.getQName(), withValue));
         // TODO check value type using TypeProvider ?
-        return super.withValue(value);
+        return super.withValue(withValue);
     }
 
     @Override
     public NormalizedNodeAttrBuilder<NodeWithValue, T, LeafSetEntryNode<T>> withNodeIdentifier(
-            final NodeWithValue nodeIdentifier) {
+            final NodeWithValue withNodeIdentifier) {
         throw new UnsupportedOperationException("Node identifier created from schema");
     }
 
index 3f2609baaaccc9ad1c70db58fb72aee8e1a7f127..40b3d80c85bb4ca66622201bb063b99dccc8adfa 100644 (file)
@@ -84,14 +84,14 @@ public class ImmutableLeafSetNodeBuilder<T> implements ListNodeBuilder<T, LeafSe
     }
 
     @Override
-    public ListNodeBuilder<T, LeafSetEntryNode<T>> withNodeIdentifier(final NodeIdentifier nodeIdentifier) {
-        this.nodeIdentifier = nodeIdentifier;
+    public ListNodeBuilder<T, LeafSetEntryNode<T>> withNodeIdentifier(final NodeIdentifier withNodeIdentifier) {
+        this.nodeIdentifier = withNodeIdentifier;
         return this;
     }
 
     @Override
-    public ListNodeBuilder<T, LeafSetEntryNode<T>> withValue(final Collection<LeafSetEntryNode<T>> value) {
-        for (final LeafSetEntryNode<T> leafSetEntry : value) {
+    public ListNodeBuilder<T, LeafSetEntryNode<T>> withValue(final Collection<LeafSetEntryNode<T>> withValue) {
+        for (final LeafSetEntryNode<T> leafSetEntry : withValue) {
             withChild(leafSetEntry);
         }
         return this;
@@ -99,17 +99,18 @@ public class ImmutableLeafSetNodeBuilder<T> implements ListNodeBuilder<T, LeafSe
 
 
     @Override
-    public ListNodeBuilder<T, LeafSetEntryNode<T>> withChildValue(final T value, final Map<QName, String> attributes) {
+    public ListNodeBuilder<T, LeafSetEntryNode<T>> withChildValue(final T childValue,
+            final Map<QName, String> attributes) {
         final ImmutableLeafSetEntryNodeBuilder<T> b = ImmutableLeafSetEntryNodeBuilder.create();
-        b.withNodeIdentifier(new NodeWithValue<>(nodeIdentifier.getNodeType(), value));
-        b.withValue(value);
+        b.withNodeIdentifier(new NodeWithValue<>(nodeIdentifier.getNodeType(), childValue));
+        b.withValue(childValue);
         b.withAttributes(attributes);
         return withChild(b.build());
     }
 
     @Override
-    public ListNodeBuilder<T, LeafSetEntryNode<T>> withChildValue(final T value) {
-        return withChildValue(value, Collections.emptyMap());
+    public ListNodeBuilder<T, LeafSetEntryNode<T>> withChildValue(final T childValue) {
+        return withChildValue(childValue, Collections.emptyMap());
     }
 
     protected static final class ImmutableLeafSetNode<T> extends
index f557369a41fa839485065bcff9de19c897e35bc3..001884b4893b58da118cfc8ddac13f703de0d79c 100644 (file)
@@ -48,9 +48,9 @@ public final class ImmutableLeafSetNodeSchemaAwareBuilder<T> extends ImmutableLe
     }
 
     @Override
-    public ListNodeBuilder<T, LeafSetEntryNode<T>> withChildValue(final T value) {
+    public ListNodeBuilder<T, LeafSetEntryNode<T>> withChildValue(final T childValue) {
         // TODO check value type
-        return super.withChildValue(value);
+        return super.withChildValue(childValue);
     }
 
     @Override
@@ -64,7 +64,7 @@ public final class ImmutableLeafSetNodeSchemaAwareBuilder<T> extends ImmutableLe
     }
 
     @Override
-    public ListNodeBuilder<T, LeafSetEntryNode<T>> withNodeIdentifier(final NodeIdentifier nodeIdentifier) {
+    public ListNodeBuilder<T, LeafSetEntryNode<T>> withNodeIdentifier(final NodeIdentifier withNodeIdentifier) {
         throw new UnsupportedOperationException("Node identifier created from schema");
     }
 }
index 59af23fa5fdfbc57d42eb0142a83ce763583598f..4d1126238aed15eac0d4bf449d9518335e10494d 100644 (file)
@@ -79,9 +79,9 @@ public class ImmutableMapEntryNodeBuilder
 
     @Override
     public DataContainerNodeAttrBuilder<NodeIdentifierWithPredicates, MapEntryNode> withValue(
-            final Collection<DataContainerChild<? extends PathArgument, ?>> value) {
-        fillQnames(value, childrenQNamesToPaths);
-        return super.withValue(value);
+            final Collection<DataContainerChild<? extends PathArgument, ?>> withValue) {
+        fillQnames(withValue, childrenQNamesToPaths);
+        return super.withValue(withValue);
     }
 
     private static boolean isAugment(final PathArgument identifier) {
index 36ee87875cce637c9678e5398dde5edab972116e..f5165cea603be46c5f30e662ec61b6a84d47f1d2 100644 (file)
@@ -31,7 +31,7 @@ public final class ImmutableMapEntryNodeSchemaAwareBuilder extends ImmutableMapE
     }
 
     @Override
-    public ImmutableMapEntryNodeBuilder withNodeIdentifier(final NodeIdentifierWithPredicates nodeIdentifier) {
+    public ImmutableMapEntryNodeBuilder withNodeIdentifier(final NodeIdentifierWithPredicates withNodeIdentifier) {
         throw new UnsupportedOperationException("Node identifier created from schema");
     }
 
index d55c97ffae471c1e3f1aab3a37978f5fa65abd18..2dfa40e6e78fdf62e1f4738aa47dee4780de7dca 100644 (file)
@@ -76,9 +76,9 @@ public class ImmutableMapNodeBuilder implements CollectionNodeBuilder<MapEntryNo
     }
 
     @Override
-    public CollectionNodeBuilder<MapEntryNode, MapNode> withValue(final Collection<MapEntryNode> value) {
+    public CollectionNodeBuilder<MapEntryNode, MapNode> withValue(final Collection<MapEntryNode> withValue) {
         // TODO replace or putAll ?
-        for (final MapEntryNode mapEntryNode : value) {
+        for (final MapEntryNode mapEntryNode : withValue) {
             withChild(mapEntryNode);
         }
 
@@ -86,8 +86,8 @@ public class ImmutableMapNodeBuilder implements CollectionNodeBuilder<MapEntryNo
     }
 
     @Override
-    public CollectionNodeBuilder<MapEntryNode, MapNode> withNodeIdentifier(final NodeIdentifier nodeIdentifier) {
-        this.nodeIdentifier = nodeIdentifier;
+    public CollectionNodeBuilder<MapEntryNode, MapNode> withNodeIdentifier(final NodeIdentifier withNodeIdentifier) {
+        this.nodeIdentifier = withNodeIdentifier;
         return this;
     }
 
index f4af8a7fdcf0d64017f741a4ff4d4505085663d6..a5adfba9d933beb9840cf06e178e25a51ff6e400 100644 (file)
@@ -51,7 +51,7 @@ public class ImmutableMapNodeSchemaAwareBuilder extends ImmutableMapNodeBuilder
     }
 
     @Override
-    public CollectionNodeBuilder<MapEntryNode, MapNode> withNodeIdentifier(final NodeIdentifier nodeIdentifier) {
+    public CollectionNodeBuilder<MapEntryNode, MapNode> withNodeIdentifier(final NodeIdentifier withNodeIdentifier) {
         throw new UnsupportedOperationException("Node identifier created from schema");
     }
 }
index 77b328af376e9d6113c4fcf75f6787dcdf612d1e..345e2e824748c9c0bb803271546081bdd75f49ea 100644 (file)
@@ -83,32 +83,33 @@ public class ImmutableOrderedLeafSetNodeBuilder<T> implements ListNodeBuilder<T,
     }
 
     @Override
-    public ListNodeBuilder<T, LeafSetEntryNode<T>> withNodeIdentifier(final NodeIdentifier nodeIdentifier) {
-        this.nodeIdentifier = nodeIdentifier;
+    public ListNodeBuilder<T, LeafSetEntryNode<T>> withNodeIdentifier(final NodeIdentifier withNodeIdentifier) {
+        this.nodeIdentifier = withNodeIdentifier;
         return this;
     }
 
     @Override
-    public ListNodeBuilder<T, LeafSetEntryNode<T>> withValue(final Collection<LeafSetEntryNode<T>> value) {
+    public ListNodeBuilder<T, LeafSetEntryNode<T>> withValue(final Collection<LeafSetEntryNode<T>> withValue) {
         checkDirty();
-        for (final LeafSetEntryNode<T> leafSetEntry : value) {
+        for (final LeafSetEntryNode<T> leafSetEntry : withValue) {
             withChild(leafSetEntry);
         }
         return this;
     }
 
     @Override
-    public ListNodeBuilder<T, LeafSetEntryNode<T>> withChildValue(final T value, final Map<QName, String> attributes) {
+    public ListNodeBuilder<T, LeafSetEntryNode<T>> withChildValue(final T childValue,
+            final Map<QName, String> attributes) {
         final ImmutableLeafSetEntryNodeBuilder<T> b = ImmutableLeafSetEntryNodeBuilder.create();
-        b.withNodeIdentifier(new NodeWithValue<>(nodeIdentifier.getNodeType(), value));
-        b.withValue(value);
+        b.withNodeIdentifier(new NodeWithValue<>(nodeIdentifier.getNodeType(), childValue));
+        b.withValue(childValue);
         b.withAttributes(attributes);
         return withChild(b.build());
     }
 
     @Override
-    public ListNodeBuilder<T, LeafSetEntryNode<T>> withChildValue(final T value) {
-        return withChildValue(value, Collections.emptyMap());
+    public ListNodeBuilder<T, LeafSetEntryNode<T>> withChildValue(final T childValue) {
+        return withChildValue(childValue, Collections.emptyMap());
     }
 
     protected static final class ImmutableOrderedLeafSetNode<T> extends
index 562beecc50583f7f8c14d399285c3d4ba7867f6e..48b9d8fa191502bebce902902b2a0793eeb1619d 100644 (file)
@@ -49,9 +49,9 @@ public final class ImmutableOrderedLeafSetNodeSchemaAwareBuilder<T> extends Immu
     }
 
     @Override
-    public ListNodeBuilder<T, LeafSetEntryNode<T>> withChildValue(final T value) {
+    public ListNodeBuilder<T, LeafSetEntryNode<T>> withChildValue(final T childValue) {
         // TODO check value type
-        return super.withChildValue(value);
+        return super.withChildValue(childValue);
     }
 
     @Override
@@ -65,7 +65,7 @@ public final class ImmutableOrderedLeafSetNodeSchemaAwareBuilder<T> extends Immu
     }
 
     @Override
-    public ListNodeBuilder<T, LeafSetEntryNode<T>> withNodeIdentifier(final NodeIdentifier nodeIdentifier) {
+    public ListNodeBuilder<T, LeafSetEntryNode<T>> withNodeIdentifier(final NodeIdentifier withNodeIdentifier) {
         throw new UnsupportedOperationException("Node identifier created from schema");
     }
 }
index 5f6232e3ace2d572c7860ab67ca7fafb2a2cd9cb..22c8cc945c0ee747cf7d616bf61aba9882f54cf0 100644 (file)
@@ -89,9 +89,9 @@ public class ImmutableOrderedMapNodeBuilder implements CollectionNodeBuilder<Map
     }
 
     @Override
-    public CollectionNodeBuilder<MapEntryNode, OrderedMapNode> withValue(final Collection<MapEntryNode> value) {
+    public CollectionNodeBuilder<MapEntryNode, OrderedMapNode> withValue(final Collection<MapEntryNode> withValue) {
         // TODO replace or putAll ?
-        for (final MapEntryNode mapEntryNode : value) {
+        for (final MapEntryNode mapEntryNode : withValue) {
             withChild(mapEntryNode);
         }
 
@@ -99,8 +99,9 @@ public class ImmutableOrderedMapNodeBuilder implements CollectionNodeBuilder<Map
     }
 
     @Override
-    public CollectionNodeBuilder<MapEntryNode, OrderedMapNode> withNodeIdentifier(final NodeIdentifier nodeIdentifier) {
-        this.nodeIdentifier = nodeIdentifier;
+    public CollectionNodeBuilder<MapEntryNode, OrderedMapNode> withNodeIdentifier(
+            final NodeIdentifier withNodeIdentifier) {
+        this.nodeIdentifier = withNodeIdentifier;
         return this;
     }
 
index 54ae5e5e99583f99bc13b4e2cd8103a7c29c9713..80ca2b7c57cd1f60529dcce214c4a97c1aad1313 100644 (file)
@@ -54,7 +54,8 @@ public class ImmutableOrderedMapNodeSchemaAwareBuilder extends ImmutableOrderedM
     }
 
     @Override
-    public CollectionNodeBuilder<MapEntryNode, OrderedMapNode> withNodeIdentifier(final NodeIdentifier nodeIdentifier) {
+    public CollectionNodeBuilder<MapEntryNode, OrderedMapNode> withNodeIdentifier(
+            final NodeIdentifier withNodeIdentifier) {
         throw new UnsupportedOperationException("Node identifier created from schema");
     }
 }
index e0b4af5720cbb633b4e3bf6fe363297032c0ebeb..7d6437d376c8d049f2f17e18e891e0e221c9752d 100644 (file)
@@ -80,9 +80,9 @@ public class ImmutableUnkeyedListNodeBuilder implements CollectionNodeBuilder<Un
 
     @Override
     public CollectionNodeBuilder<UnkeyedListEntryNode, UnkeyedListNode> withValue(
-            final Collection<UnkeyedListEntryNode> value) {
+            final Collection<UnkeyedListEntryNode> withValue) {
         // TODO replace or putAll ?
-        for (final UnkeyedListEntryNode node : value) {
+        for (final UnkeyedListEntryNode node : withValue) {
             withChild(node);
         }
 
@@ -91,8 +91,8 @@ public class ImmutableUnkeyedListNodeBuilder implements CollectionNodeBuilder<Un
 
     @Override
     public CollectionNodeBuilder<UnkeyedListEntryNode, UnkeyedListNode> withNodeIdentifier(
-            final NodeIdentifier nodeIdentifier) {
-        this.nodeIdentifier = nodeIdentifier;
+            final NodeIdentifier withNodeIdentifier) {
+        this.nodeIdentifier = withNodeIdentifier;
         return this;
     }
 
index 31f8bab90dcd668012ee1a980e0c114397491ac8..2e6b6b1991378e35001fd286e038188b5d168087 100644 (file)
@@ -33,7 +33,7 @@ public abstract class AbstractImmutableNormalizedValueNode<K extends PathArgumen
         return value;
     }
 
-    protected V wrapValue(final V value) {
-        return value;
+    protected V wrapValue(final V valueToWrap) {
+        return valueToWrap;
     }
 }
index 42c37ca3a9c0ea86fccf9636f81d815ed696ff58..3bba4fc86bb390f5088e3dad2d5d85290d9b4ee4 100644 (file)
@@ -19,17 +19,17 @@ abstract class AbstractCursorAware {
             AtomicReferenceFieldUpdater.newUpdater(AbstractCursorAware.class, AbstractCursor.class, "cursor");
     private volatile AbstractCursor<?> cursor = null;
 
-    protected <T extends AbstractCursor<?>> T openCursor(final T cursor) {
-        final boolean success = CURSOR_UPDATER.compareAndSet(this, null, cursor);
+    protected <T extends AbstractCursor<?>> T openCursor(final T cursorToOpen) {
+        final boolean success = CURSOR_UPDATER.compareAndSet(this, null, cursorToOpen);
         Preconditions.checkState(success, "Modification %s has cursor attached at path %s", this,
             this.cursor.getRootPath());
-        return cursor;
+        return cursorToOpen;
     }
 
-    final void closeCursor(final AbstractCursor<?> cursor) {
-        final boolean success = CURSOR_UPDATER.compareAndSet(this, cursor, null);
+    final void closeCursor(final AbstractCursor<?> cursorToClose) {
+        final boolean success = CURSOR_UPDATER.compareAndSet(this, cursorToClose, null);
         if (!success) {
-            LOG.warn("Attempted to close cursor {} while {} is open", cursor, this.cursor);
+            LOG.warn("Attempted to close cursor {} while {} is open", cursorToClose, this.cursor);
         }
     }
 }
index 5456380cc51609730143f0496b65824a9b8ee122..9e163f538aaa2cd2325ec9cd5325dca2a4cce09f 100644 (file)
@@ -249,10 +249,10 @@ final class ModifiedNode extends NodeModification implements StoreTreeNode<Modif
     /**
      * Records a write for associated node.
      *
-     * @param value new value
+     * @param newValue new value
      */
-    void write(final NormalizedNode<?, ?> value) {
-        updateValue(LogicalOperation.WRITE, value);
+    void write(final NormalizedNode<?, ?> newValue) {
+        updateValue(LogicalOperation.WRITE, newValue);
         children.clear();
     }
 
@@ -323,10 +323,10 @@ final class ModifiedNode extends NodeModification implements StoreTreeNode<Modif
      * Update this node's value and operation type without disturbing any of its child modifications.
      *
      * @param type New operation type
-     * @param value New node value
+     * @param newValue New node value
      */
-    void updateValue(final LogicalOperation type, final NormalizedNode<?, ?> value) {
-        this.value = requireNonNull(value);
+    void updateValue(final LogicalOperation type, final NormalizedNode<?, ?> newValue) {
+        this.value = requireNonNull(newValue);
         updateOperationType(type);
     }
 
index 35ce67f88f28fda90deb86e05544bb0863a5c787..32ff88de6fe08c1dd63f85b1fd6dfe3fe8a0a61a 100644 (file)
@@ -219,8 +219,7 @@ public class LeafRefContextTreeBuilderTest {
     @Test(expected = IllegalArgumentException.class)
     @Ignore
     public void incorrectLeafRefPathTest() {
-        final SchemaContext context = YangParserTestUtils.parseYangResourceDirectory(
-            "/leafref-context-test/incorrect-modules");
-        LeafRefContext.create(context);
+        LeafRefContext.create(
+                YangParserTestUtils.parseYangResourceDirectory("/leafref-context-test/incorrect-modules"));
     }
 }
index bc3c4b0beec45ade7c0665363b80ba6bc83aa7c5..b8a4ad363d97fef344d6abe5ce8b6bf55595e2ff 100644 (file)
@@ -343,11 +343,11 @@ public class Bug4454Test {
 
     @Test
     public void minMaxListNoMinMaxDeleteTest() throws DataValidationFailedException {
-        final MapEntryNode fooEntryNode = ImmutableNodes.mapEntry(MIN_MAX_LIST_QNAME_NO_MINMAX, MIN_MAX_KEY_LEAF_QNAME,
-            "foo");
+        final MapEntryNode fooEntryNoMinMaxNode =
+                ImmutableNodes.mapEntry(MIN_MAX_LIST_QNAME_NO_MINMAX, MIN_MAX_KEY_LEAF_QNAME, "foo");
         final MapNode mapNode1 = ImmutableNodes.mapNodeBuilder()
                 .withNodeIdentifier(new NodeIdentifier(MIN_MAX_LIST_QNAME_NO_MINMAX))
-                .withChild(fooEntryNode).build();
+                .withChild(fooEntryNoMinMaxNode).build();
 
         final DataTreeModification modificationTree = inMemoryDataTree.takeSnapshot().newModification();
 
index e8a4fa68a9a556f771918ab91771ded142254756..5a7a7d42ae8e4eba9e339d019fef6d139883198b 100644 (file)
@@ -144,21 +144,21 @@ final class LeafrefXPathStringParsingPathArgumentBuilder implements Builder<List
         checkValid(!pathComponents.isEmpty(), "Malformed path key expression: '%s'.", pathKeyExpression);
 
         boolean inNodeIdentifierPart = false;
-        NormalizedNodeContext currentNodeCtx = this.currentNodeCtx;
-        NormalizedNode<?, ?> currentNode = null;
+        NormalizedNodeContext nodeCtx = this.currentNodeCtx;
+        NormalizedNode<?, ?> node = null;
         for (String pathComponent : pathComponents) {
             final Matcher matcher = NODE_IDENTIFIER_PATTERN.matcher(pathComponent);
             if (UP_ONE_LEVEL.equals(pathComponent)) {
                 checkValid(!inNodeIdentifierPart, "Up-one-level expression cannot follow concrete path component.");
-                currentNodeCtx = currentNodeCtx.getParent();
-                currentNode = currentNodeCtx.getNode();
+                nodeCtx = nodeCtx.getParent();
+                node = nodeCtx.getNode();
                 offset += UP_ONE_LEVEL.length() + 1;
             } else if (matcher.matches()) {
                 inNodeIdentifierPart = true;
-                if (currentNode != null && currentNode instanceof DataContainerNode) {
-                    final DataContainerNode dcn = (DataContainerNode) currentNode;
+                if (node != null && node instanceof DataContainerNode) {
+                    final DataContainerNode dcn = (DataContainerNode) node;
                     final Optional<NormalizedNode<?, ?>> possibleChild = dcn.getChild(new NodeIdentifier(nextQName()));
-                    currentNode = possibleChild.isPresent() ? possibleChild.get() : null;
+                    node = possibleChild.isPresent() ? possibleChild.get() : null;
                 }
             } else {
                 throw new IllegalArgumentException(String.format(
@@ -167,8 +167,8 @@ final class LeafrefXPathStringParsingPathArgumentBuilder implements Builder<List
             }
         }
 
-        if (currentNode != null && currentNode instanceof LeafNode) {
-            return currentNode.getValue();
+        if (node != null && node instanceof LeafNode) {
+            return node.getValue();
         }
 
         throw new IllegalArgumentException("Could not resolve current function path value.");
index e86c5e2025193cea3618e342872b6c242b165202..9aa31ded9faf3d63066f234219ef74ee5cbaea8c 100644 (file)
@@ -104,8 +104,8 @@ public class GenerateSourcesTest {
         }
 
         @Override
-        public void setMavenProject(final MavenProject project) {
-            GeneratorMock.project = project;
+        public void setMavenProject(final MavenProject mavenProject) {
+            GeneratorMock.project = mavenProject;
         }
 
         @Override
index fb335dbd3f18575ddb9e3baf7aef512f2bffd0f6..1999ae3a0a3a06ef8f2449fe452c970c2d7ee5cd 100644 (file)
@@ -44,8 +44,8 @@ public abstract class SchemaPath implements Immutable {
         }
 
         @Override
-        public AbsoluteSchemaPath createChild(final QName qname) {
-            return new AbsoluteSchemaPath(this, requireNonNull(qname));
+        public AbsoluteSchemaPath createChild(final QName element) {
+            return new AbsoluteSchemaPath(this, requireNonNull(element));
         }
     }
 
@@ -63,8 +63,8 @@ public abstract class SchemaPath implements Immutable {
         }
 
         @Override
-        public RelativeSchemaPath createChild(final QName qname) {
-            return new RelativeSchemaPath(this, requireNonNull(qname));
+        public RelativeSchemaPath createChild(final QName element) {
+            return new RelativeSchemaPath(this, requireNonNull(element));
         }
     }
 
@@ -119,8 +119,8 @@ public abstract class SchemaPath implements Immutable {
         ImmutableList<QName> ret = legacyPath;
         if (ret == null) {
             final List<QName> tmp = new ArrayList<>();
-            for (QName qname : getPathTowardsRoot()) {
-                tmp.add(qname);
+            for (QName item : getPathTowardsRoot()) {
+                tmp.add(item);
             }
             ret = ImmutableList.copyOf(Lists.reverse(tmp));
             LEGACYPATH_UPDATER.lazySet(this, ret);
@@ -187,8 +187,8 @@ public abstract class SchemaPath implements Immutable {
         }
 
         SchemaPath parentPath = this;
-        for (QName qname : relative) {
-            parentPath = parentPath.createChild(qname);
+        for (QName item : relative) {
+            parentPath = parentPath.createChild(item);
         }
 
         return parentPath;
index 764fbee19cfe2bda9939e750529cb39b10f3ff0a..86be319fede9d6a50c7c8d3b8d45490d63faa24c 100644 (file)
@@ -174,8 +174,8 @@ public abstract class SchemaNodeIdentifier implements Immutable {
         }
 
         SchemaNodeIdentifier parentNode = this;
-        for (QName qname : relative) {
-            parentNode = parentNode.createChild(qname);
+        for (QName item : relative) {
+            parentNode = parentNode.createChild(item);
         }
 
         return parentNode;
index bb7da5593c8997fcae63b6f1cc7856a5e5643312..5053c1cf85438b1fb5c66d447ebdd71671fcf690 100644 (file)
@@ -35,7 +35,7 @@ public class SchemaSourceTransformer<S extends SchemaSourceRepresentation, D ext
         ListenableFuture<D> apply(@Nonnull S input) throws Exception;
     }
 
-    private final Map<PotentialSchemaSource<?>, RefcountedRegistration> sources = new HashMap<>();
+    private final Map<PotentialSchemaSource<?>, RefcountedRegistration> availableSources = new HashMap<>();
     private final SchemaSourceRegistry consumer;
     private final SchemaRepository provider;
     private final AsyncFunction<S, D> function;
@@ -81,7 +81,7 @@ public class SchemaSourceTransformer<S extends SchemaSourceRepresentation, D ext
     }
 
     private void registerSource(final PotentialSchemaSource<?> src) {
-        RefcountedRegistration reg = sources.get(src);
+        RefcountedRegistration reg = availableSources.get(src);
         if (reg != null) {
             reg.incRef();
             return;
@@ -91,13 +91,13 @@ public class SchemaSourceTransformer<S extends SchemaSourceRepresentation, D ext
                 src.getCost() + PotentialSchemaSource.Costs.COMPUTATION.getValue());
 
         final SchemaSourceRegistration<D> r = consumer.registerSchemaSource(this, newSrc);
-        sources.put(src, new RefcountedRegistration(r));
+        availableSources.put(src, new RefcountedRegistration(r));
     }
 
     private void unregisterSource(final PotentialSchemaSource<?> src) {
-        final RefcountedRegistration reg = sources.get(src);
+        final RefcountedRegistration reg = availableSources.get(src);
         if (reg != null && reg.decRef()) {
-            sources.remove(src);
+            availableSources.remove(src);
         }
     }
 }
index 29fe0a98efc842668b494e5ebd562e2df9a0521d..92de910457a59b9939932fa07f7e122e80de2121 100644 (file)
@@ -75,7 +75,7 @@ public abstract class LengthRestrictedTypeBuilder<T extends LengthRestrictedType
         touch();
     }
 
-    abstract T buildType(LengthConstraint lengthConstraint);
+    abstract T buildType(LengthConstraint constraint);
 
     @Override
     final T buildType() {
index b1565f6e417860d11caf8a45726e67a6728ae4c3..47541a4759d40e63f677c3d39bba01f938009c6a 100644 (file)
@@ -37,6 +37,7 @@ public abstract class RangeRestrictedTypeBuilder<T extends RangeRestrictedTypeDe
         super(baseType, path);
     }
 
+    @SuppressWarnings("checkstyle:hiddenField")
     public final void setRangeConstraint(final @NonNull ConstraintMetaDefinition constraint,
             final @NonNull List<ValueRange> ranges) {
         checkState(this.ranges == null, "Range constraint already defined as %s %s", this.ranges, this.constraint);
index 439231b8eb07160ae7bf353bafbe7c10487b037e..456d9fa3627bc8ab612e5ff7da9a66d16b109c28 100644 (file)
@@ -78,8 +78,8 @@ public final class RestrictedTypes {
             @Nonnull final BinaryTypeDefinition baseType, @Nonnull final SchemaPath path) {
         return new LengthRestrictedTypeBuilder<BinaryTypeDefinition>(baseType, path) {
             @Override
-            BinaryTypeDefinition buildType(final @Nullable LengthConstraint lengthConstraint) {
-                return new RestrictedBinaryType(getBaseType(), getPath(), getUnknownSchemaNodes(), lengthConstraint);
+            BinaryTypeDefinition buildType(final @Nullable LengthConstraint constraint) {
+                return new RestrictedBinaryType(getBaseType(), getPath(), getUnknownSchemaNodes(), constraint);
             }
 
             @Override
index fc4b7b7d6031d48d79b471db0cd9b61da4473dd7..deafa424e7ef7ba12cd5c46c98b43f4b072f60cf 100644 (file)
@@ -44,8 +44,8 @@ public final class StringTypeBuilder extends LengthRestrictedTypeBuilder<StringT
     }
 
     @Override
-    StringTypeDefinition buildType(final @Nullable LengthConstraint lengthConstraints) {
-        return new RestrictedStringType(getBaseType(), getPath(), getUnknownSchemaNodes(),
-            lengthConstraints, patternConstraints);
+    StringTypeDefinition buildType(final @Nullable LengthConstraint constraint) {
+        return new RestrictedStringType(getBaseType(), getPath(), getUnknownSchemaNodes(), constraint,
+            patternConstraints);
     }
 }
index 440067d4795043b78994790543cc0c8b2f4acc7e..c404c0a437c9a8a5aa2f947034d904282e6b492e 100644 (file)
@@ -57,7 +57,7 @@ public class SchemaSourceTransformerTest {
     }
 
     @Test
-    public void schemaSourceTransformerGetSourceTest() throws Exception {
+    public void schemaSourceTransformerGetSourceTest() {
         final Provider p = new Provider();
         final Registrator reg = new Registrator(p, SchemaSourceTransformerTest.SRC_CLASS,
                 PotentialSchemaSource.Costs.IMMEDIATE);
@@ -66,15 +66,15 @@ public class SchemaSourceTransformerTest {
         this.schema = new SchemaSourceTransformer<>(p,
                 SchemaSourceTransformerTest.SRC_CLASS, this.consumer, SchemaSourceTransformerTest.DST_CLASS,
                 this.function);
-        final SchemaSourceProvider<YinXmlSchemaSource> provider = this.schema;
-        final Future<? extends YinXmlSchemaSource> source = provider.getSource(sourceIdentifier);
+        final SchemaSourceProvider<YinXmlSchemaSource> prov = this.schema;
+        final Future<? extends YinXmlSchemaSource> source = prov.getSource(sourceIdentifier);
         Assert.assertNotNull(source);
         source.cancel(true);
         Assert.assertTrue(source.isDone());
     }
 
     @Test
-    public void schemaSourceRegAndUnregSchemaSourceTest() throws Exception {
+    public void schemaSourceRegAndUnregSchemaSourceTest() {
         final SourceIdentifier sourceIdentifier = RevisionSourceIdentifier.create("source");
         final Foo<YangSchemaSourceRepresentation> foo = new Foo<>(sourceIdentifier,
                 SchemaSourceTransformerTest.SRC_CLASS,
index 65321570fde1e1e0c001f74fc65915bf275649db..4f322defeef8a7994d23fd6bc7446a9443c047ae 100644 (file)
@@ -115,15 +115,15 @@ public class DataNodeIteratorTest {
 
         doReturn(groupings).when(mockedModule).getGroupings();
 
-        final DataNodeIterator dataNodeIterator = new DataNodeIterator(mockedModule);
-        assertFalse(dataNodeIterator.allContainers().contains(mockedAugmentingContainer));
-        assertTrue(dataNodeIterator.allContainers().contains(mockedContainer));
-        assertTrue(dataNodeIterator.allLists().contains(mockedList));
-        assertTrue(dataNodeIterator.allChoices().contains(mockedChoice));
-        assertTrue(dataNodeIterator.allChoices().get(0).getCases().values().contains(mockedCase1));
-        assertTrue(dataNodeIterator.allChoices().get(0).getCases().values().contains(mockedCase2));
-        assertTrue(dataNodeIterator.allContainers().contains(mockedContainerInNotification));
-        assertTrue(dataNodeIterator.allLists().contains(mockedListInRpcInputContainer));
-        assertTrue(dataNodeIterator.allGroupings().contains(mockedGrouping));
+        final DataNodeIterator it = new DataNodeIterator(mockedModule);
+        assertFalse(it.allContainers().contains(mockedAugmentingContainer));
+        assertTrue(it.allContainers().contains(mockedContainer));
+        assertTrue(it.allLists().contains(mockedList));
+        assertTrue(it.allChoices().contains(mockedChoice));
+        assertTrue(it.allChoices().get(0).getCases().values().contains(mockedCase1));
+        assertTrue(it.allChoices().get(0).getCases().values().contains(mockedCase2));
+        assertTrue(it.allContainers().contains(mockedContainerInNotification));
+        assertTrue(it.allLists().contains(mockedListInRpcInputContainer));
+        assertTrue(it.allGroupings().contains(mockedGrouping));
     }
 }
index 0ce69cfbd26e98d531ecf50c91c1023a6da0adcf..415d20aafb3e83ac0ec34f3b516ed41d43d6d832 100644 (file)
@@ -50,8 +50,8 @@ import org.slf4j.LoggerFactory;
 final class SharedSchemaContextFactory implements SchemaContextFactory {
     private static final Logger LOG = LoggerFactory.getLogger(SharedSchemaContextFactory.class);
 
-    private final Cache<Collection<SourceIdentifier>, SchemaContext> cache = CacheBuilder.newBuilder().weakValues()
-            .build();
+    private final Cache<Collection<SourceIdentifier>, SchemaContext> revisionCache = CacheBuilder.newBuilder()
+            .weakValues().build();
     private final Cache<Collection<SourceIdentifier>, SchemaContext> semVerCache = CacheBuilder.newBuilder()
             .weakValues().build();
     private final SharedSchemaRepository repository;
@@ -69,7 +69,7 @@ final class SharedSchemaContextFactory implements SchemaContextFactory {
     public ListenableFuture<SchemaContext> createSchemaContext(final Collection<SourceIdentifier> requiredSources,
             final StatementParserMode statementParserMode, final Set<QName> supportedFeatures) {
         return createSchemaContext(requiredSources,
-                statementParserMode == StatementParserMode.SEMVER_MODE ? this.semVerCache : this.cache,
+                statementParserMode == StatementParserMode.SEMVER_MODE ? this.semVerCache : this.revisionCache,
                 new AssembleSources(Optional.ofNullable(supportedFeatures), statementParserMode));
     }
 
index 8a6968ad152fdf7a90a0a1751faaad9e9250bb2e..00075b935876010d296b1d68194f4dfc387f5629 100644 (file)
@@ -293,6 +293,7 @@ public final class YangTextSchemaContextResolver implements AutoCloseable, Schem
     }
 
     @Beta
+    @SuppressWarnings("checkstyle:avoidHidingCauseException")
     public SchemaContext trySchemaContext(final StatementParserMode statementParserMode)
             throws SchemaResolutionException {
         final ListenableFuture<SchemaContext> future = repository
index 980a17ead348ebc0f2a4950a8ca77b06ffd63d01..2fd1b9462e2ba258adde16678ba03e5214620ecb 100644 (file)
@@ -113,8 +113,8 @@ class BuildGlobalContext extends NamespaceStorageSupport implements Registry {
         return enabledSemanticVersions;
     }
 
-    StatementSupportBundle getSupportsForPhase(final ModelProcessingPhase currentPhase) {
-        return supports.get(currentPhase);
+    StatementSupportBundle getSupportsForPhase(final ModelProcessingPhase phase) {
+        return supports.get(phase);
     }
 
     void addSource(@Nonnull final StatementStreamSource source) {
@@ -301,8 +301,8 @@ class BuildGlobalContext extends NamespaceStorageSupport implements Registry {
     }
 
     @SuppressWarnings("checkstyle:illegalCatch")
-    private void loadPhaseStatementsFor(final Set<SourceSpecificContext> sources) throws ReactorException {
-        for (final SourceSpecificContext source : sources) {
+    private void loadPhaseStatementsFor(final Set<SourceSpecificContext> srcs) throws ReactorException {
+        for (final SourceSpecificContext source : srcs) {
             try {
                 source.loadStatements();
             } catch (final RuntimeException ex) {
index bfa3aa16221086a3149d4fd9c6327a964caaf7c7..30130fb7c83dce205139dbca414fcf9edbf52340 100644 (file)
@@ -248,6 +248,7 @@ final class ModifierImpl implements ModelActionBuilder {
     }
 
     @Override
+    @SuppressWarnings("checkstyle:hiddenField")
     public void apply(final InferenceAction action) {
         Preconditions.checkState(this.action == null, "Action already defined to %s", this.action);
         this.action = Preconditions.checkNotNull(action);
@@ -258,6 +259,7 @@ final class ModifierImpl implements ModelActionBuilder {
         private T value;
 
         @Override
+        @SuppressWarnings("checkstyle:hiddenField")
         public final T resolve(final InferenceContext ctx) {
             Preconditions.checkState(done);
             Preconditions.checkArgument(ctx == ModifierImpl.this.ctx);
@@ -268,6 +270,7 @@ final class ModifierImpl implements ModelActionBuilder {
             return done;
         }
 
+        @SuppressWarnings("checkstyle:hiddenField")
         final boolean resolvePrereq(final T value) {
             this.value = value;
             this.done = true;
@@ -275,7 +278,7 @@ final class ModifierImpl implements ModelActionBuilder {
         }
 
         final <O> Prerequisite<O> transform(final Function<? super T, O> transformation) {
-            return ctx -> transformation.apply(resolve(ctx));
+            return context -> transformation.apply(resolve(context));
         }
 
         @Override
@@ -305,7 +308,8 @@ final class ModifierImpl implements ModelActionBuilder {
             implements OnPhaseFinished {
         @SuppressWarnings("unchecked")
         @Override
-        public boolean phaseFinished(final StatementContextBase<?, ?, ?> context, final ModelProcessingPhase phase) {
+        public boolean phaseFinished(final StatementContextBase<?, ?, ?> context,
+                final ModelProcessingPhase finishedPhase) {
             return resolvePrereq((C) context);
         }
     }
@@ -333,7 +337,8 @@ final class ModifierImpl implements ModelActionBuilder {
 
         @SuppressWarnings("unchecked")
         @Override
-        public boolean phaseFinished(final StatementContextBase<?, ?, ?> context, final ModelProcessingPhase phase) {
+        public boolean phaseFinished(final StatementContextBase<?, ?, ?> context,
+                final ModelProcessingPhase finishedPhase) {
             return resolvePrereq((C) context);
         }
 
index 7d60b26c1a1b0a733d1e3e3fc364fdeb4929e0b6..b4077ec9ce4e3707832140c3bff07f6ce7f63422 100644 (file)
@@ -47,9 +47,9 @@ public class RootStatementContext<A, D extends DeclaredStatement<A>, E extends E
     private final SourceSpecificContext sourceContext;
     private final A argument;
 
-    private YangVersion version;
+    private YangVersion rootVersion;
     private Collection<SourceIdentifier> requiredSources = ImmutableSet.of();
-    private SourceIdentifier identifier;
+    private SourceIdentifier rootIdentifier;
 
     /**
      * References to RootStatementContext of submodules which are included in this source.
@@ -202,16 +202,16 @@ public class RootStatementContext<A, D extends DeclaredStatement<A>, E extends E
 
     @Override
     public YangVersion getRootVersion() {
-        return version == null ? DEFAULT_VERSION : version;
+        return rootVersion == null ? DEFAULT_VERSION : rootVersion;
     }
 
     @Override
     public void setRootVersion(final YangVersion version) {
         checkArgument(sourceContext.getSupportedVersions().contains(version),
                 "Unsupported yang version %s in %s", version, getStatementSourceReference());
-        checkState(this.version == null, "Version of root %s has been already set to %s", argument,
-                this.version);
-        this.version = requireNonNull(version);
+        checkState(this.rootVersion == null, "Version of root %s has been already set to %s", argument,
+                this.rootVersion);
+        this.rootVersion = requireNonNull(version);
     }
 
     @Override
@@ -240,11 +240,11 @@ public class RootStatementContext<A, D extends DeclaredStatement<A>, E extends E
 
     @Override
     public void setRootIdentifier(final SourceIdentifier identifier) {
-        this.identifier = requireNonNull(identifier);
+        this.rootIdentifier = requireNonNull(identifier);
     }
 
     SourceIdentifier getRootIdentifier() {
-        return identifier;
+        return rootIdentifier;
     }
 
     @Override
index d009eb78dba486b89a922155f69c16b5e6729a4c..4e806ee4ae4178ca23f3f7f12d594dc786895a94 100644 (file)
@@ -76,7 +76,7 @@ public abstract class StatementContextBase<A, D extends DeclaredStatement<A>, E
         /**
          * Invoked whenever a processing phase has finished.
          */
-        boolean phaseFinished(StatementContextBase<?, ?, ?> context, ModelProcessingPhase phase);
+        boolean phaseFinished(StatementContextBase<?, ?, ?> context, ModelProcessingPhase finishedPhase);
     }
 
     /**
@@ -293,9 +293,9 @@ public abstract class StatementContextBase<A, D extends DeclaredStatement<A>, E
     }
 
     public void removeStatementsFromEffectiveSubstatements(
-            final Collection<? extends StmtContext<?, ?, ?>> substatements) {
+            final Collection<? extends StmtContext<?, ?, ?>> statements) {
         if (!effective.isEmpty()) {
-            effective.removeAll(substatements);
+            effective.removeAll(statements);
             shrinkEffective();
         }
     }
@@ -372,20 +372,20 @@ public abstract class StatementContextBase<A, D extends DeclaredStatement<A>, E
     /**
      * Adds an effective statement to collection of substatements.
      *
-     * @param substatements substatements
+     * @param statements substatements
      * @throws IllegalStateException
      *             if added in declared phase
      * @throws NullPointerException
      *             if statement parameter is null
      */
-    public void addEffectiveSubstatements(final Collection<? extends Mutable<?, ?, ?>> substatements) {
-        if (substatements.isEmpty()) {
+    public void addEffectiveSubstatements(final Collection<? extends Mutable<?, ?, ?>> statements) {
+        if (statements.isEmpty()) {
             return;
         }
 
-        substatements.forEach(Preconditions::checkNotNull);
-        beforeAddEffectiveStatement(substatements.size());
-        effective.addAll(substatements);
+        statements.forEach(Preconditions::checkNotNull);
+        beforeAddEffectiveStatement(statements.size());
+        effective.addAll(statements);
     }
 
     private void beforeAddEffectiveStatement(final int toAdd) {
@@ -626,7 +626,7 @@ public abstract class StatementContextBase<A, D extends DeclaredStatement<A>, E
             final ModelProcessingPhase phase, final NamespaceKeyCriterion<K> criterion,
             final OnNamespaceItemAdded listener) {
         ((StatementContextBase<?, ? ,?>) value).addPhaseCompletedListener(phase,
-            (context, completedPhase) -> {
+            (context, phaseCompleted) -> {
                 selectMatch(type, criterion, listener);
                 return true;
             });
index 1f9be29ca9c440180b902f1b113bc1849328d56a..842e9d98fa5d8d9b97de6248cc2e19fb205ee265 100644 (file)
@@ -35,8 +35,8 @@ abstract class StatementMap {
         }
 
         @Override
-        StatementMap put(final int index, final StatementContextBase<?, ?, ?> object) {
-            return index == 0 ? new Singleton(object) : new Regular(index, object);
+        StatementMap put(final int index, final StatementContextBase<?, ?, ?> obj) {
+            return index == 0 ? new Singleton(obj) : new Regular(index, obj);
         }
 
         @Override
@@ -75,14 +75,14 @@ abstract class StatementMap {
         }
 
         @Override
-        StatementMap put(final int index, final StatementContextBase<?, ?, ?> object) {
+        StatementMap put(final int index, final StatementContextBase<?, ?, ?> obj) {
             if (index < elements.length) {
                 checkArgument(elements[index] == null);
             } else {
                 elements = Arrays.copyOf(elements, index + 1);
             }
 
-            elements[index] = requireNonNull(object);
+            elements[index] = requireNonNull(obj);
             return this;
         }
 
@@ -169,9 +169,9 @@ abstract class StatementMap {
         }
 
         @Override
-        StatementMap put(final int index, final StatementContextBase<?, ?, ?> object) {
+        StatementMap put(final int index, final StatementContextBase<?, ?, ?> obj) {
             checkArgument(index != 0);
-            return new Regular(this.object, index, object);
+            return new Regular(this.object, index, obj);
         }
 
         @Override
@@ -203,11 +203,11 @@ abstract class StatementMap {
      * Add a statement at specified index.
      *
      * @param index Element index, must be non-negative
-     * @param object Object to store
+     * @param obj Object to store
      * @return New statement map
      * @throws IllegalArgumentException if the index is already occupied
      */
-    abstract @Nonnull StatementMap put(int index, @Nonnull StatementContextBase<?, ?, ?> object);
+    abstract @Nonnull StatementMap put(int index, @Nonnull StatementContextBase<?, ?, ?> obj);
 
     /**
      * Return a read-only view of the elements in this map. Unlike other maps, this view does not detect concurrent
index 4131f5573150ce0371b443fb935e2f945cf8b0b1..de13c70bdf4a3c30b1986bd702d60f68a6d22f9c 100644 (file)
@@ -7,7 +7,8 @@
  */
 package org.opendaylight.yangtools.yang.parser.rfc7950.repo;
 
-import com.google.common.base.Preconditions;
+import static java.util.Objects.requireNonNull;
+
 import java.util.ArrayDeque;
 import java.util.Deque;
 import org.opendaylight.yangtools.yang.parser.spi.source.DeclarationInTextSource;
@@ -32,10 +33,10 @@ final class StatementSourceReferenceHandler extends DefaultHandler {
     private final Document doc;
     private final String file;
 
-    private Locator locator;
+    private Locator documentLocator;
 
     StatementSourceReferenceHandler(final Document doc, final String file) {
-        this.doc = Preconditions.checkNotNull(doc);
+        this.doc = requireNonNull(doc);
         this.file = file;
     }
 
@@ -53,7 +54,7 @@ final class StatementSourceReferenceHandler extends DefaultHandler {
     @Override
     public void setDocumentLocator(final Locator locator) {
         // Save the locator, so that it can be used later for line tracking when traversing nodes.
-        this.locator = locator;
+        this.documentLocator = locator;
     }
 
     @Override
@@ -66,8 +67,8 @@ final class StatementSourceReferenceHandler extends DefaultHandler {
             el.setAttributeNS(attributes.getURI(i), attributes.getQName(i), attributes.getValue(i));
         }
 
-        final StatementSourceReference ref = DeclarationInTextSource.atPosition(file, locator.getLineNumber(),
-            locator.getColumnNumber());
+        final StatementSourceReference ref = DeclarationInTextSource.atPosition(file, documentLocator.getLineNumber(),
+            documentLocator.getColumnNumber());
         el.setUserData(USER_DATA_KEY, ref, null);
         stack.push(el);
     }
index 511cb811fda046c61d317bacceae6ff0d6875cf9..e6d57ff458f65bd61c2333d113d327e7d0791223 100644 (file)
@@ -12,7 +12,6 @@ import static java.util.Objects.requireNonNull;
 import java.util.ArrayList;
 import java.util.List;
 import org.antlr.v4.runtime.BaseErrorListener;
-import org.antlr.v4.runtime.Parser;
 import org.antlr.v4.runtime.RecognitionException;
 import org.antlr.v4.runtime.Recognizer;
 import org.opendaylight.yangtools.yang.model.parser.api.YangSyntaxErrorException;
@@ -38,26 +37,6 @@ public final class YangErrorListener extends BaseErrorListener {
         exceptions.add(new YangSyntaxErrorException(source, line, charPositionInLine, msg, e));
     }
 
-    @SuppressWarnings("checkstyle:illegalCatch")
-    private static String getModuleName(final Recognizer<?, ?> recognizer) {
-        if (!(recognizer instanceof Parser)) {
-            return null;
-        }
-
-        final Parser parser = (Parser) recognizer;
-        try {
-            String model = parser.getInputStream().getTokenSource().getInputStream().toString();
-            model = model.substring(0, model.indexOf('\n'));
-            model = model.substring(model.indexOf("module") + 6);
-            model = model.substring(0, model.indexOf('{'));
-            model = model.trim();
-            return model;
-        } catch (Exception e) {
-            LOG.debug("Failed to extract module name from parser {}", parser, e);
-            return null;
-        }
-    }
-
     public void validate() throws YangSyntaxErrorException {
         if (exceptions.isEmpty()) {
             return;
@@ -69,12 +48,8 @@ public final class YangErrorListener extends BaseErrorListener {
         }
 
         final StringBuilder sb = new StringBuilder();
-        SourceIdentifier source = null;
         boolean first = true;
         for (YangSyntaxErrorException e : exceptions) {
-            if (source == null) {
-                source = e.getSource().orElse(null);
-            }
             if (first) {
                 first = false;
             } else {
index fef331b86d1684b0af668d32b605dc7ef14eb95b..c66cf73d1e841810c58194d85de468e98eb9d259 100644 (file)
@@ -337,7 +337,7 @@ public abstract class YangModelDependencyInfo {
     /**
      * Dependency information for YANG module.
      */
-    public static class ModuleDependencyInfo extends YangModelDependencyInfo {
+    public static final class ModuleDependencyInfo extends YangModelDependencyInfo {
         private ModuleDependencyInfo(final String name, final String latestRevision,
                 final ImmutableSet<ModuleImport> imports, final ImmutableSet<ModuleImport> includes) {
             super(name, latestRevision, imports, includes);
index e4c9a8450fa15ba8624bd51c4b5a8d71c1cd34a6..5b61b284509f209f01ffa83adb69cae9ad1a1c54 100644 (file)
@@ -50,12 +50,14 @@ final class YangStatementParserListenerImpl extends YangStatementParserBaseListe
         this.sourceName = sourceName;
     }
 
+    @SuppressWarnings("checkstyle:hiddenField")
     public void setAttributes(final StatementWriter writer, final QNameToStatementDefinition stmtDef) {
         this.writer = writer;
         this.stmtDef = stmtDef;
         initCounters();
     }
 
+    @SuppressWarnings("checkstyle:hiddenField")
     public void setAttributes(final StatementWriter writer, final QNameToStatementDefinition stmtDef,
             final PrefixToModule prefixes) {
         this.writer = writer;
@@ -64,6 +66,7 @@ final class YangStatementParserListenerImpl extends YangStatementParserBaseListe
         initCounters();
     }
 
+    @SuppressWarnings("checkstyle:hiddenField")
     public void setAttributes(final StatementWriter writer, final QNameToStatementDefinition stmtDef,
             final PrefixToModule prefixes, final YangVersion yangVersion) {
         this.yangVersion = yangVersion;
index 6fcb060af822f7f2a94ca21584a8697867710d1f..6621bc20f8bc7a3a02e95d0b194e123d26a21ef5 100644 (file)
@@ -387,6 +387,7 @@ public abstract class AbstractEffectiveModule<D extends DeclaredStatement<String
     }
 
     @Override
+    @SuppressWarnings("checkstyle:hiddenField")
     public final Optional<DataSchemaNode> findDataChildByName(final QName name) {
         // Child nodes are keyed by their container name, so we can do a direct lookup
         return Optional.ofNullable(childNodes.get(requireNonNull(name)));
index 16d6e49a95fea55b6ff73ab5cfd62b1d1f22f671..fde388da25ba8aab4fdea66a1d8b89e17580676f 100644 (file)
@@ -55,7 +55,8 @@ public abstract class UnknownEffectiveStatementBase<A, D extends UnknownStatemen
         // initCopyType
         final CopyHistory copyTypesFromOriginal = ctx.getCopyHistory();
         if (copyTypesFromOriginal.contains(CopyType.ADDED_BY_USES_AUGMENTATION)) {
-            this.addedByUses = this.addedByAugmentation = true;
+            this.addedByAugmentation = true;
+            this.addedByUses = true;
         } else {
             this.addedByAugmentation = copyTypesFromOriginal.contains(CopyType.ADDED_BY_AUGMENTATION);
             this.addedByUses = copyTypesFromOriginal.contains(CopyType.ADDED_BY_USES);
index 401f5848a0eeca1c28f3cdc9efae7b5ad6f7aadf..83dcc8ffcba8344957ac7b3fa5256e3b8160e340 100644 (file)
@@ -71,7 +71,8 @@ final class ActionEffectiveStatementImpl extends AbstractEffectiveSchemaNode<Act
         // initCopyType
         final CopyHistory copyTypesFromOriginal = ctx.getCopyHistory();
         if (copyTypesFromOriginal.contains(CopyType.ADDED_BY_USES_AUGMENTATION)) {
-            this.addedByUses = this.augmenting = true;
+            this.augmenting = true;
+            this.addedByUses = true;
         } else {
             this.augmenting = copyTypesFromOriginal.contains(CopyType.ADDED_BY_AUGMENTATION);
             this.addedByUses = copyTypesFromOriginal.contains(CopyType.ADDED_BY_USES);
index 287757227048a784d8163e5ae711f2657e171aad..ac7793ce8ade02c7d652a001b312195df44e972e 100644 (file)
@@ -119,7 +119,7 @@ abstract class AbstractModuleStatementSupport extends
 
         stmt.addToNs(PrefixToModule.class, modulePrefix, qNameModule);
         stmt.addToNs(ModuleNameToModuleQName.class, stmt.getStatementArgument(), qNameModule);
-        stmt.addToNs(ModuleCtxToModuleQName.class, stmt, qNameModule); // tu
+        stmt.addToNs(ModuleCtxToModuleQName.class, stmt, qNameModule);
         stmt.addToNs(ModuleCtxToSourceIdentifier.class, stmt, moduleIdentifier);
         stmt.addToNs(ModuleQNameToModuleName.class, qNameModule, stmt.getStatementArgument());
         stmt.addToNs(ImportPrefixToModuleCtx.class, modulePrefix, stmt);
index e6ea225fb30fb3080c2612e521ceeecde0c35826..02140d0fa15d138d904eb286b9e556e1ee6ca9e2 100644 (file)
@@ -67,7 +67,8 @@ final class NotificationEffectiveStatementImpl
         // initCopyType
         final CopyHistory copyTypesFromOriginal = ctx.getCopyHistory();
         if (copyTypesFromOriginal.contains(CopyType.ADDED_BY_USES_AUGMENTATION)) {
-            this.addedByUses = this.augmenting = true;
+            this.augmenting = true;
+            this.addedByUses = true;
         } else {
             this.augmenting = copyTypesFromOriginal.contains(CopyType.ADDED_BY_AUGMENTATION);
             this.addedByUses = copyTypesFromOriginal.contains(CopyType.ADDED_BY_USES);
index de7cbb4abac4c9e5a31e304855b2d952367fd03b..9b44d3b33ba1395fb2d3485b28502a968279d300 100644 (file)
@@ -122,10 +122,10 @@ public class OrderingTest {
 
     @Test
     public void testOrderingNestedChildNodes3() throws Exception {
-        final Module baz = TestUtils.loadModuleResources(getClass(), "/ordering/foo.yang")
+        final Module justFoo = TestUtils.loadModuleResources(getClass(), "/ordering/foo.yang")
                 .getModules().iterator().next();
-        final ContainerSchemaNode x = (ContainerSchemaNode) baz
-                .getDataChildByName(QName.create(baz.getQNameModule(), "x"));
+        final ContainerSchemaNode x = (ContainerSchemaNode) justFoo
+                .getDataChildByName(QName.create(justFoo.getQNameModule(), "x"));
         final Collection<DataSchemaNode> childNodes = x.getChildNodes();
 
         final String[] expectedOrder = { "x15", "x10", "x5", "x1", "a5", "a1", "x2", "b5", "b1", "x3", "ax15", "ax5" };
index b9a2e0d220ff36a9675783bf784fdf300b5d547e..b4d32f48795bc73440c2717b4071921fefc5c017 100644 (file)
@@ -42,7 +42,7 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.xml.sax.SAXException;
 
-public class StmtTestUtils {
+public final class StmtTestUtils {
 
     public static final FileFilter YANG_FILE_FILTER =
         file -> file.getName().endsWith(YangConstants.RFC6020_YANG_FILE_EXTENSION) && file.isFile();
index b6ed4af0709ebd5efc5bb5a65b7f95bfc384d81d..5319b9dae0afaa0a04af2447f334fc346d0cd4a5 100644 (file)
@@ -290,7 +290,8 @@ public class TypesResolutionTest {
 
         EnumTypeDefinition enumType = (EnumTypeDefinition) testedType.getBaseType();
         List<EnumPair> values = enumType.getValues();
-        assertEquals(415, values.size()); // 0-414
+        // 0-414
+        assertEquals(415, values.size());
 
         EnumPair enum168 = values.get(168);
         assertEquals("America/Danmarkshavn", enum168.getName());