Skip to content

[java] #4730: Add a test for FinalFieldCouldBeStatic that shows that #4730 was already fixed - #6842

Merged
adangel merged 1 commit into
pmd:mainfrom
UncleOwen:issue-4730-FinalFieldCouldBeStatic-FP-with-lombok-@Default
Jul 13, 2026
Merged

adangel merged 1 commit into
pmd:mainfrom
UncleOwen:issue-4730-FinalFieldCouldBeStatic-FP-with-lombok-@Default

Conversation

@UncleOwen

@UncleOwen UncleOwen commented Jul 4, 2026 •

Copy link
Copy Markdown
Member

Describe the PR

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)
  • [n/a] Added (in-code) documentation (if needed)

This test needs to be able to import lombok, so I added lombok to the
test dependencies.
@pmd-actions-helper

Copy link
Copy Markdown
Contributor

Documentation Preview

No relevant source code has been changed, pmdtester skipped.

(comment created at 2026-07-04 20:38:39+00:00 for 72ce976)

@adangel adangel changed the title [java] #4730: Add a test that shows that #4730 was already fixed. [java] #4730: Add a test that shows that #4730 was already fixed Jul 13, 2026
@adangel adangel added this to the 7.27.0 milestone Jul 13, 2026
@adangel adangel changed the title [java] #4730: Add a test that shows that #4730 was already fixed [java] #4730: Add a test for FinalFieldCouldBeStatic that shows that #4730 was already fixed Jul 13, 2026

@adangel adangel left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good!

this was fixed sometime between 6.55.0 and 7.0.0. I added the issue to the 7.0.0 milestone.

This was probably a side-effect of the better typeresolution in PMD 7....

@adangel
adangel merged commit 283f0cb into pmd:main Jul 13, 2026
12 checks passed
@UncleOwen
UncleOwen deleted the issue-4730-FinalFieldCouldBeStatic-FP-with-lombok-@Default branch July 15, 2026 15:10
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] FinalFieldCouldBeStatic false positive with lombok's @Default

2 participants