Skip to content

Conversation

@IdrissRio
Copy link
Contributor

@IdrissRio IdrissRio commented Sep 29, 2025

This PR fixes the FPs described in the issue linked below.

Closes: http://github.com/github/codeql-java-team/issues/425

DCA Nightly Buildless: https://github.com/github/codeql-dca-main/issues/31838
DCA Nightly: https://github.com/github/codeql-dca-main/issues/31839

@github-actions github-actions bot added the Java label Sep 29, 2025
@IdrissRio IdrissRio force-pushed the idrissrio/ql-constant branch from d66fbde to b82d8c2 Compare September 29, 2025 11:38
@IdrissRio IdrissRio marked this pull request as ready for review September 30, 2025 07:29
@IdrissRio IdrissRio requested a review from a team as a code owner September 30, 2025 07:29
Copilot AI review requested due to automatic review settings September 30, 2025 07:29
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Fixes false positives in the evaluation-to-constant query for ErrorType by adding a type check to exclude TypeAccess expressions that resolve to ErrorType. This prevents the query from incorrectly flagging unresolved types as constant expressions.

  • Added type check condition to exclude ErrorType instances from constant expression evaluation
  • Added integration test to verify the fix works correctly for unresolved types like Minecraft

Reviewed Changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated no comments.

File Description
ConstantExpAppearsNonConstant.ql Modified predicate to exclude TypeAccess expressions that resolve to ErrorType
test.py Created integration test configuration
Test.java Added test case with unresolved Minecraft type reference
ConstantExpAppearsNonConstant.qlref Added query reference for integration test

@IdrissRio IdrissRio added the no-change-note-required This PR does not need a change note label Sep 30, 2025
owen-mc
owen-mc previously approved these changes Sep 30, 2025
Copy link
Contributor

@owen-mc owen-mc left a comment

Choose a reason for hiding this comment

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

Two minor suggestions.

@IdrissRio IdrissRio merged commit fa8cbee into main Sep 30, 2025
18 checks passed
@IdrissRio IdrissRio deleted the idrissrio/ql-constant branch September 30, 2025 12:24
@aschackmull
Copy link
Contributor

Late to the party, but I see that there are a ton of new results now besides of course a lot of removed results. Are these new TPs?

@aschackmull
Copy link
Contributor

Just checked some - these definitely look like a ton of new FPs, so that's quite unfortunate. I'll put up a PR with a fix.

@aschackmull
Copy link
Contributor

Fix here: #20600

@IdrissRio
Copy link
Contributor Author

Thanks for the fix @aschackmull!

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.

4 participants