Fix CS warnings in cds-access-api and enable enforcement
[controller.git] / opendaylight / md-sal / cds-access-api / src / main / java / org / opendaylight / controller / cluster / access / concepts / FrontendType.java
index 52b6ccc6c82dc8fef81e14e2faf0f448a024c636..b58e24087484bca7616275a440e462a791f657d2 100644 (file)
@@ -37,6 +37,9 @@ public final class FrontendType implements Comparable<FrontendType>, WritableIde
         private static final long serialVersionUID = 1L;
         private byte[] serialized;
 
+        // checkstyle flags the public modifier as redundant however it is explicitly needed for Java serialization to
+        // be able to create instances via reflection.
+        @SuppressWarnings("checkstyle:RedundantModifier")
         public Proxy() {
             // For Externalizable
         }
@@ -85,6 +88,7 @@ public final class FrontendType implements Comparable<FrontendType>, WritableIde
      * - US-ASCII letters and numbers
      * - special characters: -_.*+:=,!~';
      *
+     * @param name the input name
      * @return A {@link FrontendType} instance
      * @throws IllegalArgumentException if the string is null, empty or contains invalid characters
      */
@@ -103,9 +107,9 @@ public final class FrontendType implements Comparable<FrontendType>, WritableIde
 
     @Override
     public void writeTo(final DataOutput out) throws IOException {
-        final byte[] serialized = getSerialized();
-        out.writeInt(serialized.length);
-        out.write(serialized);
+        final byte[] local = getSerialized();
+        out.writeInt(local.length);
+        out.write(local);
     }
 
     public String getName() {
@@ -118,13 +122,13 @@ public final class FrontendType implements Comparable<FrontendType>, WritableIde
     }
 
     @Override
-    public boolean equals(final Object o) {
-        return this == o || (o instanceof FrontendType && name.equals(((FrontendType)o).name));
+    public boolean equals(final Object obj) {
+        return this == obj || obj instanceof FrontendType && name.equals(((FrontendType)obj).name);
     }
 
     @Override
-    public int compareTo(final FrontendType o) {
-        return this == o ? 0 : name.compareTo(o.name);
+    public int compareTo(final FrontendType obj) {
+        return this == obj ? 0 : name.compareTo(obj.name);
     }
 
     @Override