Browse Source

Implement hashCode for Annotation.

To honour the Object.equals contract.
tags/rel_3_23_0_ga
nickl- 6 years ago
parent
commit
d1b7b853c3
1 changed files with 6 additions and 0 deletions
  1. 6
    0
      src/main/javassist/bytecode/annotation/Annotation.java

+ 6
- 0
src/main/javassist/bytecode/annotation/Annotation.java View File

@@ -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.

Loading…
Cancel
Save