fix for flow collisions
Change-Id: I07623fa06a5dbc1f36da021261f494f968fdf2f9
diff --git a/core/api/src/main/java/org/onlab/onos/net/flow/criteria/Criteria.java b/core/api/src/main/java/org/onlab/onos/net/flow/criteria/Criteria.java
index 8bd0960..ebd672c 100644
--- a/core/api/src/main/java/org/onlab/onos/net/flow/criteria/Criteria.java
+++ b/core/api/src/main/java/org/onlab/onos/net/flow/criteria/Criteria.java
@@ -161,7 +161,7 @@
@Override
public int hashCode() {
- return Objects.hash(port);
+ return Objects.hash(port, type());
}
@Override
@@ -171,7 +171,8 @@
}
if (obj instanceof PortCriterion) {
PortCriterion that = (PortCriterion) obj;
- return Objects.equals(port, that.port);
+ return Objects.equals(port, that.port) &&
+ Objects.equals(this.type(), that.type());
}
return false;
@@ -252,7 +253,7 @@
@Override
public int hashCode() {
- return Objects.hash(ethType);
+ return Objects.hash(ethType, type());
}
@Override
@@ -262,7 +263,8 @@
}
if (obj instanceof EthTypeCriterion) {
EthTypeCriterion that = (EthTypeCriterion) obj;
- return Objects.equals(ethType, that.ethType);
+ return Objects.equals(ethType, that.ethType) &&
+ Objects.equals(this.type(), that.type());
}
@@ -345,7 +347,7 @@
@Override
public int hashCode() {
- return Objects.hash(proto);
+ return Objects.hash(proto, type());
}
@Override
@@ -400,7 +402,8 @@
}
if (obj instanceof VlanPcpCriterion) {
VlanPcpCriterion that = (VlanPcpCriterion) obj;
- return Objects.equals(vlanPcp, that.vlanPcp);
+ return Objects.equals(vlanPcp, that.vlanPcp) &&
+ Objects.equals(this.type(), that.type());
}
@@ -436,7 +439,7 @@
@Override
public int hashCode() {
- return Objects.hash(vlanId);
+ return Objects.hash(vlanId, type());
}
@Override
@@ -446,7 +449,8 @@
}
if (obj instanceof VlanIdCriterion) {
VlanIdCriterion that = (VlanIdCriterion) obj;
- return Objects.equals(vlanId, that.vlanId);
+ return Objects.equals(vlanId, that.vlanId) &&
+ Objects.equals(this.type(), that.type());
}