Enable checkstyle rule to catch variables that hide fields
Enable the checkstyle "HiddenFields" rule and fix any issues
that it detects. Suppress these violations for parameters
to setters and constructors.
Added support for the checkstyle comment suppression module
// CHECKSTYLE:OFF and //CHECKSTYLE:ON are now
supported.
Suppressed HiddenField checks for net.onrc.onos.core.packet.*
rather than fix them. These APIs are designed to
require formal parameters and local members having
the same name.
Change-Id: Ibc057603a934842d9c9b9b668f55bc5f5519e7f6
diff --git a/src/main/java/net/onrc/onos/core/datastore/topology/KVDevice.java b/src/main/java/net/onrc/onos/core/datastore/topology/KVDevice.java
index 5552f59..cfdb02b 100644
--- a/src/main/java/net/onrc/onos/core/datastore/topology/KVDevice.java
+++ b/src/main/java/net/onrc/onos/core/datastore/topology/KVDevice.java
@@ -143,9 +143,9 @@
this.isPortIdsModified = true;
}
- public void addAllToPortIds(final Collection<byte[]> portIds) {
+ public void addAllToPortIds(final Collection<byte[]> newPortIds) {
// TODO: Should we copy portId, or reference is OK.
- isPortIdsModified |= this.portIds.addAll(portIds);
+ isPortIdsModified |= portIds.addAll(newPortIds);
}
/**
diff --git a/src/main/java/net/onrc/onos/core/datastore/utils/KVObject.java b/src/main/java/net/onrc/onos/core/datastore/utils/KVObject.java
index 94f509f..2efa0b0 100644
--- a/src/main/java/net/onrc/onos/core/datastore/utils/KVObject.java
+++ b/src/main/java/net/onrc/onos/core/datastore/utils/KVObject.java
@@ -144,11 +144,12 @@
* Deserialize using value and version stored in data store.
*
* @param bytes serialized bytes
- * @param version version of this {@code bytes}
+ * @param dataStoreVersion version of this {@code bytes}
* @return true if success
*/
- public boolean deserialize(final byte[] bytes, final long version) {
- this.version = version;
+ public boolean deserialize(final byte[] bytes,
+ final long dataStoreVersion) {
+ version = dataStoreVersion;
return deserialize(bytes);
}