From: nickl- Date: Mon, 30 Oct 2017 04:42:35 +0000 (+0200) Subject: Implement hashCode for Type. X-Git-Tag: rel_3_23_0_ga~13^2~6 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=f536ea9fc9292811b6c151a479bab75eb2fc9d93;p=javassist.git Implement hashCode for Type. To honour the Object.equals contract. --- diff --git a/src/main/javassist/bytecode/analysis/Type.java b/src/main/javassist/bytecode/analysis/Type.java index ce02c172..9b2dc63b 100644 --- a/src/main/javassist/bytecode/analysis/Type.java +++ b/src/main/javassist/bytecode/analysis/Type.java @@ -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;