diff options
author | nickl- <github@jigsoft.co.za> | 2017-10-30 06:28:52 +0200 |
---|---|---|
committer | nickl- <github@jigsoft.co.za> | 2017-10-30 06:28:52 +0200 |
commit | 049879f90350a37eb64d2dd04087fdf47a5ceddf (patch) | |
tree | 1f8bed6cc5e416dd1ad9cb52bbeb13788dffd509 | |
parent | e141a58af0f72df5d8f6a685b55963b5f2f044dc (diff) | |
download | javassist-049879f90350a37eb64d2dd04087fdf47a5ceddf.tar.gz javassist-049879f90350a37eb64d2dd04087fdf47a5ceddf.zip |
Implement hashCode for MultiType.
To honour the Object.equals contract.
-rw-r--r-- | src/main/javassist/bytecode/analysis/MultiType.java | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/main/javassist/bytecode/analysis/MultiType.java b/src/main/javassist/bytecode/analysis/MultiType.java index 7baa661a..378b8d03 100644 --- a/src/main/javassist/bytecode/analysis/MultiType.java +++ b/src/main/javassist/bytecode/analysis/MultiType.java @@ -281,6 +281,14 @@ public class MultiType extends Type { return resolved; } + + @Override + public int hashCode() { + if (resolved != null) + return resolved.hashCode(); + + return interfaces.keySet().hashCode(); + } public boolean equals(Object o) { if (! (o instanceof MultiType)) |