Committed by
Gerrit Code Review
Equals and Hash code fix for byte array.
Change-Id: I0a49d1f0e3193e3bf49376e9c6041c139f0f794b
Showing
1 changed file
with
3 additions
and
2 deletions
| ... | @@ -15,6 +15,7 @@ | ... | @@ -15,6 +15,7 @@ |
| 15 | */ | 15 | */ |
| 16 | package org.onosproject.pcepio.types; | 16 | package org.onosproject.pcepio.types; |
| 17 | 17 | ||
| 18 | +import java.util.Arrays; | ||
| 18 | import java.util.Objects; | 19 | import java.util.Objects; |
| 19 | 20 | ||
| 20 | import org.jboss.netty.buffer.ChannelBuffer; | 21 | import org.jboss.netty.buffer.ChannelBuffer; |
| ... | @@ -100,7 +101,7 @@ public class ISISAreaIdentifierTlv implements PcepValueType { | ... | @@ -100,7 +101,7 @@ public class ISISAreaIdentifierTlv implements PcepValueType { |
| 100 | 101 | ||
| 101 | @Override | 102 | @Override |
| 102 | public int hashCode() { | 103 | public int hashCode() { |
| 103 | - return Objects.hash(rawValue); | 104 | + return Objects.hash(Arrays.hashCode(rawValue), rawValue.length); |
| 104 | } | 105 | } |
| 105 | 106 | ||
| 106 | @Override | 107 | @Override |
| ... | @@ -110,7 +111,7 @@ public class ISISAreaIdentifierTlv implements PcepValueType { | ... | @@ -110,7 +111,7 @@ public class ISISAreaIdentifierTlv implements PcepValueType { |
| 110 | } | 111 | } |
| 111 | if (obj instanceof ISISAreaIdentifierTlv) { | 112 | if (obj instanceof ISISAreaIdentifierTlv) { |
| 112 | ISISAreaIdentifierTlv other = (ISISAreaIdentifierTlv) obj; | 113 | ISISAreaIdentifierTlv other = (ISISAreaIdentifierTlv) obj; |
| 113 | - return Objects.equals(hLength, other.hLength) && Objects.equals(rawValue, other.rawValue); | 114 | + return Objects.equals(hLength, other.hLength) && Arrays.equals(rawValue, other.rawValue); |
| 114 | } | 115 | } |
| 115 | return false; | 116 | return false; |
| 116 | } | 117 | } | ... | ... |
-
Please register or login to post a comment