typetools / typetools/checker-framework

Warn if @DefaultQualifier is used where @DefaultQualifierInHierarchy should be used

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

Nobody has claimed this yet.

enhancement
Dominant language
Java
Stars
1.1k
Forks
440
Avg merge
1d 12h
Merged PRs (30d)
134

Description

The @DefaultQualifier and @DefaultQualifierInHierarchy annotations have very
similar names, so it is easy to misuse one where the other is necessary.

It would be good for the Checker Framework to issue an error message if
@DefaultQualifier is written on an annotation definition.

Here are two ways this could be done:

  • when compiling an annotation (@interface) definition, issue a warning if it is meta-annotated with @DefaultQualifier. This is the most direct approach, but an annotation definition is not necessarily compiled using a pluggable type-checker.

  • when using a pluggable type-checker, whenever an annotation is used, determine its meta-annotations and issue a warning if those include @DefaultQualifier.

Original issue reported on code.google.com by mer...@cs.washington.edu on 24 Mar 2014 at 4:50

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

No files, tests, or entry points are named. Start by tracing how the Checker Framework handles annotation definitions and annotation meta-annotations, then compare the two warning approaches described in the issue; done means a misuse of @DefaultQualifier where @DefaultQualifierInHierarchy is required produces an error or warning.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
compilers, devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.