Skip to content

[java] Fix #6781: False positive in UselessPureMethodCall with unresolved types - #6797

Merged
adangel merged 1 commit into
pmd:mainfrom
zbynek:pure-unresolved
Jun 22, 2026
Merged

adangel merged 1 commit into
pmd:mainfrom
zbynek:pure-unresolved

Conversation

@zbynek

@zbynek zbynek commented Jun 21, 2026

Copy link
Copy Markdown
Contributor

Describe the PR

This PR adds defensive code to the pure method call rule so that cases where argument type cannot be resolved are not reported.

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 pure-unresolved branch from d983038 to 5fcc8de Compare June 22, 2026 04:52
@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, 0 errors and 0 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-22 05:09:46+00:00 for 5fcc8de)

@adangel adangel changed the title [java] False positive in UselessPureMethodCall with unresolved types [java] Fix #6781: False positive in UselessPureMethodCall with unresolved types Jun 22, 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.

Thanks!

@adangel adangel added this to the 7.26.0 milestone Jun 22, 2026
adangel added a commit that referenced this pull request Jun 22, 2026
@adangel
adangel merged commit 5fcc8de into pmd:main Jun 22, 2026
13 checks passed
adangel added a commit that referenced this pull request Jun 22, 2026
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] UselessPureMethodCall: False positive for Stream.forEach

2 participants