Fix error-prone reported problems
- equals() method was comparing metric to itself
- toString() was using the toString value of an array
Change-Id: I5da31f7b3b56ee78cf8d272abdf0214d11863880
diff --git a/utils/misc/src/main/java/org/onlab/packet/RIPngEntry.java b/utils/misc/src/main/java/org/onlab/packet/RIPngEntry.java
index 0e4f5c8..acc500c 100644
--- a/utils/misc/src/main/java/org/onlab/packet/RIPngEntry.java
+++ b/utils/misc/src/main/java/org/onlab/packet/RIPngEntry.java
@@ -107,7 +107,7 @@
final RIPngEntry that = (RIPngEntry) obj;
return super.equals(that) &&
- Objects.equals(metric, metric) &&
+ Objects.equals(metric, that.metric) &&
Objects.equals(routeTag, that.routeTag) &&
Objects.equals(prefixLen, that.prefixLen) &&
Arrays.equals(prefix, that.prefix) &&
@@ -184,7 +184,8 @@
*/
@Override
public String toString() {
- return "RIPngEntry [prefix=" + this.prefix + ", route tag=" + this.routeTag
+ return "RIPngEntry [prefix=" + Arrays.toString(this.prefix)
+ + ", route tag=" + this.routeTag
+ ", prefix length=" + this.prefixLen
+ ", metric = " + this.metric + "]";
}