Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nullness check FPs and FNs #2890

Open
JuditKnoll opened this issue Mar 4, 2024 · 0 comments
Open

Nullness check FPs and FNs #2890

JuditKnoll opened this issue Mar 4, 2024 · 0 comments

Comments

@JuditKnoll
Copy link
Collaborator

There are some problems with the Null Value Analysis.
The Ideas_2011_07_22 file tested in RegressionIdeas20110722Test shows these problems.
There should be the following buginstances found:

  • 4 RCN_REDUNDANT_NULLCHECK_WOULD_HAVE_BEEN_A_NPE
    • at getHashCode3() method line 34
    • at getHashCode4() method line 41
    • at getHashCode5() method line 48
    • at getHashCode6() method line 55
  • 2 NP_PARAMETER_MUST_BE_NONNULL_BUT_MARKED_AS_NULLABLE
    • at getHashCode6() method parameter x
    • at getHashCode7() method parameter x
  • 0 NP_NULL_ON_SOME_PATH

Instead these buginstances are found:

  • 4 NP_NULL_ON_SOME_PATH
    • at getHashCode3() method line 37
    • at getHashCode4() method line 44
    • at getHashCode5() method line 51
    • at getHashCode6() method line 58

This makes formers FNs, and the latters FPs.
RCN_REDUNDANT_NULLCHECK_WOULD_HAVE_BEEN_A_NPE and NP_NULL_ON_SOME_PATH are reported by edu.umd.cs.findbugs.detect.FindNullDeref, with the latter also being reported by edu.umd.cs.findbugs.detect.FindNullDerefsInvolvingNonShortCircuitEvaluation.
NP_PARAMETER_MUST_BE_NONNULL_BUT_MARKED_AS_NULLABLE is reported by edu.umd.cs.findbugs.detect.NoteUnconditionalParamDerefs and edu.umd.cs.findbugs.detect.InconsistentAnnotations.
All of these are connected to nullness, and I think the root cause is in IsNullValueAnalysis.

Currently it doesn't break the build, because when running the tests some classes needed for the analysis are missing, which is solved by #2840. However, analysing a simple project containing Ideas_2011_07_22 only riports the NP_NULL_ON_SOME_PATH FPs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant