Java: document nullness false negative as qltest#20171
Java: document nullness false negative as qltest#20171aschackmull merged 1 commit intogithub:mainfrom
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR documents a false negative in the nullness analysis by adding two test cases to the Java test suite. The issue involves correlated conditions logic not properly accounting for loops, where control flow can iterate and create scenarios where null pointer exceptions should be detected but aren't.
- Adds test cases demonstrating false negative behavior in nullness analysis within loops
- Documents the difference between loop-scoped and iteration-scoped variable behavior
Comments suppressed due to low confidence (2)
java/ql/test/query-tests/Nullness/B.java:412
- [nitpick] The parameter name 'a' is not descriptive. Consider renaming it to 'conditions' or 'flags' to better indicate its purpose in testing correlated conditions.
public void corrCondLoop1(boolean a[]) {
java/ql/test/query-tests/Nullness/B.java:426
- [nitpick] The parameter name 'a' is not descriptive. Consider renaming it to 'conditions' or 'flags' to be consistent with the test's purpose.
public void corrCondLoop2(boolean a[]) {
hvitved
left a comment
There was a problem hiding this comment.
I would have expected some changes to a .expected file?
It's not an inline expectations test, and the two new cases are FN and TN, resp., so that means no |
Ah, yes, I mistakenly read the second example as a TP. |
The correlated conditions logic doesn't properly account for loops.