Skip to content

Conversation

@zbynek
Copy link
Contributor

@zbynek zbynek commented Jun 30, 2025

Describe the PR

Check for initializers of non-empty arrays when suggesting that a field can be made static.

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)

@zbynek zbynek force-pushed the array-initializer branch from 665760b to bed27de Compare June 30, 2025 02:56
Copy link
Member

@oowekyala oowekyala left a comment

Choose a reason for hiding this comment

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

LGTM, thank you

@adangel adangel added this to the 7.16.0 milestone Jul 4, 2025
@adangel adangel changed the title Fix false positive in FinalFieldCouldBeStatic for array initializers Fix #5853 #5663: [java] Fix false positive in FinalFieldCouldBeStatic for array initializers Jul 4, 2025
@adangel adangel changed the title Fix #5853 #5663: [java] Fix false positive in FinalFieldCouldBeStatic for array initializers Fix #5858 #5663: [java] Fix false positive in FinalFieldCouldBeStatic for array initializers Jul 4, 2025
@adangel adangel changed the title Fix #5858 #5663: [java] Fix false positive in FinalFieldCouldBeStatic for array initializers Fix #5858: [java] Fix false positive in FinalFieldCouldBeStatic for array initializers Jul 4, 2025
@github-actions
Copy link

github-actions bot commented Jul 4, 2025

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, 25 errors and 8 configuration errors.

Regression Tester Report

(comment created at 2025-07-04 08:06:09+00:00 for bed27de)

adangel added a commit that referenced this pull request Jul 4, 2025
@adangel adangel merged commit bed27de into pmd:main Jul 4, 2025
12 checks passed
adangel added a commit that referenced this pull request Jul 4, 2025
…rray initializers (#5859)

Merge pull request #5859 from zbynek:array-initializer
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!

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 for array initializers [java] FinalFieldCouldBeStatic false-positive in Nested test class

3 participants