Enable spotbugs in yang-binding 07/76907/1
authorRobert Varga <robert.varga@pantheon.tech>
Thu, 11 Oct 2018 18:49:01 +0000 (20:49 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Thu, 11 Oct 2018 18:49:01 +0000 (20:49 +0200)
This fixes up the issues reported and flips enforcement to on.

Change-Id: I2e9b0c82af063d322428216be40e7562959f0824
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
binding/yang-binding/pom.xml
binding/yang-binding/src/main/java/org/opendaylight/yangtools/yang/binding/Identifier.java
binding/yang-binding/src/main/java/org/opendaylight/yangtools/yang/binding/InstanceIdentifierV3.java
binding/yang-binding/src/main/java/org/opendaylight/yangtools/yang/binding/KeyedInstanceIdentifierV2.java

index bdadde93b3c7c60d194beed10df99a77c1a49e6e..6460de1a1db5de88999c4e29bc5767996192259f 100644 (file)
                     <propertyExpansion>checkstyle.violationSeverity=error</propertyExpansion>
                 </configuration>
             </plugin>
+            <plugin>
+                <groupId>com.github.spotbugs</groupId>
+                <artifactId>spotbugs-maven-plugin</artifactId>
+                <configuration>
+                    <failOnError>true</failOnError>
+                </configuration>
+            </plugin>
         </plugins>
     </build>
 </project>
index 60b85d52b59269d8b5cc4972ec067aa0cb40f5f0..343088f70eb367cc098552141c51abe00335adc7 100644 (file)
@@ -7,13 +7,15 @@
  */
 package org.opendaylight.yangtools.yang.binding;
 
+import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+
 /**
  * Object is unique identifier for another object.
  *
- * @param <T>
- *            Class of object for which this object is identifier
+ * @param <T> Class of object for which this object is identifier
  * @author ttkacik
  */
+@SuppressFBWarnings(value = "NM_SAME_SIMPLE_NAME_AS_INTERFACE", justification = "This is binding specialization")
 public interface Identifier<T extends Identifiable<?>> extends org.opendaylight.yangtools.concepts.Identifier {
 
 }
index 4a9023da6a9e09b805fe9cb6be95c51cbf7eb9f3..7f6ce11e557c25501d652a4c6f046b398de79944 100644 (file)
@@ -80,7 +80,7 @@ class InstanceIdentifierV3<T extends DataObject> implements Externalizable {
         pathArguments = ImmutableList.copyOf(args);
     }
 
-    private Object readResolve() throws ObjectStreamException {
+    Object readResolve() throws ObjectStreamException {
         return new InstanceIdentifier<>(targetType, pathArguments, wildcarded, hash);
     }
 }
index fbce0dee8d8fac923a9a147a7f22519312986d70..a7f2546dd8fc0bb1d654274dfd937026e8c0dd4e 100644 (file)
@@ -41,7 +41,8 @@ final class KeyedInstanceIdentifierV2<T extends Identifiable<K> & DataObject, K
         key = (K) in.readObject();
     }
 
-    private Object readResolve() throws ObjectStreamException {
+    @Override
+    Object readResolve() throws ObjectStreamException {
         return new KeyedInstanceIdentifier<>(getTargetType(), getPathArguments(), isWildcarded(), getHash(), key);
     }
 }