Use getId() instead of accessing id directly for Identity objects.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Mon, 28 Jan 2013 21:46:03 +0000 (22:46 +0100)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Mon, 28 Jan 2013 21:46:03 +0000 (22:46 +0100)
src/main/java/net/pterodactylus/sone/freenet/wot/DefaultIdentity.java

index 176a3be..0cfb055 100644 (file)
@@ -208,7 +208,7 @@ public class DefaultIdentity implements Identity {
         */
        @Override
        public int hashCode() {
-               return id.hashCode();
+               return getId().hashCode();
        }
 
        /**
@@ -216,11 +216,11 @@ public class DefaultIdentity implements Identity {
         */
        @Override
        public boolean equals(Object object) {
-               if (!(object instanceof DefaultIdentity)) {
+               if (!(object instanceof Identity)) {
                        return false;
                }
-               DefaultIdentity identity = (DefaultIdentity) object;
-               return identity.id.equals(id);
+               Identity identity = (Identity) object;
+               return identity.getId().equals(getId());
        }
 
        /**