typetools / typetools/checker-framework

Fenum Checker: disallow invocation of comparisons methods with mixed types

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

Nobody has claimed this yet.

False Negative (missing warning or unsoundness)
Dominant language
Java
Stars
1.1k
Forks
440
Avg merge
1d 12h
Merged PRs (30d)
134

Description

Disallow invocation of comparisons methods with mixed types. For example, the type of the receiver and the parameter to equals should have the same fenum qualifier.

@Fenum(A) Integer a;
@Fenum(A) Integer a2;
@Fenum(B) Integer b;
@FenumUnqualified Integer u;
a.equals(u); // error
a.equals(b); // error
a.equals(a2); // ok
a.hashCode(); // ok

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 by locating the Fenum checker and its handling of equals, comparison methods, and hashCode; the issue examples define the expected cases. Add or update checker tests so mixed Fenum qualifiers are rejected, matching qualifiers are accepted, and hashCode remains allowed. Done means these examples are checked consistently.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.