Skip to content

Conversation

@aschackmull
Copy link
Contributor

The fix in #20546 was slightly buggy - the introduced negation also appeared in a negated context, so it accidentally introduced a bunch of new FPs. This PR moves the filter, so it only removes results without introducing new ones.

Copilot AI review requested due to automatic review settings October 8, 2025 08:35
@aschackmull aschackmull requested a review from a team as a code owner October 8, 2025 08:35
@aschackmull aschackmull added the no-change-note-required This PR does not need a change note label Oct 8, 2025
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

This PR fixes a bug in the CodeQL query ConstantExpAppearsNonConstant where a previous fix accidentally introduced false positives. The change moves a filter condition from within the predicate definition to the main query's where clause to ensure it only removes problematic results without creating new ones.

  • Moved the ErrorType filter from the isConstantExp predicate to the main query where clause
  • This prevents the negation from appearing in a negated context, which was causing false positives

@github-actions github-actions bot added the Java label Oct 8, 2025
Copy link
Contributor

@IdrissRio IdrissRio left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks :)

@aschackmull aschackmull merged commit 2d9b249 into github:main Oct 8, 2025
18 checks passed
@aschackmull aschackmull deleted the java/constant-exp-fix branch October 8, 2025 09:40
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