Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@mrclmh
Copy link
Contributor

@mrclmh mrclmh commented Nov 24, 2025

Describe the PR

Fixes false positives where constant foldable arguments in later positions are not recognized.

Related issues

Ready?

  • Added unit tests for fixed bug/feature
  • Passing all unit tests
  • Complete build ./mvnw clean verify passes (checked automatically by github actions)
  • Added (in-code) documentation (if needed)

Extend the check for additional parameters to also allow constant
foldable expressions.
@pmd-actions-helper
Copy link
Contributor

Documentation Preview

Compared to main:
This changeset changes 0 violations,
introduces 0 new violations, 0 new errors and 0 new configuration errors,
removes 0 violations, 0 errors and 0 configuration errors.

Regression Tester Report

(comment created at 2025-11-24 18:38:49+00:00 for 669b747)

Copy link
Member

@adangel adangel left a comment

Choose a reason for hiding this comment

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

Thanks!

@adangel adangel added this to the 7.19.0 milestone Nov 27, 2025
@adangel adangel changed the title [java] Fix #5820 GuardLogStatement recognizes that a string is a compile-time constant expression only if at first position [java] Fix #5820: GuardLogStatement recognizes that a string is a compile-time constant expression only if at first position Nov 27, 2025
@adangel adangel self-assigned this Nov 27, 2025
@adangel adangel merged commit 669b747 into pmd:main Nov 27, 2025
12 checks passed
adangel added a commit that referenced this pull request Nov 27, 2025
adangel added a commit that referenced this pull request Nov 27, 2025
…pile-time constant expression only if at first position

 (#6258)
@mrclmh mrclmh deleted the issue5820 branch November 28, 2025 14:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[java] GuardLogStatement recognizes that a string is a compile-time constant expression only if at first position

2 participants