Committed by
Gerrit Code Review
ONOS-1746 Fixed hashCode implementation to be immune from non-deterministic enum hashCode.
Change-Id: I96d0a7850ee28d62b1152c4fee4f4ce7648c4931
Showing
28 changed files
with
32 additions
and
32 deletions
... | @@ -62,7 +62,7 @@ public final class EthCriterion implements Criterion { | ... | @@ -62,7 +62,7 @@ public final class EthCriterion implements Criterion { |
62 | 62 | ||
63 | @Override | 63 | @Override |
64 | public int hashCode() { | 64 | public int hashCode() { |
65 | - return Objects.hash(type, mac); | 65 | + return Objects.hash(type.ordinal(), mac); |
66 | } | 66 | } |
67 | 67 | ||
68 | @Override | 68 | @Override | ... | ... |
... | @@ -59,7 +59,7 @@ public final class EthTypeCriterion implements Criterion { | ... | @@ -59,7 +59,7 @@ public final class EthTypeCriterion implements Criterion { |
59 | 59 | ||
60 | @Override | 60 | @Override |
61 | public int hashCode() { | 61 | public int hashCode() { |
62 | - return Objects.hash(type(), ethType); | 62 | + return Objects.hash(type().ordinal(), ethType); |
63 | } | 63 | } |
64 | 64 | ||
65 | @Override | 65 | @Override | ... | ... |
... | @@ -62,7 +62,7 @@ public final class IPCriterion implements Criterion { | ... | @@ -62,7 +62,7 @@ public final class IPCriterion implements Criterion { |
62 | 62 | ||
63 | @Override | 63 | @Override |
64 | public int hashCode() { | 64 | public int hashCode() { |
65 | - return Objects.hash(type, ip); | 65 | + return Objects.hash(type().ordinal(), ip); |
66 | } | 66 | } |
67 | 67 | ||
68 | @Override | 68 | @Override | ... | ... |
... | @@ -58,7 +58,7 @@ public final class IPDscpCriterion implements Criterion { | ... | @@ -58,7 +58,7 @@ public final class IPDscpCriterion implements Criterion { |
58 | 58 | ||
59 | @Override | 59 | @Override |
60 | public int hashCode() { | 60 | public int hashCode() { |
61 | - return Objects.hash(type(), ipDscp); | 61 | + return Objects.hash(type().ordinal(), ipDscp); |
62 | } | 62 | } |
63 | 63 | ||
64 | @Override | 64 | @Override | ... | ... |
... | @@ -58,7 +58,7 @@ public final class IPEcnCriterion implements Criterion { | ... | @@ -58,7 +58,7 @@ public final class IPEcnCriterion implements Criterion { |
58 | 58 | ||
59 | @Override | 59 | @Override |
60 | public int hashCode() { | 60 | public int hashCode() { |
61 | - return Objects.hash(type(), ipEcn); | 61 | + return Objects.hash(type().ordinal(), ipEcn); |
62 | } | 62 | } |
63 | 63 | ||
64 | @Override | 64 | @Override | ... | ... |
... | @@ -59,7 +59,7 @@ public final class IPProtocolCriterion implements Criterion { | ... | @@ -59,7 +59,7 @@ public final class IPProtocolCriterion implements Criterion { |
59 | 59 | ||
60 | @Override | 60 | @Override |
61 | public int hashCode() { | 61 | public int hashCode() { |
62 | - return Objects.hash(type(), proto); | 62 | + return Objects.hash(type().ordinal(), proto); |
63 | } | 63 | } |
64 | 64 | ||
65 | @Override | 65 | @Override | ... | ... |
... | @@ -60,7 +60,7 @@ public final class IPv6ExthdrFlagsCriterion implements Criterion { | ... | @@ -60,7 +60,7 @@ public final class IPv6ExthdrFlagsCriterion implements Criterion { |
60 | 60 | ||
61 | @Override | 61 | @Override |
62 | public int hashCode() { | 62 | public int hashCode() { |
63 | - return Objects.hash(type(), exthdrFlags); | 63 | + return Objects.hash(type().ordinal(), exthdrFlags); |
64 | } | 64 | } |
65 | 65 | ||
66 | @Override | 66 | @Override | ... | ... |
... | @@ -58,7 +58,7 @@ public final class IPv6FlowLabelCriterion implements Criterion { | ... | @@ -58,7 +58,7 @@ public final class IPv6FlowLabelCriterion implements Criterion { |
58 | 58 | ||
59 | @Override | 59 | @Override |
60 | public int hashCode() { | 60 | public int hashCode() { |
61 | - return Objects.hash(type(), flowLabel); | 61 | + return Objects.hash(type().ordinal(), flowLabel); |
62 | } | 62 | } |
63 | 63 | ||
64 | @Override | 64 | @Override | ... | ... |
... | @@ -62,7 +62,7 @@ public final class IPv6NDLinkLayerAddressCriterion implements Criterion { | ... | @@ -62,7 +62,7 @@ public final class IPv6NDLinkLayerAddressCriterion implements Criterion { |
62 | 62 | ||
63 | @Override | 63 | @Override |
64 | public int hashCode() { | 64 | public int hashCode() { |
65 | - return Objects.hash(type, mac); | 65 | + return Objects.hash(type().ordinal(), mac); |
66 | } | 66 | } |
67 | 67 | ||
68 | @Override | 68 | @Override | ... | ... |
... | @@ -58,7 +58,7 @@ public final class IPv6NDTargetAddressCriterion implements Criterion { | ... | @@ -58,7 +58,7 @@ public final class IPv6NDTargetAddressCriterion implements Criterion { |
58 | 58 | ||
59 | @Override | 59 | @Override |
60 | public int hashCode() { | 60 | public int hashCode() { |
61 | - return Objects.hash(type(), targetAddress); | 61 | + return Objects.hash(type().ordinal(), targetAddress); |
62 | } | 62 | } |
63 | 63 | ||
64 | @Override | 64 | @Override | ... | ... |
... | @@ -57,7 +57,7 @@ public final class IcmpCodeCriterion implements Criterion { | ... | @@ -57,7 +57,7 @@ public final class IcmpCodeCriterion implements Criterion { |
57 | 57 | ||
58 | @Override | 58 | @Override |
59 | public int hashCode() { | 59 | public int hashCode() { |
60 | - return Objects.hash(type(), icmpCode); | 60 | + return Objects.hash(type().ordinal(), icmpCode); |
61 | } | 61 | } |
62 | 62 | ||
63 | @Override | 63 | @Override | ... | ... |
... | @@ -57,7 +57,7 @@ public final class IcmpTypeCriterion implements Criterion { | ... | @@ -57,7 +57,7 @@ public final class IcmpTypeCriterion implements Criterion { |
57 | 57 | ||
58 | @Override | 58 | @Override |
59 | public int hashCode() { | 59 | public int hashCode() { |
60 | - return Objects.hash(type(), icmpType); | 60 | + return Objects.hash(type().ordinal(), icmpType); |
61 | } | 61 | } |
62 | 62 | ||
63 | @Override | 63 | @Override | ... | ... |
... | @@ -57,7 +57,7 @@ public final class Icmpv6CodeCriterion implements Criterion { | ... | @@ -57,7 +57,7 @@ public final class Icmpv6CodeCriterion implements Criterion { |
57 | 57 | ||
58 | @Override | 58 | @Override |
59 | public int hashCode() { | 59 | public int hashCode() { |
60 | - return Objects.hash(type(), icmpv6Code); | 60 | + return Objects.hash(type().ordinal(), icmpv6Code); |
61 | } | 61 | } |
62 | 62 | ||
63 | @Override | 63 | @Override | ... | ... |
... | @@ -57,7 +57,7 @@ public final class Icmpv6TypeCriterion implements Criterion { | ... | @@ -57,7 +57,7 @@ public final class Icmpv6TypeCriterion implements Criterion { |
57 | 57 | ||
58 | @Override | 58 | @Override |
59 | public int hashCode() { | 59 | public int hashCode() { |
60 | - return Objects.hash(type(), icmpv6Type); | 60 | + return Objects.hash(type().ordinal(), icmpv6Type); |
61 | } | 61 | } |
62 | 62 | ||
63 | @Override | 63 | @Override | ... | ... |
... | @@ -56,7 +56,7 @@ public class IndexedLambdaCriterion implements Criterion { | ... | @@ -56,7 +56,7 @@ public class IndexedLambdaCriterion implements Criterion { |
56 | 56 | ||
57 | @Override | 57 | @Override |
58 | public int hashCode() { | 58 | public int hashCode() { |
59 | - return Objects.hash(lambda); | 59 | + return Objects.hash(type().ordinal(), lambda); |
60 | } | 60 | } |
61 | 61 | ||
62 | @Override | 62 | @Override | ... | ... |
... | @@ -62,7 +62,7 @@ public final class LambdaCriterion implements Criterion { | ... | @@ -62,7 +62,7 @@ public final class LambdaCriterion implements Criterion { |
62 | 62 | ||
63 | @Override | 63 | @Override |
64 | public int hashCode() { | 64 | public int hashCode() { |
65 | - return Objects.hash(type, lambda); | 65 | + return Objects.hash(type().ordinal(), lambda); |
66 | } | 66 | } |
67 | 67 | ||
68 | @Override | 68 | @Override | ... | ... |
... | @@ -57,7 +57,7 @@ public final class MetadataCriterion implements Criterion { | ... | @@ -57,7 +57,7 @@ public final class MetadataCriterion implements Criterion { |
57 | 57 | ||
58 | @Override | 58 | @Override |
59 | public int hashCode() { | 59 | public int hashCode() { |
60 | - return Objects.hash(type(), metadata); | 60 | + return Objects.hash(type().ordinal(), metadata); |
61 | } | 61 | } |
62 | 62 | ||
63 | @Override | 63 | @Override | ... | ... |
... | @@ -49,7 +49,7 @@ public final class MplsCriterion implements Criterion { | ... | @@ -49,7 +49,7 @@ public final class MplsCriterion implements Criterion { |
49 | 49 | ||
50 | @Override | 50 | @Override |
51 | public int hashCode() { | 51 | public int hashCode() { |
52 | - return Objects.hash(type(), mplsLabel); | 52 | + return Objects.hash(type().ordinal(), mplsLabel); |
53 | } | 53 | } |
54 | 54 | ||
55 | @Override | 55 | @Override | ... | ... |
... | @@ -57,7 +57,7 @@ public final class OchSignalCriterion implements Criterion { | ... | @@ -57,7 +57,7 @@ public final class OchSignalCriterion implements Criterion { |
57 | 57 | ||
58 | @Override | 58 | @Override |
59 | public int hashCode() { | 59 | public int hashCode() { |
60 | - return Objects.hash(lambda); | 60 | + return Objects.hash(type().ordinal(), lambda); |
61 | } | 61 | } |
62 | 62 | ||
63 | @Override | 63 | @Override | ... | ... |
... | @@ -54,7 +54,7 @@ public class OchSignalTypeCriterion implements Criterion { | ... | @@ -54,7 +54,7 @@ public class OchSignalTypeCriterion implements Criterion { |
54 | 54 | ||
55 | @Override | 55 | @Override |
56 | public int hashCode() { | 56 | public int hashCode() { |
57 | - return Objects.hash(signalType); | 57 | + return Objects.hash(type().ordinal(), signalType); |
58 | } | 58 | } |
59 | 59 | ||
60 | @Override | 60 | @Override | ... | ... |
... | @@ -62,7 +62,7 @@ public final class OpticalSignalTypeCriterion implements Criterion { | ... | @@ -62,7 +62,7 @@ public final class OpticalSignalTypeCriterion implements Criterion { |
62 | 62 | ||
63 | @Override | 63 | @Override |
64 | public int hashCode() { | 64 | public int hashCode() { |
65 | - return Objects.hash(type, signalType); | 65 | + return Objects.hash(type().ordinal(), signalType); |
66 | } | 66 | } |
67 | 67 | ||
68 | @Override | 68 | @Override | ... | ... |
... | @@ -62,7 +62,7 @@ public final class PortCriterion implements Criterion { | ... | @@ -62,7 +62,7 @@ public final class PortCriterion implements Criterion { |
62 | 62 | ||
63 | @Override | 63 | @Override |
64 | public int hashCode() { | 64 | public int hashCode() { |
65 | - return Objects.hash(type(), port); | 65 | + return Objects.hash(type().ordinal(), port); |
66 | } | 66 | } |
67 | 67 | ||
68 | @Override | 68 | @Override | ... | ... |
... | @@ -61,7 +61,7 @@ public final class SctpPortCriterion implements Criterion { | ... | @@ -61,7 +61,7 @@ public final class SctpPortCriterion implements Criterion { |
61 | 61 | ||
62 | @Override | 62 | @Override |
63 | public int hashCode() { | 63 | public int hashCode() { |
64 | - return Objects.hash(type, sctpPort); | 64 | + return Objects.hash(type().ordinal(), sctpPort); |
65 | } | 65 | } |
66 | 66 | ||
67 | @Override | 67 | @Override | ... | ... |
... | @@ -61,7 +61,7 @@ public final class TcpPortCriterion implements Criterion { | ... | @@ -61,7 +61,7 @@ public final class TcpPortCriterion implements Criterion { |
61 | 61 | ||
62 | @Override | 62 | @Override |
63 | public int hashCode() { | 63 | public int hashCode() { |
64 | - return Objects.hash(type, tcpPort); | 64 | + return Objects.hash(type().ordinal(), tcpPort); |
65 | } | 65 | } |
66 | 66 | ||
67 | @Override | 67 | @Override | ... | ... |
... | @@ -61,7 +61,7 @@ public final class UdpPortCriterion implements Criterion { | ... | @@ -61,7 +61,7 @@ public final class UdpPortCriterion implements Criterion { |
61 | 61 | ||
62 | @Override | 62 | @Override |
63 | public int hashCode() { | 63 | public int hashCode() { |
64 | - return Objects.hash(type, udpPort); | 64 | + return Objects.hash(type().ordinal(), udpPort); |
65 | } | 65 | } |
66 | 66 | ||
67 | @Override | 67 | @Override | ... | ... |
... | @@ -58,7 +58,7 @@ public final class VlanIdCriterion implements Criterion { | ... | @@ -58,7 +58,7 @@ public final class VlanIdCriterion implements Criterion { |
58 | 58 | ||
59 | @Override | 59 | @Override |
60 | public int hashCode() { | 60 | public int hashCode() { |
61 | - return Objects.hash(type(), vlanId); | 61 | + return Objects.hash(type().ordinal(), vlanId); |
62 | } | 62 | } |
63 | 63 | ||
64 | @Override | 64 | @Override | ... | ... |
... | @@ -57,7 +57,7 @@ public final class VlanPcpCriterion implements Criterion { | ... | @@ -57,7 +57,7 @@ public final class VlanPcpCriterion implements Criterion { |
57 | 57 | ||
58 | @Override | 58 | @Override |
59 | public int hashCode() { | 59 | public int hashCode() { |
60 | - return Objects.hash(type(), vlanPcp); | 60 | + return Objects.hash(type().ordinal(), vlanPcp); |
61 | } | 61 | } |
62 | 62 | ||
63 | @Override | 63 | @Override | ... | ... |
... | @@ -352,7 +352,7 @@ public final class Instructions { | ... | @@ -352,7 +352,7 @@ public final class Instructions { |
352 | 352 | ||
353 | @Override | 353 | @Override |
354 | public int hashCode() { | 354 | public int hashCode() { |
355 | - return Objects.hash(type()); | 355 | + return Objects.hash(type().ordinal()); |
356 | } | 356 | } |
357 | 357 | ||
358 | @Override | 358 | @Override |
... | @@ -393,7 +393,7 @@ public final class Instructions { | ... | @@ -393,7 +393,7 @@ public final class Instructions { |
393 | 393 | ||
394 | @Override | 394 | @Override |
395 | public int hashCode() { | 395 | public int hashCode() { |
396 | - return Objects.hash(type(), port); | 396 | + return Objects.hash(type().ordinal(), port); |
397 | } | 397 | } |
398 | 398 | ||
399 | @Override | 399 | @Override |
... | @@ -437,7 +437,7 @@ public final class Instructions { | ... | @@ -437,7 +437,7 @@ public final class Instructions { |
437 | 437 | ||
438 | @Override | 438 | @Override |
439 | public int hashCode() { | 439 | public int hashCode() { |
440 | - return Objects.hash(type(), groupId); | 440 | + return Objects.hash(type().ordinal(), groupId); |
441 | } | 441 | } |
442 | 442 | ||
443 | @Override | 443 | @Override |
... | @@ -481,7 +481,7 @@ public final class Instructions { | ... | @@ -481,7 +481,7 @@ public final class Instructions { |
481 | 481 | ||
482 | @Override | 482 | @Override |
483 | public int hashCode() { | 483 | public int hashCode() { |
484 | - return Objects.hash(type(), tableId); | 484 | + return Objects.hash(type().ordinal(), tableId); |
485 | } | 485 | } |
486 | 486 | ||
487 | @Override | 487 | @Override |
... | @@ -533,7 +533,7 @@ public final class Instructions { | ... | @@ -533,7 +533,7 @@ public final class Instructions { |
533 | 533 | ||
534 | @Override | 534 | @Override |
535 | public int hashCode() { | 535 | public int hashCode() { |
536 | - return Objects.hash(type(), metadata, metadataMask); | 536 | + return Objects.hash(type().ordinal(), metadata, metadataMask); |
537 | } | 537 | } |
538 | 538 | ||
539 | @Override | 539 | @Override | ... | ... |
-
Please register or login to post a comment