typetools / typetools/checker-framework
Fix .equals and .hashcode of AnnotationMirrors built with AnnotationBuilder
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 1.1k
- Forks
- 440
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 134
Description
The framework uses both our AnnotationMirror class and javac's AnnotationMirror. These two classes are not comparable, so we cannot write a useful equals method. (Our AnnotationMirror class is an anonymous class in AnnotationBuilder.build() (line 103 currently)
However, equals and hashcode are erroneously used in the Checker Framework, so both methods should throw an exception, and the Javadocs should point to the AnnotationUtils.areSame and other such utility methods.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the anonymous AnnotationMirror class in AnnotationBuilder.build(), currently around line 103, and inspect its equals, hashCode, and Javadocs. Review AnnotationUtils.areSame and the other utility methods referenced by the issue. The work is done when both methods throw an exception and the Javadocs direct users to those utilities.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100