Equals and Hash code fix for byte array.
Change-Id: I0a49d1f0e3193e3bf49376e9c6041c139f0f794b
diff --git a/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/ISISAreaIdentifierTlv.java b/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/ISISAreaIdentifierTlv.java
index 648dbb6..f9fb4f8 100644
--- a/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/ISISAreaIdentifierTlv.java
+++ b/protocols/pcep/pcepio/src/main/java/org/onosproject/pcepio/types/ISISAreaIdentifierTlv.java
@@ -15,6 +15,7 @@
*/
package org.onosproject.pcepio.types;
+import java.util.Arrays;
import java.util.Objects;
import org.jboss.netty.buffer.ChannelBuffer;
@@ -100,7 +101,7 @@
@Override
public int hashCode() {
- return Objects.hash(rawValue);
+ return Objects.hash(Arrays.hashCode(rawValue), rawValue.length);
}
@Override
@@ -110,7 +111,7 @@
}
if (obj instanceof ISISAreaIdentifierTlv) {
ISISAreaIdentifierTlv other = (ISISAreaIdentifierTlv) obj;
- return Objects.equals(hLength, other.hLength) && Objects.equals(rawValue, other.rawValue);
+ return Objects.equals(hLength, other.hLength) && Arrays.equals(rawValue, other.rawValue);
}
return false;
}