Skip to content

Java: Improve inline expectations test comments#21983

Open
owen-mc wants to merge 2 commits into
github:mainfrom
owen-mc:java/convert-to-inline-expectation-tests
Open

Java: Improve inline expectations test comments#21983
owen-mc wants to merge 2 commits into
github:mainfrom
owen-mc:java/convert-to-inline-expectation-tests

Conversation

@owen-mc

@owen-mc owen-mc commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

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.

@owen-mc owen-mc added the no-change-note-required This PR does not need a change note label Jun 12, 2026
@owen-mc owen-mc requested a review from a team as a code owner June 12, 2026 20:54
Copilot AI review requested due to automatic review settings June 12, 2026 20:54
@github-actions github-actions Bot added the Java label Jun 12, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Java no-change-note-required This PR does not need a change note

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants