typetools / typetools/checker-framework

Confusing wildcard-related error with Resource Leak Checker

Open
#6,105 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

          So most of the problems went away. However, now I can see a weird one:
    [javac] Compiling 1 source file to /home/jlewandowski/dev/cassandra/c18239-static-analysis/build/checkerframework-output
    [javac] /home/jlewandowski/dev/cassandra/c18239-static-analysis/src/java/org/apache/cassandra/utils/IntervalTree.java
    [javac] /home/jlewandowski/dev/cassandra/c18239-static-analysis/src/java/org/apache/cassandra/utils/IntervalTree.java:345: error: [mustcall:bound] incompatible bounds in wildcard
    [javac]                     C min = pointSerializer.deserialize(in);
    [javac]                       ^
    [javac]   type: ?[ extends @MustCall Object super C[ extends @MustCallUnknown Comparable<?> super @MustCallUnknown Void]]
    [javac]   upper bound: @MustCall Object
    [javac]   lower bound: C[ extends @MustCallUnknown Comparable<?[ extends @MustCall Object super C]> super @MustCallUnknown Void]
    [javac] /home/jlewandowski/dev/cassandra/c18239-static-analysis/src/java/org/apache/cassandra/utils/IntervalTree.java:346: error: [mustcall:bound] incompatible bounds in wildcard
    [javac]                     C max = pointSerializer.deserialize(in);
    [javac]                       ^
    [javac]   type: ?[ extends @MustCall Object super C[ extends @MustCallUnknown Comparable<?> super @MustCallUnknown Void]]
    [javac]   upper bound: @MustCall Object
    [javac]   lower bound: C[ extends @MustCallUnknown Comparable<?[ extends @MustCall Object super C]> super @MustCallUnknown Void]
    [javac] 2 errors

That can be reproduced with the following command:

ant cf-only '-Dcf.check.only=**/IntervalTree.java'

on this branch: https://github.com/jacek-lewandowski/cassandra/tree/checker-framework-testing

Originally posted by @jacek-lewandowski in https://github.com/typetools/checker-framework/issues/6077#issuecomment-1640221392

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

Reproduce the report with ant cf-only '-Dcf.check.only=**/IntervalTree.java' on the checker-framework-testing branch. Start at src/java/org/apache/cassandra/utils/IntervalTree.java, especially lines 345–346, and investigate the Resource Leak Checker’s wildcard-bound errors. Done means the cause is explained and the checker behavior is corrected or clearly resolved.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.