Code Review
/
controller.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Add support for metadata to the Match/Action classes
[controller.git]
/
opendaylight
/
sal
/
api
/
src
/
main
/
java
/
org
/
opendaylight
/
controller
/
sal
/
match
/
MatchType.java
diff --git
a/opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/match/MatchType.java
b/opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/match/MatchType.java
index f4c8f4ae8039e8c18fbe35adb277de8c1db053df..800f6d5972bc257c8aecf1ad14b0d650b3797641 100644
(file)
--- a/
opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/match/MatchType.java
+++ b/
opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/match/MatchType.java
@@
-235,7
+235,7
@@
public enum MatchType {
public int hashCode(Object v, Object m) {
final int prime = 31;
int result = 1;
public int hashCode(Object v, Object m) {
final int prime = 31;
int result = 1;
- result = prime * result + this.
h
ashCode();
+ result = prime * result + this.
calculateConsistentH
ashCode();
switch (this) {
case DL_SRC:
switch (this) {
case DL_SRC:
@@
-316,4
+316,12
@@
public enum MatchType {
return (this.equalValues(value1, value2) && this.equalMasks(mask1, mask2));
}
}
return (this.equalValues(value1, value2) && this.equalMasks(mask1, mask2));
}
}
+
+ public int calculateConsistentHashCode() {
+ if (this.id != null) {
+ return this.id.hashCode();
+ } else {
+ return 0;
+ }
+ }
}
}