typetools / typetools/checker-framework

Not seeing missing method warning in stub file for an inherited method

Open
#7,069 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

We were trying to add a stub file for org.apache.log4j.Logger with an entry:

    @SideEffectFree
    public void warn(Object message, Throwable t);

It turns out warn is declared in org.apache.log4j.Category and inherited by Logger, and we need the stub to be for the Category class for this to work.

Based on the manual I would have expected to get a warning by default for this case (the stub was passed in via the -Astubs argument), but I did not. But I think a warning would be appropriate for this case, as the written stub annotations are not being processed, even though the method exists.

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 with the stub troubleshooting guidance in the Checker Framework manual and trace how the -Astubs argument handles a stub for org.apache.log4j.Logger when warn is inherited from org.apache.log4j.Category. Define the expected warning for annotations that are not processed because the declaration is on the superclass, and verify the behavior with a focused stub-file example.

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
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.