commit | 50b7067cb935c41a0b309f6e6dcd4709bfc03450 | [log] [tgz] |
---|---|---|
author | Pavlin Radoslavov <pavlin@onlab.us> | Wed Nov 05 11:22:25 2014 -0800 |
committer | Pavlin Radoslavov <pavlin@onlab.us> | Wed Nov 05 11:22:25 2014 -0800 |
tree | ee152fb363dd99dc5501814ace5e0c5eb721f337 | |
parent | 32fa30cce1da32d2f108489b84db6daf8aa1c172 [diff] |
Changed the semantics of IpAddress.equals() to (eventually) return true if both objects are instanceof IpAddress. I.e., comparing IpAddress and Ip4Address objects could return true if the underlying value is same. Applied the same change to IpPrefix.equals() as well. Change-Id: Ie0644565501d3ecce2a8603117b994d033d5b82f
diff --git a/utils/misc/src/main/java/org/onlab/packet/IpAddress.java b/utils/misc/src/main/java/org/onlab/packet/IpAddress.java index 2906798..8a8aca2 100644 --- a/utils/misc/src/main/java/org/onlab/packet/IpAddress.java +++ b/utils/misc/src/main/java/org/onlab/packet/IpAddress.java
@@ -312,7 +312,7 @@ if (this == obj) { return true; } - if ((obj == null) || (getClass() != obj.getClass())) { + if ((obj == null) || (!(obj instanceof IpAddress))) { return false; } IpAddress other = (IpAddress) obj;
diff --git a/utils/misc/src/main/java/org/onlab/packet/IpPrefix.java b/utils/misc/src/main/java/org/onlab/packet/IpPrefix.java index c2fc175..11cf902 100644 --- a/utils/misc/src/main/java/org/onlab/packet/IpPrefix.java +++ b/utils/misc/src/main/java/org/onlab/packet/IpPrefix.java
@@ -221,7 +221,7 @@ if (this == obj) { return true; } - if ((obj == null) || (getClass() != obj.getClass())) { + if ((obj == null) || (!(obj instanceof IpPrefix))) { return false; } IpPrefix other = (IpPrefix) obj;