Skip to content

[LANG-1198] Javadoc: Clarify stripEnd character-set semantics - #1851

Merged
garydgregory merged 3 commits into
apache:masterfrom
rys888:LANG-1198-strip-end-javadoc
Nov 2, 2026
Merged

garydgregory merged 3 commits into
apache:masterfrom
rys888:LANG-1198-strip-end-javadoc

Conversation

@rys888

@rys888 rys888 commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

Related to LANG-1198.

The issue reports that stripEnd("85123116", "16") was mistaken for removing the suffix "16". It actually strips trailing members of the character set and returns "85123".

Clarify this distinction in stripEnd's Javadoc, link to Strings.CS and Strings.removeEnd(String, CharSequence), and add the reported stripEnd example. The example list uses StringUtils consistently.

This is a documentation clarification. It does not implement the issue's suggested char[] signature change or change runtime behavior. Issue closure is left to the maintainers.

Original validation (2026-11-01; JDK 21, Maven 3.9.16, compiler release 8):

  • Full default Maven goals passed: 92,172 tests, 0 failures, 0 errors, 18 skipped; RAT, Checkstyle, japicmp, SpotBugs, PMD, and Javadoc completed.
  • Command: mvn -B -ntp -s ../commons-lang-LANG-1198-validation/maven-settings.xml. Temporary settings use Maven Central without changing project configuration.
  • Compiled and ran the stripEnd and suffix-removal examples locally with Java 8 targeting and checked generated HTML and API links. The suffix-removal example has since been removed from the submitted Javadoc per review.
  • Existing StringUtilsStripTest covers strip-set characters and edge cases.

Review follow-up (2026-11-01): Removed the changes.xml entry as requested. Non-test checks passed; tests were skipped in that follow-up.

Review follow-up (2026-11-02): Removed the Strings.CS.removeEnd example line as requested, preserving the prose cross-reference. Enabled maintainer edits. The documented non-test build passed on retry (52.302 s): mvn -B -ntp -DskipTests -DskipITs -s ../commons-lang-LANG-1198-validation/maven-settings.xml. The first attempt failed fetching the external Commons IO Javadoc package-list. The retry passed; Javadoc reported its generated output up to date. Checked the generated HTML, unchanged runtime source, and git diff --check. Tests were skipped; the test counts above are from the original submission.

Checklist:

  • Read the contribution guidelines and ASF Generative Tooling Guidance.
  • AI assistance: OpenAI Codex helped inspect the issue, draft documentation, address review, and run validation.
  • Original full default build passed.
  • No runtime behavior changes; existing tests passed in the original build.
  • Describe what changes and why.
  • Meaningful commit messages with Assisted-By trailers.

Explain how stripping trailing characters differs from removing a whole suffix, with the reported example and links to Strings.CS.removeEnd. This changes documentation only and preserves the existing API and runtime behavior.

Assisted-By: OpenAI Codex
Comment thread src/changes/changes.xml Outdated
<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-1198" type="fix" due-to="rys888">Clarify the difference between stripping characters and removing a suffix in StringUtils.stripEnd Javadoc.</action>

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.

Do not edit this file.

@garydgregory
garydgregory marked this pull request as draft November 1, 2026 11:28
Revert the manually added changes.xml entry as requested by the maintainer. Preserve the stripEnd documentation clarification.

Assisted-By: OpenAI Codex
@garydgregory garydgregory changed the title [LANG-1198] Clarify stripEnd character-set semantics [LANG-1198] Javadoc: Clarify stripEnd character-set semantics Nov 1, 2026
@garydgregory
garydgregory marked this pull request as ready for review November 2, 2026 20:56
@garydgregory
garydgregory merged commit ae304a6 into apache:master Nov 2, 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.

2 participants