Skip to content

Conversation

@mrclmh
Copy link
Contributor

@mrclmh mrclmh commented Dec 4, 2025

Describe the PR

Introduce the property ignoredMethodNames, which defaults to compareTo and equals. The property is a String List (instead of regex) to align with the other ignore* properties ignoredFieldNames and ignoredAnnotations.

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)

Introduce the property ignoredMethodNames, which defaults to compareTo
and equals as common methods with multiple returns.
The property is a String List to align with other ignore properties:
ignoredFieldNames and ignoredAnnotations.
@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 1484 violations, 15 errors and 8 configuration errors.

Regression Tester Report

(comment created at 2025-12-04 17:06:52+00:00 for 94896cd)

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!

I'll add another test case to verify, that the old behavior still can be enabled by just setting the new property to an empty value.

@adangel adangel added this to the 7.20.0 milestone Dec 22, 2025
adangel added a commit that referenced this pull request Dec 22, 2025
@adangel adangel merged commit 94896cd into pmd:main Dec 22, 2025
12 checks passed
@mrclmh mrclmh deleted the issue-4257 branch December 26, 2025 11:07
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] OnlyOneReturn: False positive with equals method

2 participants