Java: Improve inline expectations test comments#21983
Open
owen-mc wants to merge 2 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates Java inline-expectations annotations in several query tests so that previously noted “false positive” and “false negative” cases are represented using the inline-expectations mechanisms ($ SPURIOUS: and $ MISSING:), aligning the tests with the InlineExpectationsTest semantics.
Changes:
- Converted “false positive” annotations to
$ SPURIOUS:expectations across multiple Java query tests. - Converted “false negative” annotations to
$ MISSING:expectations across multiple Java query tests. - Performed minor whitespace/formatting cleanups in the touched test sources.
Show a summary per file
| File | Description |
|---|---|
| java/ql/test/query-tests/UseBraces/UseBraces.java | Updates inline expectations (including a $ MISSING: case) and cleans up formatting in the misleading-indentation test source. |
| java/ql/test/query-tests/security/CWE-311/CWE-319/HttpsUrlsTest.java | Marks a known false positive as $ SPURIOUS: and a known false negative as $ MISSING: for the non-https-url query test. |
| java/ql/test/query-tests/security/CWE-190/semmle/tests/Test.java | Marks a known false positive alert as $ SPURIOUS: for implicit-cast-in-compound-assignment. |
| java/ql/test/query-tests/security/CWE-190/semmle/tests/ArithmeticTainted.java | Marks a known false negative as $ MISSING: for tainted arithmetic. |
| java/ql/test/query-tests/security/CWE-113/semmle/tests/ResponseSplitting.java | Marks sanitizer false negatives as $ MISSING: alerts in the response-splitting test. |
| java/ql/test/query-tests/Nullness/C.java | Marks known false positive null-deref alerts as $ SPURIOUS:. |
| java/ql/test/query-tests/Nullness/B.java | Marks known false positive null-deref alerts as $ SPURIOUS: in several scenarios. |
Copilot's findings
- Files reviewed: 7/7 changed files
- Comments generated: 0
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A small follow-up to #21966 fixing some things I noticed after merging. Mostly that some tests have comments indication false positive and false negatives, which should correspond to MISSING or SPURIOUS inline expectations test comments.