Fix a bunch of warnings 48/45148/1
authorRobert Varga <rovarga@cisco.com>
Mon, 5 Sep 2016 10:11:34 +0000 (12:11 +0200)
committerRobert Varga <rovarga@cisco.com>
Mon, 5 Sep 2016 10:11:34 +0000 (12:11 +0200)
- javadoc order
- unneeded casts
- static methods

Change-Id: I98344b7052eee1a58c709665e92d0cb1a0d72b46
Signed-off-by: Robert Varga <rovarga@cisco.com>
yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/spi/meta/ModelActionBuilder.java
yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/reactor/StatementContextBase.java
yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/reactor/SubstatementContext.java
yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/rfc6020/SchemaNodeIdentifierBuildNamespace.java
yang/yang-parser-impl/src/test/java/org/opendaylight/yangtools/yang/stmt/Bug5884Test.java
yang/yang-parser-impl/src/test/java/org/opendaylight/yangtools/yang/stmt/Bug6316.java
yang/yang-parser-impl/src/test/java/org/opendaylight/yangtools/yang/stmt/TypesResolutionTest.java

index 54605dbc67961e55fc9d78b7f38adf8d1a32571e..d14f3c84434a5ef3d99690c4e56e91579fad28cf 100644 (file)
@@ -126,11 +126,10 @@ public interface ModelActionBuilder {
          * List of failed prerequisites should be used to select right message / error
          * type to debug problem in YANG sources.
          *
+         * @param failed collection of prerequisites which were not met
          * @throws InferenceException If inference action can not be processed.
          *      Note that this exception be used for user to debug YANG sources,
          *      so should provide helpful context to fix issue in sources.
-         *
-         * @param failed collection of prerequisites which were not met
          */
         void prerequisiteFailed(Collection<? extends Prerequisite<?>> failed) throws InferenceException;
     }
index 1512ff21b2f61b7522b40111f64de46f20f16141..cf79951a3c2be837c7c3c3b28fb44b90e67289d8 100644 (file)
@@ -278,12 +278,11 @@ public abstract class StatementContextBase<A, D extends DeclaredStatement<A>, E
     /**
      * adds effective statement to collection of substatements
      *
+     * @param substatement substatement
      * @throws IllegalStateException
      *             if added in declared phase
      * @throws NullPointerException
      *             if statement parameter is null
-     *
-     * @param substatement substatement
      */
     public void addEffectiveSubstatement(final StatementContextBase<?, ?, ?> substatement) {
 
@@ -299,12 +298,11 @@ public abstract class StatementContextBase<A, D extends DeclaredStatement<A>, E
     /**
      * adds declared statement to collection of substatements
      *
+     * @param substatement substatement
      * @throws IllegalStateException
      *             if added in effective phase
      * @throws NullPointerException
      *             if statement parameter is null
-     *
-     * @param substatement substatement
      */
     public void addDeclaredSubstatement(final StatementContextBase<?, ?, ?> substatement) {
 
index c8129a5e5eb646c51e28cdadde74ad77d815cf13..5536dfe7c59fd16123001bfb4e8de484b1d1d161 100644 (file)
@@ -11,7 +11,6 @@ import com.google.common.base.Optional;
 import com.google.common.base.Preconditions;
 import com.google.common.base.Verify;
 import java.util.Collection;
-import java.util.Objects;
 import org.opendaylight.yangtools.yang.common.QName;
 import org.opendaylight.yangtools.yang.common.QNameModule;
 import org.opendaylight.yangtools.yang.model.api.SchemaPath;
index 40d84cee4c475f468952b1d75d37698f59389a17..ddcdd40afed4bdc3766dddc582b8d4701e3dd6bd 100644 (file)
@@ -74,7 +74,7 @@ class SchemaNodeIdentifierBuildNamespace extends
     }
 
     @SuppressWarnings({"unchecked", "rawtypes"})
-    private Mutable<?, ?, EffectiveStatement<?, ?>> tryToFindUnknownStatement(final String localName,
+    private static Mutable<?, ?, EffectiveStatement<?, ?>> tryToFindUnknownStatement(final String localName,
             final Mutable<?, ?, EffectiveStatement<?, ?>> current) {
         Collection<StmtContext<?, ?, ?>> unknownSubstatements = (Collection)StmtContextUtils.findAllSubstatements(current,
                 UnknownStatement.class);
index 309b0e756910d1b37df423b76d841ebb20e530d0..4669a4e3cd8216fc5b04e81b263c4440486d5550 100644 (file)
@@ -55,10 +55,9 @@ public class Bug5884Test {
         testIterator(availableIterator);
     }
 
-    private void testIterator(final Iterator<AugmentationSchema> iterator) {
-        AugmentationSchema allAugments;
+    private static void testIterator(final Iterator<AugmentationSchema> iterator) {
         while (iterator.hasNext()) {
-            allAugments = iterator.next();
+            AugmentationSchema allAugments = iterator.next();
             final DataSchemaNode currentChoice = allAugments.getChildNodes().iterator().next();
             assertTrue(currentChoice instanceof ChoiceCaseNode);
         }
index eb60e0a974581ed361d306509af9456b8617eb01..c83ad384127faceeef9e224a5ec2ee6d5cf14952 100644 (file)
@@ -37,7 +37,7 @@ public class Bug6316 {
         verifyBitsTypedefinition(context);
     }
 
-    private void verifyEnumTypedefinition(final SchemaContext context) {
+    private static void verifyEnumTypedefinition(final SchemaContext context) {
         final DataSchemaNode dataChildByName = context.getDataChildByName(QName
                 .create("foo", "1970-01-01", "enum-leaf"));
         assertTrue(dataChildByName instanceof LeafSchemaNode);
@@ -70,7 +70,7 @@ public class Bug6316 {
         }
     }
 
-    private void verifyBitsTypedefinition(final SchemaContext context) {
+    private static void verifyBitsTypedefinition(final SchemaContext context) {
         final DataSchemaNode dataChildByName = context.getDataChildByName(QName
                 .create("foo", "1970-01-01", "bits-leaf"));
         assertTrue(dataChildByName instanceof LeafSchemaNode);
index 797b65c2537eff0b759aeea4f26fad2299a8af19..16b8cefe3bfdef4d6760ef3ae745770c5db7f035 100644 (file)
@@ -76,17 +76,17 @@ public class TypesResolutionTest {
 
         EnumPair value0 = values.get(0);
         assertEquals("unknown", value0.getName());
-        assertEquals(0, (int) value0.getValue());
+        assertEquals(0, value0.getValue());
         assertEquals("An unknown or unspecified version of the Internet protocol.", value0.getDescription());
 
         EnumPair value1 = values.get(1);
         assertEquals("ipv4", value1.getName());
-        assertEquals(1, (int) value1.getValue());
+        assertEquals(1, value1.getValue());
         assertEquals("The IPv4 protocol as defined in RFC 791.", value1.getDescription());
 
         EnumPair value2 = values.get(2);
         assertEquals("ipv6", value2.getName());
-        assertEquals(2, (int) value2.getValue());
+        assertEquals(2, value2.getValue());
         assertEquals("The IPv6 protocol as defined in RFC 2460.", value2.getDescription());
     }
 
@@ -102,22 +102,22 @@ public class TypesResolutionTest {
 
         EnumPair value0 = values.get(0);
         assertEquals("unknown", value0.getName());
-        assertEquals(0, (int) value0.getValue());
+        assertEquals(0, value0.getValue());
         assertEquals("An unknown or unspecified version of the Internet protocol.", value0.getDescription());
 
         EnumPair value1 = values.get(1);
         assertEquals("ipv4", value1.getName());
-        assertEquals(19, (int) value1.getValue());
+        assertEquals(19, value1.getValue());
         assertEquals("The IPv4 protocol as defined in RFC 791.", value1.getDescription());
 
         EnumPair value2 = values.get(2);
         assertEquals("ipv6", value2.getName());
-        assertEquals(7, (int) value2.getValue());
+        assertEquals(7, value2.getValue());
         assertEquals("The IPv6 protocol as defined in RFC 2460.", value2.getDescription());
 
         EnumPair value3 = values.get(3);
         assertEquals("default", value3.getName());
-        assertEquals(20, (int) value3.getValue());
+        assertEquals(20, value3.getValue());
         assertEquals("default ip", value3.getDescription());
     }
 
@@ -228,15 +228,15 @@ public class TypesResolutionTest {
 
         Bit bit1 = bits.get(0);
         assertEquals("disable-nagle", bit1.getName());
-        assertEquals(0L, (long) bit1.getPosition());
+        assertEquals(0L, bit1.getPosition());
 
         Bit bit2 = bits.get(1);
         assertEquals("auto-sense-speed", bit2.getName());
-        assertEquals(1L, (long) bit2.getPosition());
+        assertEquals(1L, bit2.getPosition());
 
         Bit bit3 = bits.get(2);
         assertEquals("10-Mb-only", bit3.getName());
-        assertEquals(2L, (long) bit3.getPosition());
+        assertEquals(2L, bit3.getPosition());
     }
 
     @Test
@@ -250,19 +250,19 @@ public class TypesResolutionTest {
         assertEquals(5, bits.size());
 
         Bit bit0 = bits.get(0);
-        assertEquals(0L, (long) bit0.getPosition());
+        assertEquals(0L, bit0.getPosition());
 
         Bit bit1 = bits.get(1);
-        assertEquals(500L, (long) bit1.getPosition());
+        assertEquals(500L, bit1.getPosition());
 
         Bit bit2 = bits.get(2);
-        assertEquals(501L, (long) bit2.getPosition());
+        assertEquals(501L, bit2.getPosition());
 
         Bit bit3 = bits.get(3);
-        assertEquals(502L, (long) bit3.getPosition());
+        assertEquals(502L, bit3.getPosition());
 
         Bit bit4 = bits.get(4);
-        assertEquals(365L, (long) bit4.getPosition());
+        assertEquals(365L, bit4.getPosition());
     }
 
     @Test
@@ -287,12 +287,12 @@ public class TypesResolutionTest {
 
         EnumPair enum168 = values.get(168);
         assertEquals("America/Danmarkshavn", enum168.getName());
-        assertEquals(168, (int) enum168.getValue());
+        assertEquals(168, enum168.getValue());
         assertEquals("east coast, north of Scoresbysund", enum168.getDescription());
 
         EnumPair enum374 = values.get(374);
         assertEquals("America/Indiana/Winamac", enum374.getName());
-        assertEquals(374, (int) enum374.getValue());
+        assertEquals(374, enum374.getValue());
         assertEquals("Eastern Time - Indiana - Pulaski County", enum374.getDescription());
     }