X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fadsal%2Fhosttracker_new%2Fapi%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fhosttracker%2FEntity.java;h=f10c116755d06f3f4abedc1900e01a38449a6ace;hb=4a34b09f1bc3500e5722ee1e4dee0da05acf6a4c;hp=64f4c7ef1e1d65bddcafd7310dccfe6b44278741;hpb=5355c84eec599e751411e9e6a43e2be6e92f77d6;p=controller.git diff --git a/opendaylight/adsal/hosttracker_new/api/src/main/java/org/opendaylight/controller/hosttracker/Entity.java b/opendaylight/adsal/hosttracker_new/api/src/main/java/org/opendaylight/controller/hosttracker/Entity.java index 64f4c7ef1e..f10c116755 100644 --- a/opendaylight/adsal/hosttracker_new/api/src/main/java/org/opendaylight/controller/hosttracker/Entity.java +++ b/opendaylight/adsal/hosttracker_new/api/src/main/java/org/opendaylight/controller/hosttracker/Entity.java @@ -165,8 +165,9 @@ public class Entity implements Comparable { public void setLastSeenTimestamp(Date lastSeenTimestamp) { if (activeSince == null || (activeSince.getTime() + ACTIVITY_TIMEOUT) < lastSeenTimestamp - .getTime()) + .getTime()) { this.activeSince = lastSeenTimestamp; + } this.lastSeenTimestamp = lastSeenTimestamp; } @@ -180,8 +181,9 @@ public class Entity implements Comparable { @Override public int hashCode() { - if (hashCode != 0) + if (hashCode != 0) { return hashCode; + } final int prime = 31; hashCode = 1; hashCode = prime * hashCode @@ -194,30 +196,40 @@ public class Entity implements Comparable { @Override public boolean equals(Object obj) { - if (this == obj) + if (this == obj) { return true; - if (obj == null) + } + if (obj == null) { return false; - if (getClass() != obj.getClass()) + } + if (getClass() != obj.getClass()) { return false; + } Entity other = (Entity) obj; if (ipv4Address == null) { - if (other.ipv4Address != null) + if (other.ipv4Address != null) { return false; - } else if (!ipv4Address.equals(other.ipv4Address)) + } + } else if (!ipv4Address.equals(other.ipv4Address)) { return false; - if (macAddress != other.macAddress) + } + if (macAddress != other.macAddress) { return false; + } if (port == null) { - if (other.port != null) + if (other.port != null) { return false; - } else if (!port.equals(other.port)) + } + } else if (!port.equals(other.port)) { return false; + } if (vlan == null) { - if (other.vlan != null) + if (other.vlan != null) { return false; - } else if (!vlan.equals(other.vlan)) + } + } else if (!vlan.equals(other.vlan)) { return false; + } return true; } @@ -257,8 +269,9 @@ public class Entity implements Comparable { Comparable switchId = (Comparable) port.getNode().getID(); Comparable oswitchId = (Comparable) o.port.getNode().getID(); r = switchId.compareTo(oswitchId); - if (r != 0) + if (r != 0) { return r; + } Comparable portId = (Comparable) port.getID(); Comparable oportId = (Comparable) o.port.getID();