typetools / typetools/checker-framework

Fix .equals and .hashcode of AnnotationMirrors built with AnnotationBuilder

Open
#492 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.