Repository navigation
Conversation
Remove appendSuper from the general example and explain why Object.equals makes distinct instances unequal even when all compared fields match. Assisted-By: OpenAI Codex
garydgregory
requested changes
Nov 1, 2026
| <action type="fix" dev="ggregory" due-to="alhuda, Gary Gregory">Keep RandomStringUtils.random rejection cap from failing valid ranges (#1843).</action> | ||
| <action type="fix" dev="ggregory" due-to="Pendela Phanindra Rao, Gary Gregory">[javadoc] Correct hexadecimal output examples in Conversion (#1844).</action> | ||
| <action type="fix" dev="ggregory" due-to="Mohd Irshad, Gary Gregory">Fix Conversion hex method Javadoc (#1845).</action> | ||
| <action issue="LANG-1341" type="fix" due-to="rys888">Clarify when to include superclass equality in EqualsBuilder Javadoc.</action> |
garydgregory
marked this pull request as draft
November 1, 2026 11:26
Member
|
Setting to draft. The Jira needs review to see how code and Javadoc should sync up. |
Revert the manually added changes.xml entry as requested by the maintainer. Keep the Javadoc changes for Jira design review. Assisted-By: OpenAI Codex
garydgregory
added a commit
that referenced
this pull request
Nov 1, 2026
Remove appendSuper(super.equals(obj)) from the general example. When super.equals(obj) invokes Object.equals(Object), distinct instances compare unequal even when all their fields are equal. PR #1849 correctly addresses this documentation problem, but its wording leaves inherited overrides implicit and describes the builder as returning false without identifying isEquals(). Make the usage guidance explicit, cover inherited overrides, and document that false makes the equality result false while true leaves the current result unchanged. Explain when to omit identity comparison for field-based equality and correct the super.equals(obj) examples. References: - https://issues.apache.org/jira/browse/LANG-1341 - #1849
Member
|
Thank you for the PR and addressing LANG-1341. The PR is basically correct but the text needs to be more precise. I addressed this in commit a0b7121. You are credited in Notes:
The PR identifies the right problem, but I wanted the resulting documentation to give users explicit usage guidance and an accurate description of the method’s behavior. The commit supersedes this PR; no runtime implementation change was needed. Closing PR. |
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
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related to LANG-1341.
The class-level EqualsBuilder example calls
appendSuper(super.equals(obj))unconditionally. For a class whose superclass uses Object.equals, this compares identity and makes distinct instances unequal even when all their fields match.This documentation-only change removes that call from the general example and explains when to include superclass equality, both after the example and in appendSuper(boolean)'s Javadoc. No runtime code or imports change.
The earlier PR #343 was closed for lack of follow-up. This addresses its remaining review request to explain Object.equals in the method documentation as well.
Validation (JDK 21, Maven 3.9.16):
mvn -B -ntp -U -s ../commons-lang-LANG-1341-validation/maven-settings.xml. The temporary settings file only points the existing mirror at Maven Central. The initial run with the local mirror failed to obtain the parent site descriptor and stopped while rendering the PMD report (skin cannot be null); no project configuration was changed and no checks were skipped.Checklist:
Review follow-up (2026-11-01): Removed the changes.xml entry as requested. The PR remains a draft pending review of LANG-1341 and alignment between the implementation and Javadoc. The follow-up passed the documented non-test checks on JDK 21:
mvn -B -ntp -DskipTests -DskipITs -s ../commons-lang-LANG-1341-validation/maven-settings.xml. Tests were skipped in this follow-up run; the full test results above describe the original submission.