cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bhais...@apache.org
Subject [32/34] git commit: updated refs/heads/master to 7a57ce3
Date Mon, 15 Jun 2015 09:15:05 GMT
Fix findbugs warning HE_EQUALS_USE_HASHCODE in Ip4Address.java When overriding equals(), hashCode()
must also be overriden do comply with the directive that equal objects must have equal hashcodes
Without this implementation, usage of these kinds of objects in hashmaps for example, will
be broken

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/a670f984
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/a670f984
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/a670f984

Branch: refs/heads/master
Commit: a670f984d8651e681d2d1360b7c516517253958c
Parents: 1bd3286
Author: Rafael da Fonseca <rsafonseca@gmail.com>
Authored: Sun Jun 14 18:22:39 2015 +0200
Committer: Rohit Yadav <rohit.yadav@shapeblue.com>
Committed: Mon Jun 15 12:10:07 2015 +0300

----------------------------------------------------------------------
 utils/src/com/cloud/utils/net/Ip4Address.java | 4 ++++
 1 file changed, 4 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a670f984/utils/src/com/cloud/utils/net/Ip4Address.java
----------------------------------------------------------------------
diff --git a/utils/src/com/cloud/utils/net/Ip4Address.java b/utils/src/com/cloud/utils/net/Ip4Address.java
index b336d9d..663e44e 100644
--- a/utils/src/com/cloud/utils/net/Ip4Address.java
+++ b/utils/src/com/cloud/utils/net/Ip4Address.java
@@ -64,4 +64,8 @@ public class Ip4Address {
             return false;
         }
     }
+    @Override
+    public int hashCode(){
+        return (int)(_mac.hashCode()*_addr.hashCode());
+    }~
 }


Mime
View raw message