Skip to content

[java] Fix #6740: Fix FP in OptimizableToArrayCall - #6813

Merged
adangel merged 3 commits into
pmd:mainfrom
UncleOwen:issue-6740-OptimizableToArrayCall-0x0
Jun 29, 2026
Merged

adangel merged 3 commits into
pmd:mainfrom
UncleOwen:issue-6740-OptimizableToArrayCall-0x0

Conversation

@UncleOwen

Copy link
Copy Markdown
Member

Describe the PR

Use @ValueAsInt instead of @Image to get the value of the ASTNumericLiteral instead of the String representation.

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)

@pmd-actions-helper

Copy link
Copy Markdown
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, 15 errors and 9 configuration errors.
There are 0 changed duplications, 0 new duplications and 0 removed duplications.
There are 0 changed CPD errors, 0 new CPD errors and 0 removed CPD errors.

Regression Tester Report

(comment created at 2026-06-23 22:25:54+00:00 for d5ac085)

@lukasgraef lukasgraef 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.

LGTM

@adangel adangel added this to the 7.26.0 milestone Jun 29, 2026
@adangel
adangel merged commit dbdec25 into pmd:main Jun 29, 2026
13 checks passed
@UncleOwen
UncleOwen deleted the issue-6740-OptimizableToArrayCall-0x0 branch June 29, 2026 08:38
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] OptimizableToArrayCall: False positive when new T[0x0] is used instead of new T[0]

3 participants