FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Detect inherited extra fields under recursive comparison strict type checking by tanvir-ux · Pull Request #4369 · assertj/assertj · GitHub

Detect inherited extra fields under recursive comparison strict type checking - #4369

Open
tanvir-ux wants to merge 1 commit into
assertj:mainfrom
tanvir-ux:fix-4263-strict-type-checking-inheritance
Open

Detect inherited extra fields under recursive comparison strict type checking#4369
tanvir-ux wants to merge 1 commit into
assertj:mainfrom
tanvir-ux:fix-4263-strict-type-checking-inheritance

Conversation

Copy link
Copy Markdown

withStrictTypeChecking() used to treat a subtype expected value as compatible with a supertype actual value, so extra fields on the subtype were skipped. Main already fails the comparison when types differ (typesDiffer); this PR covers that case and updates the javadoc, which still described the old subtype-compatible behavior.

isEqualTo now fails (and isNotEqualTo passes) for Person vs Giant in both directions, including a nested field, with both introspection strategies.

Fixes #4263

Check List:

Main already treats different types as unequal under withStrictTypeChecking; add regression tests for the superclass-vs-subtype case from assertj#4263 and align the javadoc with that behavior.
scordio added this to the 4.0.0-M3 milestone Aug 23, 2026

scordio commented Aug 24, 2026

Copy link
Copy Markdown
Member

Thanks for the PR, @tanvir-ux!

FYI, it might take some time before we get to it, as we'll first finalize the scope of 3.28.0 and 4.0.0-M2.

testlens-app Bot commented Aug 24, 2026

Copy link
Copy Markdown

✅ All tests passed ✅

🏷️ Commit: e1c6080
▶️ Tests: 100282 executed
⚪️ Checks: 20/20 completed


Learn more about TestLens at testlens.app/docs.

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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.

Recursive comparison with strict type checking fails to detect missing fields in some inheritance conditions

2 participants


Back | FazBrowse Home | New Git URL