Menu

#1390 NP_PARAMETER_MUST_BE_NONNULL_BUT_MARKED_AS_NULLABLE false positive

3.0.1
closed-rejected
nobody
None
5
2017-10-22
2015-06-21
No

Repro steps:

  1. Create a subclass of java.util.concurrent.CountedCompleter.
  2. Have the constructor invoke: "super(null)" which is legal according to the Javadoc
  3. Findbugs will flag super(null) with NP_PARAMETER_MUST_BE_NONNULL_BUT_MARKED_AS_NULLABLE

Discussion

  • Gili Tzabari

    Gili Tzabari - 2015-06-21

    For step 2, the constructor should look like this:

    public CandidateToFitnessComputer(@Nullable CandidateToFitnessComputer<c, f=""> parent)
    {
    super(parent);
    }</c,>

    Meaning, "parent" is tagged as @Nullable but Findbugs complains that it must be non-null.

     
  • Andrey Loskutov

    Andrey Loskutov - 2017-10-22
    • Status: open --> closed-rejected
     

Log in to post a comment.

Auth0 Logo