X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fsal%2Fapi%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fsal%2Fcore%2FTimeStamp.java;h=a15b3fa9cd10166b3179e163c80b5de7f50170ba;hp=6b2467ee5daa6f496787fcdfd3ac83e21df098ca;hb=9b088e9db8851370d64e1b82725a2da15d43d58b;hpb=771dea2b9c38cd8bd74ef56ecbdbe6143b60cecf diff --git a/opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/core/TimeStamp.java b/opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/core/TimeStamp.java index 6b2467ee5d..a15b3fa9cd 100644 --- a/opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/core/TimeStamp.java +++ b/opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/core/TimeStamp.java @@ -12,9 +12,6 @@ package org.opendaylight.controller.sal.core; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; - /** * @file TimeStamp.java * @@ -74,12 +71,31 @@ public class TimeStamp extends Property { @Override public int hashCode() { - return HashCodeBuilder.reflectionHashCode(this); + final int prime = 31; + int result = super.hashCode(); + result = prime * result + (int) (timestamp ^ (timestamp >>> 32)); + result = prime * result + + ((timestampName == null) ? 0 : timestampName.hashCode()); + return result; } @Override public boolean equals(Object obj) { - return EqualsBuilder.reflectionEquals(this, obj); + if (this == obj) + return true; + if (!super.equals(obj)) + return false; + if (getClass() != obj.getClass()) + return false; + TimeStamp other = (TimeStamp) obj; + if (timestamp != other.timestamp) + return false; + if (timestampName == null) { + if (other.timestampName != null) + return false; + } else if (!timestampName.equals(other.timestampName)) + return false; + return true; } @Override