Skip to content

[java] AssertEqualsArgumentOrder: False negative for assertEquals with delta - #6966

Merged
UncleOwen merged 1 commit into
pmd:mainfrom
zbynek:assert-delta
Aug 11, 2026
Merged

UncleOwen merged 1 commit into
pmd:mainfrom
zbynek:assert-delta

Conversation

@zbynek

@zbynek zbynek commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Describe the PR

Follow-up for #6827, adds support for Assertions.assertEquals with floating point delta argument.

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)

@pmd-actions-helper

Copy link
Copy Markdown
Contributor

Documentation Preview

Compared to main:
This changeset changes 8 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-08-11 00:16:41+00:00 for 419ea67)

@UncleOwen

Copy link
Copy Markdown
Member

How do you feel about moving EqualMethod and EQUAL_METHODS into AssertEqualsArgumentOrderRule? I don't expect any other rule to use these in the future, do you?

@zbynek

zbynek commented Aug 11, 2026

Copy link
Copy Markdown
Contributor Author

I think it would be nice to have a rule that flags

asertEquals(expected, expected);

in the future, that's why the mapping is in Utils.

@UncleOwen

Copy link
Copy Markdown
Member

Ok, let's keep them there.

@UncleOwen
UncleOwen merged commit 6d53fd5 into pmd:main Aug 11, 2026
13 checks passed
@UncleOwen UncleOwen added this to the 7.27.0 milestone Aug 14, 2026
@adangel adangel added the a:false-negative PMD doesn't flag a problematic piece of code label Aug 15, 2026
@adangel adangel changed the title [java] AssertEqualsArgumentOrder: false negative for assertEquals with delta [java] AssertEqualsArgumentOrder: False negative for assertEquals with delta Aug 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

a:false-negative PMD doesn't flag a problematic piece of code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants