]> source.dussan.org Git - javassist.git/commitdiff
Implement hashCode for Type.
authornickl- <github@jigsoft.co.za>
Mon, 30 Oct 2017 04:42:35 +0000 (06:42 +0200)
committernickl- <github@jigsoft.co.za>
Mon, 30 Oct 2017 04:42:35 +0000 (06:42 +0200)
To honour the Object.equals contract.

src/main/javassist/bytecode/analysis/Type.java

index ce02c172dd7b3c88e2479b9f20f38c19ea04e987..9b2dc63b4b30c6bc026f80fc5405da77aacc1ede 100644 (file)
@@ -567,6 +567,11 @@ public class Type {
         return map;
     }
 
+    @Override
+    public int hashCode() {
+        return getClass().hashCode() + clazz.hashCode();
+    }
+
     public boolean equals(Object o) {
         if (! (o instanceof Type))
             return false;