diff --git a/.asf.yaml b/.asf.yaml index 4cc5f8aa67..b7e94937c1 100644 --- a/.asf.yaml +++ b/.asf.yaml @@ -5,7 +5,7 @@ # (the "License"); you may not use this file except in compliance with # the License. You may obtain a copy of the License at # -# http://www.apache.org/licenses/LICENSE-2.0 +# https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, @@ -23,7 +23,8 @@ notifications: pullrequests: issues@commons.apache.org jira_options: link label jobs: notifications@commons.apache.org - issues_bot_dependabot: notifications@commons.apache.org - pullrequests_bot_dependabot: notifications@commons.apache.org + # commits_bot_dependabot: dependabot@commons.apache.org + issues_bot_dependabot: dependabot@commons.apache.org + pullrequests_bot_dependabot: dependabot@commons.apache.org issues_bot_codecov-commenter: notifications@commons.apache.org pullrequests_bot_codecov-commenter: notifications@commons.apache.org diff --git a/.github/GH-ROBOTS.txt b/.github/GH-ROBOTS.txt index e3329e55fb..64a88674fe 100644 --- a/.github/GH-ROBOTS.txt +++ b/.github/GH-ROBOTS.txt @@ -5,7 +5,7 @@ # (the "License"); you may not use this file except in compliance with # the License. You may obtain a copy of the License at # -# http://www.apache.org/licenses/LICENSE-2.0 +# https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 9ebcd0ebb1..90ec55f742 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -5,7 +5,7 @@ # (the "License"); you may not use this file except in compliance with # the License. You may obtain a copy of the License at # -# http://www.apache.org/licenses/LICENSE-2.0 +# https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, @@ -18,10 +18,8 @@ updates: - package-ecosystem: "maven" directory: "/" schedule: - interval: "weekly" - day: "friday" + interval: "quarterly" - package-ecosystem: "github-actions" directory: "/" schedule: - interval: "weekly" - day: "friday" + interval: "quarterly" diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index d126a970ce..9ff35c83e7 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -7,7 +7,7 @@ "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 + https://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an @@ -22,7 +22,9 @@ Thanks for your contribution to [Apache Commons](https://commons.apache.org/)! Y Before you push a pull request, review this list: - [ ] Read the [contribution guidelines](CONTRIBUTING.md) for this project. +- [ ] Read the [ASF Generative Tooling Guidance](https://www.apache.org/legal/generative-tooling.html) if you use Artificial Intelligence (AI). +- [ ] I used AI to create any part of, or all of, this pull request. Which AI tool was used to create this pull request, and to what extent did it contribute? - [ ] Run a successful build using the default [Maven](https://maven.apache.org/) goal with `mvn`; that's `mvn` on the command line by itself. -- [ ] Write unit tests that match behavioral changes, where the tests fail if the changes to the runtime are not applied. This may not always be possible but is a best-practice. +- [ ] Write unit tests that match behavioral changes, where the tests fail if the changes to the runtime are not applied. This may not always be possible, but it is a best practice. - [ ] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. -- [ ] Each commit in the pull request should have a meaningful subject line and body. Note that commits might be squashed by a maintainer on merge. +- [ ] Each commit in the pull request should have a meaningful subject line and body. Note that a maintainer may squash commits during the merge process. diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 8870d60ca5..e072e3dd79 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -5,7 +5,7 @@ # (the "License"); you may not use this file except in compliance with # the License. You may obtain a copy of the License at # -# http://www.apache.org/licenses/LICENSE-2.0 +# https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, @@ -37,6 +37,7 @@ jobs: security-events: write strategy: + max-parallel: 20 fail-fast: false matrix: language: [ 'java' ] @@ -45,10 +46,10 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: persist-credentials: false - - uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3 + - uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 #v5.0.3 with: path: ~/.m2/repository key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} @@ -57,7 +58,7 @@ jobs: # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/init@1b549b9259bda1cb5ddde3b41741a82a2d15a841 # 3.28.13 + uses: github/codeql-action/init@c6f931105cb2c34c8f901cc885ba1e2e259cf745 # v4.34.0 with: languages: ${{ matrix.language }} # If you wish to specify custom queries, you can do so here or in a config file. @@ -68,7 +69,7 @@ jobs: # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). # If this step fails, then you should remove it and run the build manually (see below) - name: Autobuild - uses: github/codeql-action/autobuild@1b549b9259bda1cb5ddde3b41741a82a2d15a841 # 3.28.13 + uses: github/codeql-action/autobuild@c6f931105cb2c34c8f901cc885ba1e2e259cf745 # v4.34.0 # ℹ️ Command-line programs to run using the OS shell. # 📚 https://git.io/JvXDl @@ -82,4 +83,4 @@ jobs: # make release - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@1b549b9259bda1cb5ddde3b41741a82a2d15a841 # 3.28.13 + uses: github/codeql-action/analyze@c6f931105cb2c34c8f901cc885ba1e2e259cf745 # v4.34.0 diff --git a/.github/workflows/dependency-review.yml b/.github/workflows/dependency-review.yml index c6ece650e2..a04da50909 100644 --- a/.github/workflows/dependency-review.yml +++ b/.github/workflows/dependency-review.yml @@ -6,7 +6,7 @@ # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # -# http://www.apache.org/licenses/LICENSE-2.0 +# https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an @@ -26,6 +26,6 @@ jobs: runs-on: ubuntu-latest steps: - name: 'Checkout Repository' - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - name: 'Dependency Review PR' - uses: actions/dependency-review-action@3b139cfc5fae8b618d3eae3675e383bb1769c019 # v4.5.0 + uses: actions/dependency-review-action@3c4e3dcb1aa7874d2c16be7d79418e9b7efd6261 # v4.8.2 diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index b93e5ecfad..ca5362ba4e 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -5,7 +5,7 @@ # (the "License"); you may not use this file except in compliance with # the License. You may obtain a copy of the License at # -# http://www.apache.org/licenses/LICENSE-2.0 +# https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, @@ -26,19 +26,20 @@ jobs: runs-on: ubuntu-latest continue-on-error: ${{ matrix.experimental }} strategy: + max-parallel: 20 matrix: - java: [ 8, 11, 17, 21, 24 ] + java: [ 8, 11, 17, 21, 25 ] experimental: [false] include: - - java: 25-ea + - java: 26-ea experimental: true steps: - - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: persist-credentials: false - name: Set up JDK ${{ matrix.java }} - uses: actions/setup-java@3a4f6e1af504cf6a31855fa899c6aa5355ba6c12 # v4.7.0 + uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0 with: distribution: 'temurin' java-version: ${{ matrix.java }} diff --git a/.github/workflows/scorecards-analysis.yml b/.github/workflows/scorecards-analysis.yml index 81334c6824..7182c34001 100644 --- a/.github/workflows/scorecards-analysis.yml +++ b/.github/workflows/scorecards-analysis.yml @@ -5,7 +5,7 @@ # (the "License"); you may not use this file except in compliance with # the License. You may obtain a copy of the License at # -# http://www.apache.org/licenses/LICENSE-2.0 +# https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, @@ -40,12 +40,12 @@ jobs: steps: - name: "Checkout code" - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: persist-credentials: false - name: "Run analysis" - uses: ossf/scorecard-action@f49aabe0b5af0936a0987cfb85d86b75731b0186 # 2.4.1 + uses: ossf/scorecard-action@4eaacf0543bb3f2c246792bd56e8cdeffafb205a # 2.4.3 with: results_file: results.sarif results_format: sarif @@ -57,13 +57,13 @@ jobs: publish_results: true - name: "Upload artifact" - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # 4.6.2 + uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 with: name: SARIF file path: results.sarif retention-days: 5 - name: "Upload to code-scanning" - uses: github/codeql-action/upload-sarif@1b549b9259bda1cb5ddde3b41741a82a2d15a841 # 3.28.13 + uses: github/codeql-action/upload-sarif@c6f931105cb2c34c8f901cc885ba1e2e259cf745 # v4.34.0 with: sarif_file: results.sarif diff --git a/.gitignore b/.gitignore index 92a1b2a4a3..c5860d17e9 100644 --- a/.gitignore +++ b/.gitignore @@ -18,3 +18,8 @@ site-content .project .externalToolBuilders /.checkstyle +/.DS_Store + +# NetBeans files +nb-configuration.xml +nbactions.xml diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index 3ed501501d..b4342f33ca 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -6,7 +6,7 @@ (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 + https://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 32f45c3390..9d1083cc5e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -6,7 +6,7 @@ (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 + https://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, @@ -61,15 +61,15 @@ Making Changes + Create a _topic branch_ for your isolated work. * Usually you should base your branch from the `master` branch. - * A good topic branch name can be the JIRA bug ID plus a keyword, for example, `TEXT-123-InputStream`. + * A good topic branch name can be the JIRA bug ID plus a keyword, e.g. `TEXT-123-InputStream`. * If you have submitted multiple JIRA issues, try to maintain separate branches and pull requests. + Make commits of logical units. * Make sure your commit messages are meaningful and in the proper format. Your commit message should contain the key of the JIRA issue. - * For example, `[TEXT-123] Close input stream earlier` + * For example, `[TEXT-123] Close input stream sooner` + Respect the original code style: + Only use spaces for indentation; you can check for unnecessary whitespace with `git diff` before committing. + Create minimal diffs - disable _On Save_ actions like _Reformat Source Code_ or _Organize Imports_. If you feel the source code should be reformatted create a separate PR for this change first. -+ Write unit tests that match behavioral changes, where the tests fail if the changes to the runtime are not applied. This may not always be possible but is a best-practice. ++ Write unit tests that match behavioral changes, where the tests fail if the changes to the runtime are not applied. This may not always be possible but is a best practice. Unit tests are typically in the `src/test/java` directory. + Run a successful build using the default [Maven](https://maven.apache.org/) goal with `mvn`; that's `mvn` on the command line by itself. + Write a pull request description that is detailed enough to understand what the pull request does, how, and why. diff --git a/LICENSE.txt b/LICENSE.txt index d645695673..ff9ad4530f 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -193,7 +193,7 @@ you may not use this file except in compliance with the License. You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 + https://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, diff --git a/NOTICE.txt b/NOTICE.txt index 0c73fbda69..167fda3832 100644 --- a/NOTICE.txt +++ b/NOTICE.txt @@ -1,5 +1,5 @@ Apache Commons Text -Copyright 2014-2025 The Apache Software Foundation +Copyright 2014-2026 The Apache Software Foundation This product includes software developed at The Apache Software Foundation (https://www.apache.org/). diff --git a/README.md b/README.md index 3110a06778..3cd07a15d7 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 + https://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, @@ -45,12 +45,12 @@ Apache Commons Text [![Java CI](https://github.com/apache/commons-text/actions/workflows/maven.yml/badge.svg)](https://github.com/apache/commons-text/actions/workflows/maven.yml) [![Maven Central](https://img.shields.io/maven-central/v/org.apache.commons/commons-text?label=Maven%20Central)](https://search.maven.org/artifact/org.apache.commons/commons-text) -[![Javadocs](https://javadoc.io/badge/org.apache.commons/commons-text/1.13.0.svg)](https://javadoc.io/doc/org.apache.commons/commons-text/1.13.0) +[![Javadocs](https://javadoc.io/badge/org.apache.commons/commons-text/1.15.0.svg)](https://javadoc.io/doc/org.apache.commons/commons-text/1.15.0) [![CodeQL](https://github.com/apache/commons-text/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/apache/commons-text/actions/workflows/codeql-analysis.yml) [![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/apache/commons-text/badge)](https://api.securityscorecards.dev/projects/github.com/apache/commons-text) -Apache Commons Text is a set of utility functions and reusable components for the purpose of processing - and manipulating text that should be of use in a Java environment. +Apache Commons Text is a set of utility functions and reusable components for processing + and manipulating text in a Java environment. Documentation ------------- @@ -69,7 +69,7 @@ Alternatively, you can pull it from the central Maven repositories: org.apache.commons commons-text - 1.13.0 + 1.15.0 ``` @@ -90,8 +90,8 @@ There are some guidelines which will make applying PRs easier for us: + Respect the existing code style for each file. + Create minimal diffs - disable on save actions like reformat source code or organize imports. If you feel the source code should be reformatted create a separate PR for this change. + Provide JUnit tests for your changes and make sure your changes don't break any existing tests by running `mvn`. -+ Before you pushing a PR, run `mvn` (by itself), this runs the default goal, which contains all build checks. -+ To see the code coverage report, regardless of coverage failures, run `mvn clean site -Dcommons.jacoco.haltOnFailure=false` ++ Before you push a PR, run `mvn` (without arguments). This runs the default goal which contains all build checks. ++ To see the code coverage report, regardless of coverage failures, run `mvn clean site -Dcommons.jacoco.haltOnFailure=false -Pjacoco` If you plan to contribute on a regular basis, please consider filing a [contributor license agreement](https://www.apache.org/licenses/#clas). You can learn more about contributing via GitHub in our [contribution guidelines](CONTRIBUTING.md). diff --git a/RELEASE-NOTES.txt b/RELEASE-NOTES.txt index 49fe0d92fc..f299b31453 100644 --- a/RELEASE-NOTES.txt +++ b/RELEASE-NOTES.txt @@ -6,7 +6,7 @@ The ASF licenses this file to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 +https://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, @@ -14,18 +14,166 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. +Apache Commons Text 1.15.0 Release Notes +---------------------------------------- + +The Apache Commons Text team is pleased to announce the release of Apache Commons Text 1.15.0. + +Apache Commons Text is a set of utility functions and reusable components for processing +and manipulating text in a Java environment. + +Release 1.15.0. This is a feature and maintenance release. Java 8 or later is required. + + +New features +------------ + +* Add experimental CycloneDX VEX file #683. Thanks to Piotr P. Karwasz, Gary Gregory. +* TEXT-235: Add Damerau-Levenshtein distance #687. Thanks to LorgeN, Gary Gregory. +* Add unit tests to increase coverage #719. Thanks to Michael Hausegger, Gary Gregory. +* Add new test for CharSequenceTranslator#with() #725. Thanks to Michael Hausegger, Gary Gregory. +* Add tests and assertions to org.apache.commons.text.similarity to get to 100% code coverage #727, #728. Thanks to Michael Hausegger. + +Fixed Bugs +---------- + +* Fix exception message typo in XmlStringLookup.XmlStringLookup(Map, Path...). Thanks to Gary Gregory. +* TEXT-236: Inserting at the end of a TextStringBuilder throws a StringIndexOutOfBoundsException. Thanks to Pierre Post, Sumit Bera, Alex Herbert, Gary Gregory. +* Fix TextStringBuilderTest.testAppendToCharBuffer() to use proper argument type #724. Thanks to Michael Hausegger. +* Fix Apache RAT plugin console warnings. Thanks to Gary Gregory. +* Fix site XML to use version 2.0.0 XML schema. Thanks to Gary Gregory. +* Removed unreachable threshold verification code in src/main/java/org/apache/commons/text/similarity #730. Thanks to Michael Hausegger. +* Enable secure processing for the XML parser in XmlStringLookup in case the underlying JAXP implementation doesn't #729. Thanks to 김민재 (minjas0507), Gary Gregory, Piotr Karwasz. + +Changes +------- + +* Bump org.apache.commons:commons-parent from 85 to 93 #704, #723, #726. Thanks to Gary Gregory. +* Bump commons.bytebuddy.version from 1.17.6 to 1.18.2 #696, #722. Thanks to Gary Gregory. +* Bump graalvm.version from 24.2.2 to 25.0.1 #703, #716. Thanks to Gary Gregory, Dependabot. +* Bump org.apache.commons:commons-lang3 from 3.18.0 to 3.20.0. Thanks to Gary Gregory. +* Bump commons-io:commons-io from 2.20.0 to 2.21.0. Thanks to Gary Gregory. + + +Historical list of changes: https://commons.apache.org/proper/commons-text/changes.html + +For complete information on Apache Commons Text, including instructions on how to submit bug reports, +patches, or suggestions for improvement, see the Apache Commons Text website: + +https://commons.apache.org/proper/commons-text + +Download page: https://commons.apache.org/proper/commons-text/download_text.cgi + +Have fun! +-Apache Commons Team + +----------------------------------------------------------------------------- + +Apache Commons Text 1.14.0 Release Notes +---------------------------------------- + +The Apache Commons Text team is pleased to announce the release of Apache Commons Text 1.14.0. + +Apache Commons Text is a set of utility functions and reusable components for processing +and manipulating text in a Java environment. + +Release 1.14.0. Requires Java 8 or above. + + +New features +------------ + +* Interface StringLookup now extends UnaryOperator. Thanks to Gary Gregory. +* Interface TextRandomProvider extends IntUnaryOperator. Thanks to Gary Gregory. +* Add RandomStringGenerator.Builder.usingRandom(IntUnaryOperator). Thanks to Gary Gregory. +* Add PMD check to default Maven goal. Thanks to Gary Gregory. +* Add org.apache.commons.text.RandomStringGenerator.Builder.setAccumulate(boolean). Thanks to Gary Gregory. + +Fixed Bugs +---------- + +* Fix PMD UnnecessaryFullyQualifiedName in StringLookupFactory. Thanks to Gary Gregory. +* Fix PMD UnnecessaryFullyQualifiedName in DefaultStringLookupsHolder. Thanks to Gary Gregory. +* Fix PMD UnnecessaryFullyQualifiedName in PropertiesStringLookup. Thanks to Gary Gregory. +* Fix PMD UnnecessaryFullyQualifiedName in JavaPlatformStringLookup. Thanks to Gary Gregory. +* Fix PMD UnnecessaryFullyQualifiedName in StringSubstitutor. Thanks to Gary Gregory. +* Fix PMD UnnecessaryFullyQualifiedName in StrSubstitutor. Thanks to Gary Gregory. +* Fix PMD UnnecessaryFullyQualifiedName in AlphabetConverter. Thanks to Gary Gregory. +* Fix PMD AvoidBranchingStatementAsLastInLoop in TextStringBuilder. Thanks to Gary Gregory. +* Fix PMD AvoidBranchingStatementAsLastInLoop in StrBuilder. Thanks to Gary Gregory. +* org.apache.commons.text.translate.LookupTranslator.LookupTranslator(Map CharSequence>) now throws NullPointerException instead of java.security.InvalidParameterException. Thanks to Gary Gregory. + +Changes +------- + +* Bump org.apache.commons:commons-parent from 81 to 85 #668. Thanks to Dependabot, Gary Gregory. +* Bump commons-io:commons-io from 2.18.0 to 2.20.0. Thanks to Gary Gregory. +* Bump graalvm.version from 24.2.0 to 24.2.2 #665, #681. Thanks to Dependabot, Gary Gregory. +* Bump commons.bytebuddy.version from 1.17.5 to 1.17.6 (#677). Thanks to Dependabot. +* Bump org.apache.commons:commons-lang3 from 3.17.0 to 3.18.0 #680. Thanks to Dependabot. + + +Historical list of changes: https://commons.apache.org/proper/commons-text/changes.html + +For complete information on Apache Commons Text, including instructions on how to submit bug reports, +patches, or suggestions for improvement, see the Apache Commons Text website: + +https://commons.apache.org/proper/commons-text + +Download page: https://commons.apache.org/proper/commons-text/download_text.cgi + +Have fun! +-Apache Commons Team + +----------------------------------------------------------------------------- + +Apache Commons Text 1.13.1 Release Notes +---------------------------------------- + +This document contains the release notes for the 1.13.1 version of Apache Commons Text. + +Apache Commons Text is a set of utility functions and reusable components for processing and manipulating text in a Java environment. + +Release 1.13.1. Requires Java 8 or above. + +Fixed Bugs +---------- + +* Remove -nouses directive from maven-bundle-plugin. OSGi package imports now state 'uses' definitions for package imports, this doesn't affect JPMS (from org.apache.commons:commons-parent:80). Thanks to Gary Gregory. +* Deprecate EntityArrays.EntityArrays(). Thanks to Gary Gregory. +* StringLookupFactory.DefaultStringLookupsHolder.createDefaultStringLookups() maps DefaultStringLookup.LOCAL_HOST twice instead of once for LOCAL_HOST and LOOPBACK_ADDRESS. Thanks to Gary Gregory. + +Changes +------- + +* Bump org.apache.commons:commons-parent from 79 to 81. Thanks to Gary Gregory. +* Bump commons.bytebuddy.version from 1.16.1 to 1.17.5 #643, #659, #660. Thanks to Gary Gregory, Dependabot. +* Bump graalvm.version from 24.1.2 to 24.2.0 #653. Thanks to Gary Gregory, Dependabot. + + +Historical list of changes: https://commons.apache.org/proper/commons-text/changes.html + +For complete information on Apache Commons Text, including instructions on how to submit bug reports, +patches, or suggestions for improvement, see the Apache Commons Text website: + +https://commons.apache.org/proper/commons-text + +Download page: https://commons.apache.org/proper/commons-text/download_text.cgi + +Have fun! +-Apache Commons Team + +----------------------------------------------------------------------------- Apache Commons Text Version 1.13.0 Release Notes ------------------------------------------------ This document contains the release notes for the 1.13.0 version of Apache Commons Text. -Apache Commons Text is a set of utility functions and reusable components for the purpose of processing -and manipulating text that should be of use in a Java environment. +Apache Commons Text is a set of utility functions and reusable components for processing and manipulating text in a Java environment. Release 1.13.0. Requires Java 8 or above. - New features ------------ @@ -89,22 +237,6 @@ Have fun! ----------------------------------------------------------------------------- -Licensed to the Apache Software Foundation (ASF) under one or more -contributor license agreements. See the NOTICE file distributed with -this work for additional information regarding copyright ownership. -The ASF licenses this file to You under the Apache License, Version 2.0 -(the "License"); you may not use this file except in compliance with -the License. You may obtain a copy of the License at - -http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. - - Apache Commons Text Version 1.12.0 Release Notes ------------------------------------------------ @@ -154,22 +286,6 @@ Have fun! ----------------------------------------------------------------------------- -Licensed to the Apache Software Foundation (ASF) under one or more -contributor license agreements. See the NOTICE file distributed with -this work for additional information regarding copyright ownership. -The ASF licenses this file to You under the Apache License, Version 2.0 -(the "License"); you may not use this file except in compliance with -the License. You may obtain a copy of the License at - -http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. - - Apache Commons Text Version 1.11.0 Release Notes ------------------------------------------------ @@ -266,7 +382,7 @@ New features * TEXT-207: Add DoubleFormat utility. * TEXT-190: Document negative limit for WordUtils abbreviate method Thanks to Benjamin Bing. -* TEXT-188: Speed up LevenshteinDistance with threshold by exiting early Thanks to Jakob Vesterstrm. +* TEXT-188: Speed up LevenshteinDistance with threshold by exiting early Thanks to Jakob Vesterstrøm. * TEXT-185: Release Notes page hasn't been updated for 1.9 release yet. Thanks to Larry West, Gary Gregory. * Add StrBuilder.isNotEmpty(). Thanks to Gary Gregory. diff --git a/SECURITY.md b/SECURITY.md index 51943ba7b4..744d4cddbb 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -6,7 +6,7 @@ (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 + https://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, diff --git a/pom.xml b/pom.xml index 2852610619..bc8e9a9200 100644 --- a/pom.xml +++ b/pom.xml @@ -7,7 +7,7 @@ (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 + https://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, @@ -20,44 +20,38 @@ org.apache.commons commons-parent - 81 + 97 commons-text - 1.13.1-SNAPSHOT + 1.15.1-SNAPSHOT Apache Commons Text - Apache Commons Text is a set of utility functions and reusable components for the purpose of processing - and manipulating text that should be of use in a Java environment. + Apache Commons Text is a set of utility functions and reusable components for processing + and manipulating text in a Java environment. https://commons.apache.org/proper/commons-text ISO-8859-1 UTF-8 - 2024-12-13T16:17:37Z + 2025-12-07T22:18:14Z 1.8 1.8 - text text org.apache.commons.text - - 1.13.0 - 1.13.1 + 1.15.01 + 1.15.2 (Java 8+) - TEXT 12318221 - text https://svn.apache.org/repos/infra/websites/production/commons/content/proper/commons-text site-content - - 3.17.0 - 1.17.5 + 3.20.0 + 1.18.7 1.6 false 1.37 - org.apache.commons.lang3;version="${commons.lang3.version}", @@ -65,10 +59,9 @@ org.apache.commons.lang3.time;version="${commons.lang3.version}", * - - 1.12.0 + 1.15.0 RC1 true scm:svn:https://dist.apache.org/repos/dist/dev/commons/${commons.componentid} @@ -78,15 +71,15 @@ commons.releaseManagerName commons.releaseManagerKey --> - 0.8.12 + true 1.00 - 0.97 - 0.98 + 0.99 + 0.99 0.95 - 0.94 - 0.98 + 0.99 + 0.97 @@ -100,6 +93,11 @@ junit-jupiter test + + org.junit-pioneer + junit-pioneer + test + net.bytebuddy @@ -117,7 +115,7 @@ commons-io commons-io - 2.18.0 + 2.21.0 test @@ -138,24 +136,28 @@ ${jmh.version} test + + org.apache.commons + commons-csv + 1.14.1 + test + - - clean verify apache-rat:check japicmp:cmp checkstyle:check spotbugs:check javadoc:javadoc + clean verify apache-rat:check japicmp:cmp checkstyle:check pmd:check spotbugs:check javadoc:javadoc org.apache.rat apache-rat-plugin - - site-content/** - src/site/resources/download_text.cgi - src/site/resources/release-notes/RELEASE-NOTES-*.txt - src/test/resources/org/apache/commons/text/stringEscapeUtilsTestData.txt - src/test/resources/org/apache/commons/text/lcs-perf-analysis-inputs.csv - src/test/resources/org/apache/commons/text/oss-fuzz/** - + + site-content/** + src/site/resources/download_text.cgi + src/site/resources/release-notes/RELEASE-NOTES-*.txt + src/test/resources/org/apache/commons/text/stringEscapeUtilsTestData.txt + src/test/resources/org/apache/commons/text/oss-fuzz/** + @@ -242,7 +244,6 @@ - @@ -336,9 +337,7 @@ - 2014 - kinow @@ -376,7 +375,6 @@ djones@apache.org - Don Jeba @@ -421,18 +419,14 @@ https://ali-ghanbari.github.io/ - scm:git:https://gitbox.apache.org/repos/asf/commons-text scm:git:https://gitbox.apache.org/repos/asf/commons-text https://gitbox.apache.org/repos/asf?p=commons-text.git - - jira https://issues.apache.org/jira/browse/TEXT - apache.website @@ -440,7 +434,10 @@ scm:svn:https://svn.apache.org/repos/infra/websites/production/commons/content/proper/commons-text/ - + + GitHub + https://github.com/apache/commons-text/actions + @@ -513,7 +510,7 @@ [22,) - 24.2.0 + 25.0.1 5.2.0 @@ -607,13 +604,45 @@ + benchmark true org.apache + + + org.openjdk.jmh + jmh-core + ${commons.jmh.version} + test + + + org.openjdk.jmh + jmh-generator-annprocess + ${commons.jmh.version} + test + + + org.apache.commons + commons-collections4 + 4.5.0 + test + + + + + maven-compiler-plugin + ${commons.compiler.version} + + + **/* + + + + org.codehaus.mojo exec-maven-plugin @@ -629,12 +658,12 @@ java -classpath - + org.openjdk.jmh.Main -rf json -rff - target/jmh-result.${benchmark}.json + target/jmh-result.json ${benchmark} diff --git a/src/assembly/bin.xml b/src/assembly/bin.xml index 0a598cb5f4..19dee8f02f 100644 --- a/src/assembly/bin.xml +++ b/src/assembly/bin.xml @@ -6,7 +6,7 @@ (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 + https://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, diff --git a/src/assembly/src.xml b/src/assembly/src.xml index 05e2838ae4..d5ef988e52 100644 --- a/src/assembly/src.xml +++ b/src/assembly/src.xml @@ -6,7 +6,7 @@ (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 + https://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, diff --git a/src/changes/changes.xml b/src/changes/changes.xml index fd611bc8b7..a3ae6cc2bc 100644 --- a/src/changes/changes.xml +++ b/src/changes/changes.xml @@ -7,7 +7,7 @@ (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 + https://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, @@ -37,339 +37,387 @@ and commit The type attribute can be add,update,fix,remove. --> - - + Apache Commons Text Changes - - - Remove -nouses directive from maven-bundle-plugin. OSGi package imports now state 'uses' definitions for package imports, this doesn't affect JPMS (from org.apache.commons:commons-parent:80). - Deprecate EntityArrays.EntityArrays(). - StringLookupFactory.DefaultStringLookupsHolder.createDefaultStringLookups() maps DefaultStringLookup.LOCAL_HOST twice instead of once for LOCAL_HOST and LOOPBACK_ADDRESS. - - - Bump org.apache.commons:commons-parent from 79 to 81. - Bump commons.bytebuddy.version from 1.16.1 to 1.17.5 #643, #659, #660. - Bump graalvm.version from 24.1.2 to 24.2.0 #653. - - - - Add StringLookupFactory.loopbackAddressStringLookup(). - Add StringLookupFactory.KEY_LOOPBACK_ADDRESS. - Add DefaultStringLookup.LOOPBACK_ADDRESS. - Add richer inputs in package org.apache.commons.text.similarity with SimilarityInput. - Add HammingDistance.apply(SimilarityInput, SimilarityInput). - Add JaccardDistance.apply(SimilarityInput, SimilarityInput). - Add JaccardSimilarity.apply(SimilarityInput, SimilarityInput). - Add JaroWinklerDistance.apply(SimilarityInput, SimilarityInput). - Add JaroWinklerSimilarity.apply(SimilarityInput, SimilarityInput). - Add LevenshteinDetailedDistance.apply(SimilarityInput, SimilarityInput). - Add LevenshteinDistance.apply(SimilarityInput, SimilarityInput). - - Fix build on Java 22. - Fix build on Java 23-ea. - Make package-private constructor private: StrLookup.MapStrLookup.MapStrLookup(Map). - Make package-private constructor private: StrLookup.SystemPropertiesStrLookup.SystemPropertiesStrLookup(). - Make package-private class private and final: MapStrLookup. - Make package-private class private: StrMatcher.CharMatcher. - Make package-private class private: StrMatcher.CharSetMatcher. - Make package-private class private: StrMatcher.NoMatcher. - Make package-private class private: StrMatcher.StringMatcher. - Make package-private class private: StrMatcher.TrimMatcher. - Make package-private class private and final: IntersectionSimilarity.BagCount. - Make package-private class private and final: IntersectionSimilarity.TinyCount. - Deprecate LevenshteinDistance.LevenshteinDistance() in favor of LevenshteinDistance.getDefaultInstance(). - Deprecate LevenshteinDetailedDistance.LevenshteinDetailedDistance() in favor of LevenshteinDetailedDistance.getDefaultInstance(). - Improve StrBuilder documentation for new line text. - Improve TextStringBuilder documentation for new line text #547. - Required OSGi Import-Package version numbers in MANIFEST.MF #627. - - Bump org.apache.commons:commons-parent from 69 to 78 #542, #557, #571, #581, #584, #593, #600, #603, #614. - Bump tests on Java >= 22 org.graalvm.*:* from 24.0.0 to 24.1.1 #592, #610. - Bump commons.bytebuddy.version from 1.14.13 to 1.16.1 #538, #548, #553, #565, #579, #582, #585, #596, #597, #604, #612, #620, #623, #625, #640. - Bump SpotBugs from 4.8.3 to 4.8.5. - Bump org.assertj:assertj-core from 3.25.3 to 3.26.3 #554, #566. - Bump org.codehaus.mojo:taglist-maven-plugin from 3.0.0 to 3.2.1 #564, #611. - Bump org.apache.commons:commons-rng-simple from 1.5 to 1.6 #568. - Bump org.apache.commons:commons-lang3 from 3.14.0 to 3.17.0 #569, #575, #586. - Bump commons-io:commons-io from 2.16.1 to 2.18.0 #594, #628. - - - - Add StringLookupFactory.fileStringLookup(Path...) and deprecated fileStringLookup(). - Add StringLookupFactory.propertiesStringLookup(Path...) and deprecated propertiesStringLookup(). - Add StringLookupFactory.xmlStringLookup(Map, Path...) and deprecated xmlStringLookup() and xmlStringLookup(Map). - Add StringLookupFactory.builder() for fencing Path resolution of the file, properties and XML lookups. - Add DoubleFormat.Builder.get() as Builder now implements Supplier. - - WordUtils.containsAllWords​() may throw PatternSyntaxException. - Fix regression for determining whitespace in WordUtils #519. - Deprecate Builder in favor of Supplier. - - Bump commons-lang3 from 3.13.0 to 3.14.0. - Bump commons.bytebuddy.version from 1.14.9 to 1.14.13 #476, #482, #505, #521. - Bump org.codehaus.mojo:exec-maven-plugin from 3.1.0 to 3.2.0 #474, #508. - Bump commons-io from 2.15.0 to 2.16.1 #522, #527. - Bump commons-parent from 64 to 69 #524. - Bump org.assertj:assertj-core from 3.24.2 to 3.25.3. - - - - Fix StringTokenizer.getTokenList to return an independent modifiable list - Fix Javadoc for StringEscapeUtils.escapeHtml4 #382 - TextStringBuidler#hashCode() allocates a String on each call #387. - Fix Bundle-SymbolicName to use the package name org.apache.commons.text - Add and use a package-private singleton for RegexTokenizer. - Add and use a package-private singleton for CosineSimilarity. - Add and use a package-private singleton for LongestCommonSubsequence. - Add and use a package-private singleton for JaroWinklerSimilarity. - Add and use a package-private singleton for JaccardSimilarity. - [StepSecurity] ci: Harden GitHub Actions #428. - Improve AlphabetConverter Javadoc #429. - Fix exception message in IntersectionResult to make set-theoretic sense #438. - Add null-check in RandomStringGenerator#Builder#selectFrom() to avoid NullPointerException #434. - Add null-check in RandomStringGenerator#Builder#withinRange() to avoid NullPointerException. - Fix TextStringBuilder to over-allocate when ensuring capacity #452. - Constructor for ResourceBundleStringLookup should be private instead of package-private. - Constructor for UrlDecoderStringLookup should be private instead of package-private. - Constructor for UrlEncoderStringLookup should be private instead of package-private. - Javadoc of org.apache.commons.text.lookup.DefaultStringLookup.XML is incorrect. - Update DoubleFormat to state it is based on Double.toString. #467. - - Set SecureProcessing feature in XmlStringLookup by default. - Add StringLookupFactory.xmlStringLookup(Map<String, Boolean>...). - Add @FunctionalInterface to FormatFactory. - Add RandomStringGenerator.builder(). - Add XmlEncoderStringLookup/XmlDecoderStringLookup #449. - Add StringSubstitutor.toString(). - - Bump actions/cache. - Bump actions/setup-java. - Bump actions/checkout. - Bump pmd from 6.49.0 to 6.52.0 #364. - Bump commons-rng-simple from 1.4 to 1.5 #370. - Bump spotbugs-maven-plugin from 4.7.2.0 to 4.7.3.6 #371, #385. - Bump spotbugs from 4.7.2 to 4.7.3 #373. - Bump mockito-inline from 4.8.0 to 4.11.0 #380, #389, #396, #400. - Bump jmh.version from 1.35 to 1.37 #388. - Bump commons-parent from 54 to 64 #392, #401. - Bump assertj-core from 3.23.1 to 3.24.2 #405, #410. - Bump maven-checkstyle-plugin from 3.2.0 to 3.2.1 #407. - Bump commons-io from 2.11.0 to 2.15.0. - Bump commons-lang3 from 3.12.0 to 3.13.0. - - - - Fix CaseUtils when the input string contains only delimiters - Add GraalVM test dependencies to fix test failures with Java 15. - Incorrect values for Jaccard similarity with empty strings. - StringSubstitutor map constructor throws NPE on 1.9 with null map. - JaroWinklerDistance returns the same values as JaroWinklerSimilarity. - Correct Javadoc in FileStringLookup. - Minor Improvements #192, #196. - Use StringUtils.INDEX_NOT_FOUND constant. - Remove redundant local variable. - Replace lambda with method reference. - Simplify statements. - Replace statement lambda with expression lambda. - Use static class inner class in tests. - Simplify assertion. - Extract duplicate code. - Set void return method. - Remove unused exception from TextStringBuilder.readFrom(CharBuffer). This preserves binary compatibility but not source compatibility. - StrBuilder.StrBuilderReader.skip(long): Throw an exception when an implicit narrowing conversion in a compound assignment would result in information loss or a numeric error such as an overflows. - TextStringBuilder.TextStringBuilderReader.skip(long): Throw an exception when an implicit narrowing conversion in a compound assignment would result in information loss or a numeric error such as an overflows. - TextStringBuilder.equals whatever the capacity is #281. - A More Efficient Implementation for Calculating Size of Longest Common Subsequence. - LookupTranslator returns count of chars consumed, not of codepoints consumed. - Use Math.min() call instead of doing it manually. #335. - TextStringBuilder: Throw OutOfMemoryError instead of NegativeArraySizeException. - TextStringBuilder: Can't grow to sizes up to Integer.MAX_VALUE. - Make default string lookups configurable via system property. Remove dns, url, and script lookups from defaults. If these lookups are required for use in StringSubstitutor.createInterpolator(), they must be enabled via system property. See StringLookupFactory for details. - - Add DoubleFormat utility. - Document negative limit for WordUtils abbreviate method - Speed up LevenshteinDistance with threshold by exiting early - Release Notes page hasn't been updated for 1.9 release yet. - Add StrBuilder.isNotEmpty(). - - Bump actions/setup-java from v1.4.0 to 3 #147, #156, #155, #172, #215, #314. - Bump github/codeql-action from 1 to 2 #319. - Bump checkstyle from 8.34 to 9.3, #141, #168, #182, #188, #193, #201, #208, #211, #228, #235, #245, #253, #255, #262, #270, #280, #287, #299, #315, #321. - Bump spotbugs-maven-plugin from 4.0.0 to 4.7.2.0, #144, #150, #167, #176, #194, #210, #223, #250, #268, #273, #277, #278, #286, #293, #303, #320, #325, #338, #344, #354. - Bump spotbugs from 4.1.3 to 4.7.2 #175, 189, #209, #218, #247, #256, #264, #275, #284, #289, #296, #306, #355. - Bump mockito-inline from 3.4.4 to 4.8.0, #143, #148, #149, #152, #153, #154, #158, #159, #166, #177, #180, #187, #195, #197, #207, #216, #231, #236, #237, #243, #258, #259, #260, #261, #272, #285, #291, #305, #317, #330, #331, #347, #352. - Bump junit-jupiter from 5.6.2 to 5.9.1 #163, #204, #232, #265, #269, #288, #343, #357. - Bump assertj-core from 3.16.1 to 3.23.1 #151, #157, #160, #178, #184, #199, #244, #267, #294. - Bump commons-io from 2.7 to 2.11.0 #161 #251. - Bump commons-parent from 51 to 54 #145, #358. - Bump maven-pmd-plugin from 3.13.0 to 3.19.0 #186, #263, #302, #334, #349, #353. - Bump pmd from 6.42.0 to 6.46.0. - Bump graalvm.version from 20.2.0 to 22.0.0.2 #185, #198, #206, #227, #252, #276, #295, #300. - Bump commons.japicmp.version from 0.14.3 to 0.16.0. - Bump commons.jacoco.version 0.8.5 to 0.8.8; fixes Java 15 build. - Bump maven-checkstyle-plugin from 3.1.1 to 3.2.0 #202, #348. - Bump commons-lang3 3.11 -> 3.12.0. - Bump commons.javadoc.version from 3.2.0 to 3.4.1. - Bump commons.project-info.version from 3.1.0 to 3.1.2. - Bump jmh.version from 1.32 to 1.35 #254, #292, #313. - Bump commons-rng-simple from 1.3 to 1.4 #266. - Bump taglist-maven-plugin from 2.4 to 3.0.0 #297. - Bump commons.pmd-impl.version from 6.44.0 to 6.49.0 #323, #336, #345, #350. - Bump exec-maven-plugin from 3.0.0 to 3.1.0 #340. - - - Removed non-existing parameter from Javadocs and spelled out parameters in throws. - StringEscapeUtils.unescapeCsv doesn't remove quotes at begin and end of string. - ScriptStringLookup does not accept ":" #126. - StringSubstitutor incorrectly removes some escape characters. - Fix Javadocs #135. - Fix typos #137. - Make ConstantStringLookup.constantCache final #136. - Simplify if in CaseUtils #134. - [javadoc] Fix compiler warnings in Java code example in Javadoc #124. - Update from Apache Commons Lang 3.9 to 3.11. - Add StringMatcher.size(). - Refactor TextStringBuilder.readFrom(Readable), extracting readFrom(CharBuffer) and readFrom(Reader). - Add BiStringLookup and implementation BiFunctionStringLookup. - Add org.apache.commons.text.StringSubstitutor.StringSubstitutor(StringSubstitutor). - Add org.apache.commons.text.TextStringBuilder.TextStringBuilder(CharSequence). - Add org.apache.commons.text.TextStringBuilder.drainChar(int). - Add org.apache.commons.text.TextStringBuilder.drainChars(int, int, char[]. int). - Add org.apache.commons.text.TextStringBuilder.isNotEmpty(). - Add org.apache.commons.text.TextStringBuilder.isReallocated(). - Add org.apache.commons.text.TextStringBuilder.readFrom(Reader, int). - Add org.apache.commons.text.TextStringBuilder.set(String). - Add org.apache.commons.text.TextStringBuilder.wrap(char[]). - Add org.apache.commons.text.TextStringBuilder.wrap(char[], int). - Add org.apache.commons.text.io.StringSubstitutorReader. - Add org.apache.commons.text.lookup.StringLookupFactory.functionStringLookup(Function<String, V>). - Add org.apache.commons.text.matcher.StringMatcher.isMatch(CharSequence, int). - Add org.apache.commons.text.matcher.StringMatcher.isMatch(CharSequence, int, int, int). - Add org.apache.commons.text.matcher.StringMatcherFactory.andMatcher(StringMatcher...). - Add org.apache.commons.text.matcher.StringMatcherFactory.stringMatcher(char...). - [build] Skip clirr since we use JApiCmp. - [test] junit-jupiter 5.5.1 -> 5.5.2. - [test] org.assertj:assertj-core 3.13.2 -> 3.16.1. - [build] com.puppycrawl.tools:checkstyle 8.23 -> 8.34. - [build] Update JUnit from 5.5.2 to 5.6.2. - [build] commons.jacoco.version 0.8.4 -> 0.8.5. - [build] commons.javadoc.version 3.1.1 -> 3.2.0. - [build] commons.japicmp.version 0.14.1 -> 0.14.3. - [build] checkstyle.plugin.version 3.1.0 -> 3.1.1. - [build] checkstyle.version 8.27 -> 8.33. - [build] org.apache.commons:commons-parent 48 -> 51. - [build] maven-pmd-plugin 3.12.0 -> 3.13.0. - [build] org.mockito 3.3.3 -> 3.4.4. - - - - commons-text web page missing "RELEASE-NOTES-1.7.txt" - (doc) Fixed wrong value for Jaro-Winkler example #117 - Add helper factory method org.apache.commons.text.StringSubstitutor.createInterpolator(). - Add String lookup for host names and IP addresses (DnsStringLookup). - StringLookupFactory.addDefaultStringLookups(Map) does not convert keys to lower case. - Expand Javadoc for StringSubstitutor and friends. - [site] checkstyle.version 8.21 -> 8.23. - - - - WordUtils.wrap must calculate offset increment from wrapOn pattern length - Jaro Winkler Distance refers to similarity - Add an enum to the lookup package that lists all StringLookups - Add a toggle to throw an exception when a variable is unknown in StringSubstitutor - TextStringBuilder append sub-sequence not consistent with Appendable. - Fix possible infinite loop in WordUtils.wrap for a regex pattern that would trigger on a match of 0 length - Make prefixSet in LookupTranslator a BitSet - Fix the RegexTokenizer to use a static Pattern - Remove rounding from JaccardDistance and JaccardSimilarity - Fix the JaroWinklerSimilarity to use StringUtils.equals to test for CharSequence equality - Add a generic IntersectionSimilarity measure - Update Apache Commons Lang from 3.8.1 to 3.9. - ResourceBundleStringLookup.lookup(String) throws MissingResourceException instead of returning null. - Update tests from org.assertj:assertj-core 3.12.1 to 3.12.2. - Update site from com.puppycrawl.tools:checkstyle 8.18 to 8.21. - - - - Add the resource string bundle string lookup to the default set of lookups - Add StringLookupFactory methods for the URL encoder and decoder string lookups - org.apache.commons.text.lookup.StringLookupFactory.interpolatorStringLookup() should reuse a singleton instance - Add a Base64 encoder string lookup. - - - - Improve JaccardSimilarity computational cost - JSON escaping incorrect for the delete control character - Fixes JaroWinklerDistance: Wrong results due to precision of transpositions - JaroWinklerDistance: Calculation deviates from definition - Update Apache Commons Lang from 3.7 to 3.8.1 - Add a XML file XPath string lookup. - Add a Properties file string lookup. - Add a script string lookup. - Add a file string lookup. - Add a URL string lookup. - Add a Base64 string lookup. - Add org.apache.commons.text.lookup.StringLookupFactory.resourceBundleStringLookup(String). - Add URL encoder and decoder string lookups. - Add constant string lookup like the one in Apache Commons Configuration. - - - - StringEscapeUtils#unescapeJson does not unescape double quotes and forward slash - Remove mention of SQL escaping from user guide - Update Java requirement from version 7 to 8. - Allow full customization with new API org.apache.commons.text.lookup.StringLookupFactory.interpolatorStringLookup(Map<String, StringLookup>, StringLookup, boolean). - WordUtils.wrap throws StringIndexOutOfBoundsException when wrapLength is Integer.MAX_VALUE. - - - - Add Automatic-Module-Name MANIFEST entry for Java 9 compatibility - Build failure with java 9-ea+159 - Add an interpolator string lookup: StringLookupFactory#interpolatorStringLookup() - Add a StrSubstitutor replacement based on interfaces: StringSubstitutor - Add a StrBuilder replacement based on the StringMatcher interface: TextStringBuilder - Add a StrTokenizer replacement based on the StringMatcher interface: StringTokenizer - Add a local host string lookup: LocalHostStringLookup - StrLookup API confusing - - - - Upversion commons-lang to 3.7 - Exception thrown in ExtendedMessageFormat using quotes with custom registry - StringEscapeUtils#UnEscapeJson doesn't recognize escape signs correctly - StrSubstitutor: Ability to turn off substitution in values - RandomStringGenerator able to pass multiple ranges to .withinRange() - Deprecate isDelimiter and use HashSets for delimiter checks - WordUtils.initials support for UTF-16 surrogate pairs - WordUtils should treat an empty delimiter array as no delimiters - Update RandomStringGenerator to accept a list of valid characters - Add CharacterPredicates for ASCII letters (uppercase/lowercase) and arabic numerals - Added CaseUtils class with camel case conversion support - RandomStringGenerator should be able to generate a String with a random length - Update commons-lang dependency to version 3.6 - Document that commons-csv should be used in preference to CsvTranslators - NumericEntityUnescaper.options - fix TODO - RandomStringGenerator claims to be immutable, but isn't - Add StrLookup.resourceBundleLookup(ResourceBundle) - Typo in LongestCommonSubsequence#logestCommonSubsequence - - - - WordUtils should use toXxxxCase(int) rather than toXxxxCase(char) - WordUtils.abbreviate support - Putting WordUtils back in to the codebase - Add RandomStringGenerator - RandomStringGenerator: allow users to provide source of randomness - Correct round issue in Jaro Winkler implementation - Similar to LANG-1025, clirr fails site build. - - - + + Improve test coverage #732. + TextStringBuilder.append(char[], int, int) uses wrong variable in exception message #735. + + + Bump org.apache.commons:commons-parent from 93 to 97. + Bump the level of test coverage checks. + Bump commons.bytebuddy.version from 1.18.2 to 1.18.4 #734. + Bump commons.bytebuddy.version from 1.18.4 to 1.18.7. + + + + Fix exception message typo in XmlStringLookup.XmlStringLookup(Map, Path...). + Inserting at the end of a TextStringBuilder throws a StringIndexOutOfBoundsException. + Fix TextStringBuilderTest.testAppendToCharBuffer() to use proper argument type #724. + Fix Apache RAT plugin console warnings. + Fix site XML to use version 2.0.0 XML schema. + Removed unreachable threshold verification code in src/main/java/org/apache/commons/text/similarity #730. + Enable secure processing for the XML parser in XmlStringLookup in case the underlying JAXP implementation doesn't #729. + + Add experimental CycloneDX VEX file #683. + Add Damerau-Levenshtein distance #687. + Add unit tests to increase coverage #719. + Add new test for CharSequenceTranslator#with() #725. + Add tests and assertions to org.apache.commons.text.similarity to get to 100% code coverage #727, #728. + + Bump org.apache.commons:commons-parent from 85 to 93 #704, #723, #726. + Bump commons.bytebuddy.version from 1.17.6 to 1.18.2 #696, #722. + Bump graalvm.version from 24.2.2 to 25.0.1 #703, #716. + Bump org.apache.commons:commons-lang3 from 3.18.0 to 3.20.0. + Bump commons-io:commons-io from 2.20.0 to 2.21.0. + + + + Fix PMD UnnecessaryFullyQualifiedName in StringLookupFactory. + Fix PMD UnnecessaryFullyQualifiedName in DefaultStringLookupsHolder. + Fix PMD UnnecessaryFullyQualifiedName in PropertiesStringLookup. + Fix PMD UnnecessaryFullyQualifiedName in JavaPlatformStringLookup. + Fix PMD UnnecessaryFullyQualifiedName in StringSubstitutor. + Fix PMD UnnecessaryFullyQualifiedName in StrSubstitutor. + Fix PMD UnnecessaryFullyQualifiedName in AlphabetConverter. + Fix PMD AvoidBranchingStatementAsLastInLoop in TextStringBuilder. + Fix PMD AvoidBranchingStatementAsLastInLoop in StrBuilder. + org.apache.commons.text.translate.LookupTranslator.LookupTranslator(Map CharSequence>) now throws NullPointerException instead of java.security.InvalidParameterException. + + Interface StringLookup now extends UnaryOperator<String>. + Interface TextRandomProvider extends IntUnaryOperator. + Add RandomStringGenerator.Builder.usingRandom(IntUnaryOperator). + Add PMD check to default Maven goal. + Add org.apache.commons.text.RandomStringGenerator.Builder.setAccumulate(boolean). + + Bump org.apache.commons:commons-parent from 81 to 85 #668. + Bump commons-io:commons-io from 2.18.0 to 2.20.0. + Bump graalvm.version from 24.2.0 to 24.2.2 #665, #681. + Bump commons.bytebuddy.version from 1.17.5 to 1.17.6 (#677). + Bump org.apache.commons:commons-lang3 from 3.17.0 to 3.18.0 #680. + + + + Remove -nouses directive from maven-bundle-plugin. OSGi package imports now state 'uses' definitions for package imports, this doesn't affect JPMS (from org.apache.commons:commons-parent:80). + Deprecate EntityArrays.EntityArrays(). + StringLookupFactory.DefaultStringLookupsHolder.createDefaultStringLookups() maps DefaultStringLookup.LOCAL_HOST twice instead of once for LOCAL_HOST and LOOPBACK_ADDRESS. + + + Bump org.apache.commons:commons-parent from 79 to 81. + Bump commons.bytebuddy.version from 1.16.1 to 1.17.5 #643, #659, #660. + Bump graalvm.version from 24.1.2 to 24.2.0 #653. + + + + Add StringLookupFactory.loopbackAddressStringLookup(). + Add StringLookupFactory.KEY_LOOPBACK_ADDRESS. + Add DefaultStringLookup.LOOPBACK_ADDRESS. + Add richer inputs in package org.apache.commons.text.similarity with SimilarityInput. + Add HammingDistance.apply(SimilarityInput, SimilarityInput). + Add JaccardDistance.apply(SimilarityInput, SimilarityInput). + Add JaccardSimilarity.apply(SimilarityInput, SimilarityInput). + Add JaroWinklerDistance.apply(SimilarityInput, SimilarityInput). + Add JaroWinklerSimilarity.apply(SimilarityInput, SimilarityInput). + Add LevenshteinDetailedDistance.apply(SimilarityInput, SimilarityInput). + Add LevenshteinDistance.apply(SimilarityInput, SimilarityInput). + + Fix build on Java 22. + Fix build on Java 23-ea. + Make package-private constructor private: StrLookup.MapStrLookup.MapStrLookup(Map). + Make package-private constructor private: StrLookup.SystemPropertiesStrLookup.SystemPropertiesStrLookup(). + Make package-private class private and final: MapStrLookup. + Make package-private class private: StrMatcher.CharMatcher. + Make package-private class private: StrMatcher.CharSetMatcher. + Make package-private class private: StrMatcher.NoMatcher. + Make package-private class private: StrMatcher.StringMatcher. + Make package-private class private: StrMatcher.TrimMatcher. + Make package-private class private and final: IntersectionSimilarity.BagCount. + Make package-private class private and final: IntersectionSimilarity.TinyCount. + Deprecate LevenshteinDistance.LevenshteinDistance() in favor of LevenshteinDistance.getDefaultInstance(). + Deprecate LevenshteinDetailedDistance.LevenshteinDetailedDistance() in favor of LevenshteinDetailedDistance.getDefaultInstance(). + Improve StrBuilder documentation for new line text. + Improve TextStringBuilder documentation for new line text #547. + Required OSGi Import-Package version numbers in MANIFEST.MF #627. + + Bump org.apache.commons:commons-parent from 69 to 78 #542, #557, #571, #581, #584, #593, #600, #603, #614. + Bump tests on Java >= 22 org.graalvm.*:* from 24.0.0 to 24.1.1 #592, #610. + Bump commons.bytebuddy.version from 1.14.13 to 1.16.1 #538, #548, #553, #565, #579, #582, #585, #596, #597, #604, #612, #620, #623, #625, #640. + Bump SpotBugs from 4.8.3 to 4.8.5. + Bump org.assertj:assertj-core from 3.25.3 to 3.26.3 #554, #566. + Bump org.codehaus.mojo:taglist-maven-plugin from 3.0.0 to 3.2.1 #564, #611. + Bump org.apache.commons:commons-rng-simple from 1.5 to 1.6 #568. + Bump org.apache.commons:commons-lang3 from 3.14.0 to 3.17.0 #569, #575, #586. + Bump commons-io:commons-io from 2.16.1 to 2.18.0 #594, #628. + + + + Add StringLookupFactory.fileStringLookup(Path...) and deprecated fileStringLookup(). + Add StringLookupFactory.propertiesStringLookup(Path...) and deprecated propertiesStringLookup(). + Add StringLookupFactory.xmlStringLookup(Map, Path...) and deprecated xmlStringLookup() and xmlStringLookup(Map). + Add StringLookupFactory.builder() for fencing Path resolution of the file, properties and XML lookups. + Add DoubleFormat.Builder.get() as Builder now implements Supplier. + + WordUtils.containsAllWords​() may throw PatternSyntaxException. + Fix regression for determining whitespace in WordUtils #519. + Deprecate Builder in favor of Supplier. + + Bump commons-lang3 from 3.13.0 to 3.14.0. + Bump commons.bytebuddy.version from 1.14.9 to 1.14.13 #476, #482, #505, #521. + Bump org.codehaus.mojo:exec-maven-plugin from 3.1.0 to 3.2.0 #474, #508. + Bump commons-io from 2.15.0 to 2.16.1 #522, #527. + Bump commons-parent from 64 to 69 #524. + Bump org.assertj:assertj-core from 3.24.2 to 3.25.3. + + + + Fix StringTokenizer.getTokenList to return an independent modifiable list + Fix Javadoc for StringEscapeUtils.escapeHtml4 #382 + TextStringBuidler#hashCode() allocates a String on each call #387. + Fix Bundle-SymbolicName to use the package name org.apache.commons.text + Add and use a package-private singleton for RegexTokenizer. + Add and use a package-private singleton for CosineSimilarity. + Add and use a package-private singleton for LongestCommonSubsequence. + Add and use a package-private singleton for JaroWinklerSimilarity. + Add and use a package-private singleton for JaccardSimilarity. + [StepSecurity] ci: Harden GitHub Actions #428. + Improve AlphabetConverter Javadoc #429. + Fix exception message in IntersectionResult to make set-theoretic sense #438. + Add null-check in RandomStringGenerator#Builder#selectFrom() to avoid NullPointerException #434. + Add null-check in RandomStringGenerator#Builder#withinRange() to avoid NullPointerException. + Fix TextStringBuilder to over-allocate when ensuring capacity #452. + Constructor for ResourceBundleStringLookup should be private instead of package-private. + Constructor for UrlDecoderStringLookup should be private instead of package-private. + Constructor for UrlEncoderStringLookup should be private instead of package-private. + Javadoc of org.apache.commons.text.lookup.DefaultStringLookup.XML is incorrect. + Update DoubleFormat to state it is based on Double.toString. #467. + + Set SecureProcessing feature in XmlStringLookup by default. + Add StringLookupFactory.xmlStringLookup(Map<String, Boolean>...). + Add @FunctionalInterface to FormatFactory. + Add RandomStringGenerator.builder(). + Add XmlEncoderStringLookup/XmlDecoderStringLookup #449. + Add StringSubstitutor.toString(). + + Bump actions/cache. + Bump actions/setup-java. + Bump actions/checkout. + Bump pmd from 6.49.0 to 6.52.0 #364. + Bump commons-rng-simple from 1.4 to 1.5 #370. + Bump spotbugs-maven-plugin from 4.7.2.0 to 4.7.3.6 #371, #385. + Bump spotbugs from 4.7.2 to 4.7.3 #373. + Bump mockito-inline from 4.8.0 to 4.11.0 #380, #389, #396, #400. + Bump jmh.version from 1.35 to 1.37 #388. + Bump commons-parent from 54 to 64 #392, #401. + Bump assertj-core from 3.23.1 to 3.24.2 #405, #410. + Bump maven-checkstyle-plugin from 3.2.0 to 3.2.1 #407. + Bump commons-io from 2.11.0 to 2.15.0. + Bump commons-lang3 from 3.12.0 to 3.13.0. + + + + Fix CaseUtils when the input string contains only delimiters + Add GraalVM test dependencies to fix test failures with Java 15. + Incorrect values for Jaccard similarity with empty strings. + StringSubstitutor map constructor throws NPE on 1.9 with null map. + JaroWinklerDistance returns the same values as JaroWinklerSimilarity. + Correct Javadoc in FileStringLookup. + Minor Improvements #192, #196. + Use StringUtils.INDEX_NOT_FOUND constant. + Remove redundant local variable. + Replace lambda with method reference. + Simplify statements. + Replace statement lambda with expression lambda. + Use static class inner class in tests. + Simplify assertion. + Extract duplicate code. + Set void return method. + Remove unused exception from TextStringBuilder.readFrom(CharBuffer). This preserves binary compatibility but not source compatibility. + StrBuilder.StrBuilderReader.skip(long): Throw an exception when an implicit narrowing conversion in a compound assignment would result in information loss or a numeric error such as an overflows. + TextStringBuilder.TextStringBuilderReader.skip(long): Throw an exception when an implicit narrowing conversion in a compound assignment would result in information loss or a numeric error such as an overflows. + TextStringBuilder.equals whatever the capacity is #281. + A More Efficient Implementation for Calculating Size of Longest Common Subsequence. + LookupTranslator returns count of chars consumed, not of codepoints consumed. + Use Math.min() call instead of doing it manually. #335. + TextStringBuilder: Throw OutOfMemoryError instead of NegativeArraySizeException. + TextStringBuilder: Can't grow to sizes up to Integer.MAX_VALUE. + Make default string lookups configurable via system property. Remove dns, url, and script lookups from defaults. If these lookups are required for use in StringSubstitutor.createInterpolator(), they must be enabled via system property. See StringLookupFactory for details. + + Add DoubleFormat utility. + Document negative limit for WordUtils abbreviate method + Speed up LevenshteinDistance with threshold by exiting early + Release Notes page hasn't been updated for 1.9 release yet. + Add StrBuilder.isNotEmpty(). + + Bump actions/setup-java from v1.4.0 to 3 #147, #156, #155, #172, #215, #314. + Bump github/codeql-action from 1 to 2 #319. + Bump checkstyle from 8.34 to 9.3, #141, #168, #182, #188, #193, #201, #208, #211, #228, #235, #245, #253, #255, #262, #270, #280, #287, #299, #315, #321. + Bump spotbugs-maven-plugin from 4.0.0 to 4.7.2.0, #144, #150, #167, #176, #194, #210, #223, #250, #268, #273, #277, #278, #286, #293, #303, #320, #325, #338, #344, #354. + Bump spotbugs from 4.1.3 to 4.7.2 #175, 189, #209, #218, #247, #256, #264, #275, #284, #289, #296, #306, #355. + Bump mockito-inline from 3.4.4 to 4.8.0, #143, #148, #149, #152, #153, #154, #158, #159, #166, #177, #180, #187, #195, #197, #207, #216, #231, #236, #237, #243, #258, #259, #260, #261, #272, #285, #291, #305, #317, #330, #331, #347, #352. + Bump junit-jupiter from 5.6.2 to 5.9.1 #163, #204, #232, #265, #269, #288, #343, #357. + Bump assertj-core from 3.16.1 to 3.23.1 #151, #157, #160, #178, #184, #199, #244, #267, #294. + Bump commons-io from 2.7 to 2.11.0 #161 #251. + Bump commons-parent from 51 to 54 #145, #358. + Bump maven-pmd-plugin from 3.13.0 to 3.19.0 #186, #263, #302, #334, #349, #353. + Bump pmd from 6.42.0 to 6.46.0. + Bump graalvm.version from 20.2.0 to 22.0.0.2 #185, #198, #206, #227, #252, #276, #295, #300. + Bump commons.japicmp.version from 0.14.3 to 0.16.0. + Bump commons.jacoco.version 0.8.5 to 0.8.8; fixes Java 15 build. + Bump maven-checkstyle-plugin from 3.1.1 to 3.2.0 #202, #348. + Bump commons-lang3 3.11 -> 3.12.0. + Bump commons.javadoc.version from 3.2.0 to 3.4.1. + Bump commons.project-info.version from 3.1.0 to 3.1.2. + Bump jmh.version from 1.32 to 1.35 #254, #292, #313. + Bump commons-rng-simple from 1.3 to 1.4 #266. + Bump taglist-maven-plugin from 2.4 to 3.0.0 #297. + Bump commons.pmd-impl.version from 6.44.0 to 6.49.0 #323, #336, #345, #350. + Bump exec-maven-plugin from 3.0.0 to 3.1.0 #340. + + + Removed non-existing parameter from Javadocs and spelled out parameters in throws. + StringEscapeUtils.unescapeCsv doesn't remove quotes at begin and end of string. + ScriptStringLookup does not accept ":" #126. + StringSubstitutor incorrectly removes some escape characters. + Fix Javadocs #135. + Fix typos #137. + Make ConstantStringLookup.constantCache final #136. + Simplify if in CaseUtils #134. + [javadoc] Fix compiler warnings in Java code example in Javadoc #124. + Update from Apache Commons Lang 3.9 to 3.11. + Add StringMatcher.size(). + Refactor TextStringBuilder.readFrom(Readable), extracting readFrom(CharBuffer) and readFrom(Reader). + Add BiStringLookup and implementation BiFunctionStringLookup. + Add org.apache.commons.text.StringSubstitutor.StringSubstitutor(StringSubstitutor). + Add org.apache.commons.text.TextStringBuilder.TextStringBuilder(CharSequence). + Add org.apache.commons.text.TextStringBuilder.drainChar(int). + Add org.apache.commons.text.TextStringBuilder.drainChars(int, int, char[]. int). + Add org.apache.commons.text.TextStringBuilder.isNotEmpty(). + Add org.apache.commons.text.TextStringBuilder.isReallocated(). + Add org.apache.commons.text.TextStringBuilder.readFrom(Reader, int). + Add org.apache.commons.text.TextStringBuilder.set(String). + Add org.apache.commons.text.TextStringBuilder.wrap(char[]). + Add org.apache.commons.text.TextStringBuilder.wrap(char[], int). + Add org.apache.commons.text.io.StringSubstitutorReader. + Add org.apache.commons.text.lookup.StringLookupFactory.functionStringLookup(Function<String, V>). + Add org.apache.commons.text.matcher.StringMatcher.isMatch(CharSequence, int). + Add org.apache.commons.text.matcher.StringMatcher.isMatch(CharSequence, int, int, int). + Add org.apache.commons.text.matcher.StringMatcherFactory.andMatcher(StringMatcher...). + Add org.apache.commons.text.matcher.StringMatcherFactory.stringMatcher(char...). + [build] Skip clirr since we use JApiCmp. + [test] junit-jupiter 5.5.1 -> 5.5.2. + [test] org.assertj:assertj-core 3.13.2 -> 3.16.1. + [build] com.puppycrawl.tools:checkstyle 8.23 -> 8.34. + [build] Update JUnit from 5.5.2 to 5.6.2. + [build] commons.jacoco.version 0.8.4 -> 0.8.5. + [build] commons.javadoc.version 3.1.1 -> 3.2.0. + [build] commons.japicmp.version 0.14.1 -> 0.14.3. + [build] checkstyle.plugin.version 3.1.0 -> 3.1.1. + [build] checkstyle.version 8.27 -> 8.33. + [build] org.apache.commons:commons-parent 48 -> 51. + [build] maven-pmd-plugin 3.12.0 -> 3.13.0. + [build] org.mockito 3.3.3 -> 3.4.4. + + + commons-text web page missing "RELEASE-NOTES-1.7.txt" + (doc) Fixed wrong value for Jaro-Winkler example #117 + Add helper factory method org.apache.commons.text.StringSubstitutor.createInterpolator(). + Add String lookup for host names and IP addresses (DnsStringLookup). + StringLookupFactory.addDefaultStringLookups(Map) does not convert keys to lower case. + Expand Javadoc for StringSubstitutor and friends. + [site] checkstyle.version 8.21 -> 8.23. + + + WordUtils.wrap must calculate offset increment from wrapOn pattern length + Jaro Winkler Distance refers to similarity + Add an enum to the lookup package that lists all StringLookups + Add a toggle to throw an exception when a variable is unknown in StringSubstitutor + TextStringBuilder append sub-sequence not consistent with Appendable. + Fix possible infinite loop in WordUtils.wrap for a regex pattern that would trigger on a match of 0 length + Make prefixSet in LookupTranslator a BitSet + Fix the RegexTokenizer to use a static Pattern + Remove rounding from JaccardDistance and JaccardSimilarity + Fix the JaroWinklerSimilarity to use StringUtils.equals to test for CharSequence equality + Add a generic IntersectionSimilarity measure + Update Apache Commons Lang from 3.8.1 to 3.9. + ResourceBundleStringLookup.lookup(String) throws MissingResourceException instead of returning null. + Update tests from org.assertj:assertj-core 3.12.1 to 3.12.2. + Update site from com.puppycrawl.tools:checkstyle 8.18 to 8.21. + + + Add the resource string bundle string lookup to the default set of lookups + Add StringLookupFactory methods for the URL encoder and decoder string lookups + org.apache.commons.text.lookup.StringLookupFactory.interpolatorStringLookup() should reuse a singleton instance + Add a Base64 encoder string lookup. + + + Improve JaccardSimilarity computational cost + JSON escaping incorrect for the delete control character + Fixes JaroWinklerDistance: Wrong results due to precision of transpositions + JaroWinklerDistance: Calculation deviates from definition + Update Apache Commons Lang from 3.7 to 3.8.1 + Add a XML file XPath string lookup. + Add a Properties file string lookup. + Add a script string lookup. + Add a file string lookup. + Add a URL string lookup. + Add a Base64 string lookup. + Add org.apache.commons.text.lookup.StringLookupFactory.resourceBundleStringLookup(String). + Add URL encoder and decoder string lookups. + Add constant string lookup like the one in Apache Commons Configuration. + + + StringEscapeUtils#unescapeJson does not unescape double quotes and forward slash + Remove mention of SQL escaping from user guide + Update Java requirement from version 7 to 8. + Allow full customization with new API org.apache.commons.text.lookup.StringLookupFactory.interpolatorStringLookup(Map<String, StringLookup>, StringLookup, boolean). + WordUtils.wrap throws StringIndexOutOfBoundsException when wrapLength is Integer.MAX_VALUE. + + + Add Automatic-Module-Name MANIFEST entry for Java 9 compatibility + Build failure with java 9-ea+159 + Add an interpolator string lookup: StringLookupFactory#interpolatorStringLookup() + Add a StrSubstitutor replacement based on interfaces: StringSubstitutor + Add a StrBuilder replacement based on the StringMatcher interface: TextStringBuilder + Add a StrTokenizer replacement based on the StringMatcher interface: StringTokenizer + Add a local host string lookup: LocalHostStringLookup + StrLookup API confusing + + + Upversion commons-lang to 3.7 + Exception thrown in ExtendedMessageFormat using quotes with custom registry + StringEscapeUtils#UnEscapeJson doesn't recognize escape signs correctly + StrSubstitutor: Ability to turn off substitution in values + RandomStringGenerator able to pass multiple ranges to .withinRange() + Deprecate isDelimiter and use HashSets for delimiter checks + WordUtils.initials support for UTF-16 surrogate pairs + WordUtils should treat an empty delimiter array as no delimiters + Update RandomStringGenerator to accept a list of valid characters + Add CharacterPredicates for ASCII letters (uppercase/lowercase) and arabic numerals + Added CaseUtils class with camel case conversion support + RandomStringGenerator should be able to generate a String with a random length + Update commons-lang dependency to version 3.6 + Document that commons-csv should be used in preference to CsvTranslators + NumericEntityUnescaper.options - fix TODO + RandomStringGenerator claims to be immutable, but isn't + Add StrLookup.resourceBundleLookup(ResourceBundle) + Typo in LongestCommonSubsequence#logestCommonSubsequence + + + WordUtils should use toXxxxCase(int) rather than toXxxxCase(char) + WordUtils.abbreviate support + Putting WordUtils back in to the codebase + Add RandomStringGenerator + RandomStringGenerator: allow users to provide source of randomness + Correct round issue in Jaro Winkler implementation + Similar to LANG-1025, clirr fails site build. + + - Investigate locale issue in ExtendedMessageFormatTest - Resolve PMD/CMD Violations - Escape HTML characters only once: revert - Fixing the 200 checkstyle errors present in 1.0-beta-1 - Mutable fields should be private - - - - Incorporate suggestions from RC2 into 1.0 release - Naming packages org.apache.commons.text.beta - Upgrading Jacoco for Java 9-ea compatibility. - Refactor EntityArrays to have unmodifiableMaps in leu of String[][] - Prepare site for 1.0 release - Move CvsTranslators out of StringEscapeUtils and make them DRY - Remove WordUtils to be added back in an upcoming 1.X release - Possible attacks through StringEscapeUtils.escapeEcmaScrip better javadoc - Remove RandomStringGenerator to be added back in the 1.1 release - Upgrade from commons-parent version 41 to version 42 - Escape HTML characters only once - Global vs local source of randomness - Fluent API in "RandomStringBuilder" - Fix JaroWinklerDistance in the manner of LUCENE-1297 - Add LCS similarity and distance - Add class to generate random strings - Unfinished class Javadoc for CosineDistance - Consolidating since tags at 1.0, removing deprecated methods - Add a builder to StringEscapeUtils - Add shell/XSI escape/unescape support - LevenshteinDistance reduce memory consumption - Remove org.apache.commons.text.names, for later release than 1.0 - Add Jaccard Index and Jaccard Distance - Move org.apache.commons.lang3.StringEscapeUtils.java into text - Moving from commons-lang, the package org.apache.commons.lang3.text - A more complex Levenshtein distance - Add coveralls and Travis.ci integration - Add alphabet converter - Create Commons Text logo - Improve HumanNameParser - IP clearance for the names package - Write user guide - Work on the string metric, distance, and similarity definitions for the project - Human name parser - Create StringDistanceFrom class that contains a StringMetric and the "left" side string. This would have a method that accepts the "right" side string to test. - Add Cosine Similarity and Cosine Distance - Change (R) StringMetric.compare(CS left, CS right) to "apply" so that it is consistent with BiFunction. - Allow extra information (e.g. Levenshtein threshold) to be stored as (final) fields in the StringMetric instance. - Port Myers algorithm from [collections] - Add Hamming distance - Incorporate String algorithms from Commons Lang - - + Investigate locale issue in ExtendedMessageFormatTest + Resolve PMD/CMD Violations + Escape HTML characters only once: revert + Fixing the 200 checkstyle errors present in 1.0-beta-1 + Mutable fields should be private + + + Incorporate suggestions from RC2 into 1.0 release + Naming packages org.apache.commons.text.beta + Upgrading Jacoco for Java 9-ea compatibility. + Refactor EntityArrays to have unmodifiableMaps in leu of String[][] + Prepare site for 1.0 release + Move CvsTranslators out of StringEscapeUtils and make them DRY + Remove WordUtils to be added back in an upcoming 1.X release + Possible attacks through StringEscapeUtils.escapeEcmaScrip better javadoc + Remove RandomStringGenerator to be added back in the 1.1 release + Upgrade from commons-parent version 41 to version 42 + Escape HTML characters only once + Global vs local source of randomness + Fluent API in "RandomStringBuilder" + Fix JaroWinklerDistance in the manner of LUCENE-1297 + Add LCS similarity and distance + Add class to generate random strings + Unfinished class Javadoc for CosineDistance + Consolidating since tags at 1.0, removing deprecated methods + Add a builder to StringEscapeUtils + Add shell/XSI escape/unescape support + LevenshteinDistance reduce memory consumption + Remove org.apache.commons.text.names, for later release than 1.0 + Add Jaccard Index and Jaccard Distance + Move org.apache.commons.lang3.StringEscapeUtils.java into text + Moving from commons-lang, the package org.apache.commons.lang3.text + A more complex Levenshtein distance + Add coveralls and Travis.ci integration + Add alphabet converter + Create Commons Text logo + Improve HumanNameParser + IP clearance for the names package + Write user guide + Work on the string metric, distance, and similarity definitions for the project + Human name parser + Create StringDistanceFrom class that contains a StringMetric and the "left" side string. This would have a method that accepts the "right" side string to test. + Add Cosine Similarity and Cosine Distance + Change (R) StringMetric.compare(CS left, CS right) to "apply" so that it is consistent with BiFunction. + Allow extra information (e.g. Levenshtein threshold) to be stored as (final) fields in the StringMetric instance. + Port Myers algorithm from [collections] + Add Hamming distance + Incorporate String algorithms from Commons Lang + diff --git a/src/changes/release-notes.vm b/src/changes/release-notes.vm index f6329b3dad..35e7a381b8 100644 --- a/src/changes/release-notes.vm +++ b/src/changes/release-notes.vm @@ -6,7 +6,7 @@ ## "License"); you may not use this file except in compliance ## with the License. You may obtain a copy of the License at ## -## http://www.apache.org/licenses/LICENSE-2.0 +## https://www.apache.org/licenses/LICENSE-2.0 ## ## Unless required by applicable law or agreed to in writing, ## software distributed under the License is distributed on an @@ -23,7 +23,7 @@ The ASF licenses this file to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 +https://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, @@ -31,11 +31,10 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. - ${project.name} ${version} Release Notes ------------------------------------------------- +---------------------------------------- -This document contains the release notes for the ${version} version of Apache Commons Text. +The ${developmentTeam} is pleased to announce the release of ${project.name} ${version}. $introduction.replaceAll("(? + diff --git a/src/conf/security/README.md b/src/conf/security/README.md new file mode 100644 index 0000000000..4ac566bc6a --- /dev/null +++ b/src/conf/security/README.md @@ -0,0 +1,61 @@ + + +# CycloneDX Documents for Apache Commons Text + +The Apache Commons Text project publishes multiple [CycloneDX](https://cyclonedx.org/) documents to help consumers assess the security of their applications using this library: + +## SBOM (Software Bill of Materials) + +Beginning with version `6.6.0`, Apache Commons Text publishes SBOMs in both **XML** and **JSON** formats to Maven Central. These documents describe all components and dependencies of the library, following standard Maven coordinates: + +* **Group ID:** `org.apache.commons` +* **Artifact ID:** `commons-text` +* **Classifier:** `cyclonedx` +* **Type:** `xml` or `json` + +Each SBOM lists the library’s required and optional dependencies, helping consumers analyze the software supply chain and manage dependency risk. + +> [!NOTE] +> The versions listed in the SBOM reflect the dependencies used during the build and test process for that specific release of Text. +> Your own project may use different versions depending on your dependency management configuration. + +## VEX (Vulnerability Exploitability eXchange) + +An experimental [VEX](https://cyclonedx.org/capabilities/vex/) document is also published: + +👉 [`https://raw.githubusercontent.com/apache/commons-text/refs/heads/master/src/conf/security/VEX.cyclonedx.xml`](VEX.cyclonedx.xml) + +This document provides information about the **exploitability of known vulnerabilities** in the **dependencies** of Apache Commons Text. + +### When is a dependency vulnerability exploitable? + +Because Apache Commons libraries (including Text) do **not** bundle their dependencies, a vulnerability in a dependency is only exploitable if **both** of the following conditions are true: + +1. The vulnerable dependency is included in the consuming project. +2. Apache Commons Text is explicitly listed as affected by the vulnerability. + +### Notes and Limitations + +* This VEX document is **experimental** and provided **as-is**. + The semantics of this document may change in the future. +* The **absence** of a vulnerability entry does **not** indicate that Text is unaffected. +* If a version of Text is not listed under the `affects` section of a vulnerability, that version may still be affected or not. +* Only the **latest major version** of Text is currently assessed for vulnerabilities. +* The `analysis` field in the VEX file uses **Markdown** formatting. + +For more information about CycloneDX, SBOMs, or VEX, visit [cyclonedx.org](https://cyclonedx.org/). diff --git a/src/conf/security/VEX.cyclonedx.xml b/src/conf/security/VEX.cyclonedx.xml new file mode 100644 index 0000000000..a347293699 --- /dev/null +++ b/src/conf/security/VEX.cyclonedx.xml @@ -0,0 +1,124 @@ + + + + + + + 2025-08-04T11:45:36Z + + org.apache.commons + commons-text + cpe:2.3:a:apache:commons_text:*:*:*:*:*:*:*:* + pkg:maven/org.apache.commons/commons-text?type=jar + + + The Apache Software Foundation + https://commons.apache.org + + Apache Commons PMC + dev@commons.apache.org + + + Apache Commons Security Team + security@commons.apache.org + + + + + + + CVE-2025-48924 + + + GHSA-j288-q9x7-2f5v + + https://github.com/advisories/GHSA-j288-q9x7-2f5v + + + + + exploitable + + update + + + CVE-2025-48924 is exploitable in Apache Commons Text versions 1.5 and later, but only when all the following conditions are met: + + * The consuming project includes a vulnerable version of Commons Lang on the classpath. + As of version `1.14.1`, Commons Text no longer references a vulnerable version of the `commons-lang3` library in its POM file. + * Unvalidated or unsanitized user input is passed to the `StringSubstitutor` or `StringLookup` classes. + * An interpolator lookup created via `StringLookupFactory.interpolatorLookup()` is used. + + If these conditions are satisfied, an attacker may cause an infinite loop by submitting a specially crafted input such as `${const:...}`. + + 2025-07-29T12:26:42Z + 2025-07-29T12:26:42Z + + + + main_component + + + + affected + + + + + + + + + + + + Apache Commons PMC + dev@commons.apache.org + + + 2025-07-29T12:26:42Z + + This document provides information about the **exploitability of known vulnerabilities** in the **dependencies** of Apache Commons Text. + + # When is a dependency vulnerability exploitable? + + Because Apache Commons libraries do **not** bundle their dependencies, a vulnerability in a dependency is only exploitable if **both** of the following conditions are true: + + 1. The vulnerable dependency is included in the consuming project. + 2. Apache Commons Text is explicitly listed as affected by the vulnerability. + + # Notes and Limitations + + * This VEX document is **experimental** and provided **as-is**. + The semantics of this document may change in the future. + * The **absence** of a vulnerability entry does **not** indicate that Text is unaffected. + * If a version of Text is not listed under the `affects` section of a vulnerability, that version may still be affected or not. + * Only the **latest major version** of Text is currently assessed for vulnerabilities. + * The `analysis` field in the VEX file uses **Markdown** formatting. + + + + diff --git a/src/conf/spotbugs-exclude-filter.xml b/src/conf/spotbugs-exclude-filter.xml index 21131a04ad..c2b01f6b36 100644 --- a/src/conf/spotbugs-exclude-filter.xml +++ b/src/conf/spotbugs-exclude-filter.xml @@ -7,7 +7,7 @@ (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 + https://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, @@ -19,38 +19,39 @@ xmlns="https://github.com/spotbugs/filter/3.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="https://github.com/spotbugs/filter/3.0.0 https://raw.githubusercontent.com/spotbugs/spotbugs/3.1.0/spotbugs/etc/findbugsfilter.xsd"> - - + + + + + + + - - - - @@ -62,14 +63,20 @@ - + - - + + - + + + + + + + diff --git a/src/main/java/org/apache/commons/text/AlphabetConverter.java b/src/main/java/org/apache/commons/text/AlphabetConverter.java index c15749e06a..3864ac6a7f 100644 --- a/src/main/java/org/apache/commons/text/AlphabetConverter.java +++ b/src/main/java/org/apache/commons/text/AlphabetConverter.java @@ -6,7 +6,7 @@ * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -82,8 +82,8 @@ public final class AlphabetConverter { /** * Creates new String that contains just the given code point. * - * @param i code point - * @return a new string with the new code point + * @param i code point. + * @return a new string with the new code point. * @see "http://www.oracle.com/us/technologies/java/supplementary-142654.html" */ private static String codePointToString(final int i) { @@ -96,8 +96,8 @@ private static String codePointToString(final int i) { /** * Converts characters to integers. * - * @param chars array of characters - * @return an equivalent array of integers + * @param chars array of characters. + * @return an equivalent array of integers. */ private static Integer[] convertCharsToIntegers(final Character[] chars) { if (ArrayUtils.isEmpty(chars)) { @@ -109,22 +109,19 @@ private static Integer[] convertCharsToIntegers(final Character[] chars) { } /** - * Creates an alphabet converter, for converting from the original alphabet, - * to the encoded alphabet, while leaving - * the characters in doNotEncode as they are (if possible). + * Creates an alphabet converter, for converting from the original alphabet, to the encoded alphabet, while leaving the characters in doNotEncode + * as they are (if possible). * - *

Duplicate letters in either original or encoding will be ignored.

+ *

+ * Duplicate letters in either original or encoding will be ignored. + *

* - * @param original an array of ints representing the original alphabet in - * code points - * @param encoding an array of ints representing the alphabet to be used for - * encoding, in code points - * @param doNotEncode an array of ints representing the chars to be encoded - * using the original alphabet - every char - * here must appear in both the previous params - * @return The AlphabetConverter - * @throws IllegalArgumentException if an AlphabetConverter cannot be - * constructed + * @param original an array of ints representing the original alphabet in code points. + * @param encoding an array of ints representing the alphabet to be used for encoding, in code points. + * @param doNotEncode an array of ints representing the chars to be encoded using the original alphabet - every char here must appear in both the previous + * params. + * @return The AlphabetConverter. + * @throws IllegalArgumentException if an AlphabetConverter cannot be constructed. */ public static AlphabetConverter createConverter( final Integer[] original, @@ -242,7 +239,7 @@ public static AlphabetConverter createConverterFromChars( final Character[] original, final Character[] encoding, final Character[] doNotEncode) { - return AlphabetConverter.createConverter( + return createConverter( convertCharsToIntegers(original), convertCharsToIntegers(encoding), convertCharsToIntegers(doNotEncode)); @@ -251,8 +248,8 @@ public static AlphabetConverter createConverterFromChars( /** * Creates a new converter from a map. * - * @param originalToEncoded a map returned from getOriginalToEncoded() - * @return The reconstructed AlphabetConverter + * @param originalToEncoded a map returned from getOriginalToEncoded(). + * @return The reconstructed AlphabetConverter. * @see AlphabetConverter#getOriginalToEncoded() */ public static AlphabetConverter createConverterFromMap(final Map originalToEncoded) { @@ -290,9 +287,9 @@ public static AlphabetConverter createConverterFromMap(final Map