diff options
author | nickl- <github@jigsoft.co.za> | 2017-10-30 06:50:20 +0200 |
---|---|---|
committer | nickl- <github@jigsoft.co.za> | 2017-10-30 06:50:20 +0200 |
commit | d1b7b853c3f9d64b8b68580d9b8ae12c7ed18418 (patch) | |
tree | 325961d4a8a7809976294d3246b91916465cd319 /src | |
parent | f536ea9fc9292811b6c151a479bab75eb2fc9d93 (diff) | |
download | javassist-d1b7b853c3f9d64b8b68580d9b8ae12c7ed18418.tar.gz javassist-d1b7b853c3f9d64b8b68580d9b8ae12c7ed18418.zip |
Implement hashCode for Annotation.
To honour the Object.equals contract.
Diffstat (limited to 'src')
-rw-r--r-- | src/main/javassist/bytecode/annotation/Annotation.java | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/main/javassist/bytecode/annotation/Annotation.java b/src/main/javassist/bytecode/annotation/Annotation.java index 10ceb8ee..d19f6f56 100644 --- a/src/main/javassist/bytecode/annotation/Annotation.java +++ b/src/main/javassist/bytecode/annotation/Annotation.java @@ -331,6 +331,12 @@ public class Annotation { } } + @Override + public int hashCode() { + return getTypeName().hashCode() + + (members == null ? 0 : members.hashCode()); + } + /** * Returns true if the given object represents the same annotation * as this object. The equality test checks the member values. |