uber / uber/NullAway

Contract checking does not check for proper overriding

Open
#803 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
4.1k
Forks
370
Avg merge
1d 13h
Merged PRs (30d)
68

Description

Our checking of @Contract annotations (which is off by default) does not check for correct method overriding. So, if a supertype method has a particular @Contract, we do not check that overriding methods adhere to the @Contract, which could lead to missed NPE bugs. Originally discussed here.

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 reading the @Contract checking implementation and the discussion linked in the issue, then trace how method overriding is currently analyzed. Identify the relevant tests for contract checking and add coverage showing that overriding methods must adhere to a supertype method's @Contract. Done means invalid overrides are reported and valid overrides continue to pass.

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
Active
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.