* The above example converts {@code "UTF-8:SomePath"} to the UTF-8 contents of the file at {@code SomePath}.
*
+ *
+ * Public access is through {@link StringLookupFactory}.
+ *
*
+ * @see StringLookupFactory
* @since 1.5
*/
final class FileStringLookup extends AbstractPathFencedLookup {
diff --git a/src/main/java/org/apache/commons/text/lookup/FunctionStringLookup.java b/src/main/java/org/apache/commons/text/lookup/FunctionStringLookup.java
index 4a7123ea9b..07df1489ea 100644
--- a/src/main/java/org/apache/commons/text/lookup/FunctionStringLookup.java
+++ b/src/main/java/org/apache/commons/text/lookup/FunctionStringLookup.java
@@ -22,8 +22,12 @@
/**
* A function-based lookup where the request for a lookup is answered by applying that function with a key.
+ *
+ * Public access is through {@link StringLookupFactory}.
+ *
*
* @param A function's input type
+ * @see StringLookupFactory
* @since 1.9
*/
final class FunctionStringLookup extends AbstractStringLookup {
diff --git a/src/main/java/org/apache/commons/text/lookup/InetAddressKeys.java b/src/main/java/org/apache/commons/text/lookup/InetAddressKeys.java
index a188d4fd58..e7eee0136b 100644
--- a/src/main/java/org/apache/commons/text/lookup/InetAddressKeys.java
+++ b/src/main/java/org/apache/commons/text/lookup/InetAddressKeys.java
@@ -21,7 +21,11 @@
/**
* Constants for referring to {@link InetAddress} APIs.
+ *
+ * Public access is through {@link StringLookupFactory}.
+ *
*
+ * @see StringLookupFactory
* @since 1.8
*/
final class InetAddressKeys {
diff --git a/src/main/java/org/apache/commons/text/lookup/InetAddressStringLookup.java b/src/main/java/org/apache/commons/text/lookup/InetAddressStringLookup.java
index 346634cdcb..6d0183db9c 100644
--- a/src/main/java/org/apache/commons/text/lookup/InetAddressStringLookup.java
+++ b/src/main/java/org/apache/commons/text/lookup/InetAddressStringLookup.java
@@ -35,7 +35,11 @@
*
canonical-name: for the local canonical host name, for example {@code EXAMPLE.apache.org}.
*
address: for the local host address, for example {@code 192.168.56.1}.
*
+ *
+ * Public access is through {@link StringLookupFactory}.
+ *
* Uses the {@link StringLookupFactory default lookups}.
*
+ *
+ * Public access is through {@link StringLookupFactory}.
+ *
+ *
+ * @see StringLookupFactory
*/
final class InterpolatorStringLookup extends AbstractStringLookup {
diff --git a/src/main/java/org/apache/commons/text/lookup/JavaPlatformStringLookup.java b/src/main/java/org/apache/commons/text/lookup/JavaPlatformStringLookup.java
index da1048bbe6..734e2dd436 100644
--- a/src/main/java/org/apache/commons/text/lookup/JavaPlatformStringLookup.java
+++ b/src/main/java/org/apache/commons/text/lookup/JavaPlatformStringLookup.java
@@ -53,7 +53,11 @@
* The above examples convert {@code "version"} to the current VM version, for example,
* {@code "Java version 1.8.0_181"}.
*
+ *
+ * Public access is through {@link StringLookupFactory}.
+ *
- * The above examples convert {@code "HelloWorld!"} to {@code "SGVsbG9Xb3JsZCE="}.
+ * The examples above convert {@code "HelloWorld!"} to {@code "SGVsbG9Xb3JsZCE="}.
*
* Defines the singleton for this class.
*/
@@ -438,7 +438,7 @@ Map getDefaultStringLookups() {
* StringSubstitutor.createInterpolator().replace("... ${env:USER} ..."));
*
*
- * The above examples convert (on Linux) {@code "USER"} to the current user name. On Windows 10, you would use {@code "USERNAME"} to the same effect.
+ * The examples above convert (on Linux) {@code "USER"} to the current user name. On Windows 10, you would use {@code "USERNAME"} to the same effect.
*
- * The above examples convert {@code "yyyy-MM-dd"} to todays's date, for example, {@code "2019-08-04"}.
+ * The examples above convert {@code "yyyy-MM-dd"} to todays's date, for example, {@code "2019-08-04"}.
*
*
* @return The DateStringLookup singleton instance.
@@ -856,7 +856,7 @@ public StringLookup dateStringLookup() {
* new StringSubstitutor(variableResolver).replace("... ${dns:address|apache.org} ...");
*
*
- * The above examples convert {@code "address|apache.org"} to the IP address of {@code apache.org}.
+ * The examples above convert {@code "address|apache.org"} to the IP address of {@code apache.org}.
*
- * The above examples convert (on Linux) {@code "USER"} to the current user name. On Windows 10, you would use {@code "USERNAME"} to the same effect.
+ * The examples above convert (on Linux) {@code "USER"} to the current user name. On Windows 10, you would use {@code "USERNAME"} to the same effect.
*
- * The above examples convert {@code "UTF-8:com/domain/document.txt"} to the contents of the file.
+ * The examples above convert {@code "UTF-8:com/domain/document.txt"} to the contents of the file.
*
*
* @return a file StringLookup instance.
@@ -1017,7 +1017,7 @@ public StringLookup functionStringLookup(final Function function)
* StringSubstitutor.createInterpolator().replace("... ${sys:os.name}, ${env:USER} ..."));
*
*
- * The above examples convert {@code "${sys:os.name}, ${env:USER}"} to the OS name and Linux user name.
+ * The examples above convert {@code "${sys:os.name}, ${env:USER}"} to the OS name and Linux user name.
*
- * The above examples convert {@code "version"} to the current VM version, for example, {@code "Java version 1.8.0_181"}.
+ * The examples above convert {@code "version"} to the current VM version, for example, {@code "Java version 1.8.0_181"}.
*
- * The above examples convert {@code "canonical-name"} to the current host name, for example, {@code "EXAMPLE.apache.org"}.
+ * The examples above convert {@code "canonical-name"} to the current host name, for example, {@code "EXAMPLE.apache.org"}.
*
- * The above examples convert {@code "canonical-name"} to the current host name, for example, {@code "EXAMPLE.apache.org"}.
+ * The examples above convert {@code "canonical-name"} to the current host name, for example, {@code "EXAMPLE.apache.org"}.
*
*
* @return The InetAddressStringLookup singleton instance.
@@ -1195,13 +1195,13 @@ public StringLookup nullStringLookup() {
* if a lookup causes causes a path to resolve outside of these fences. Otherwise, the result is unfenced to preserved behavior from previous versions.
*
*
- * We looks up a value for the key in the format "DocumentPath::MyKey".
+ * We looks up a value for the key in the format {@code "DocumentPath::MyKey"}.
*
*
* Note the use of "::" instead of ":" to allow for "C:" drive letters in paths.
*
*
- * For example: "com/domain/document.properties::MyKey".
+ * For example: {@code "com/domain/document.properties::MyKey"}.
*
- * The above examples convert {@code "com/domain/document.properties::MyKey"} to the key value in the properties file at the path
- * "com/domain/document.properties".
+ * The examples above convert {@code "com/domain/document.properties::MyKey"} to the key value in the properties file at the path
+ * {@code "com/domain/document.properties"}.
*
- * The above examples convert {@code "com.domain.messages:MyKey"} to the key value in the resource bundle at {@code "com.domain.messages"}.
+ * The examples above convert {@code "com.domain.messages:MyKey"} to the key value in the resource bundle at {@code "com.domain.messages"}.
*
*
* @return The ResourceBundleStringLookup singleton instance.
@@ -1392,7 +1392,7 @@ public StringLookup resourceBundleStringLookup(final String bundleName) {
* String value = new StringSubstitutor(variableResolver).replace("${script:javascript:3 + 4}");
*
*
- * The above examples convert {@code "javascript:3 + 4"} to {@code "7"}.
+ * The examples above convert {@code "javascript:3 + 4"} to {@code "7"}.
*
- * The above examples convert {@code "os.name"} to the operating system name.
+ * The examples above convert {@code "os.name"} to the operating system name.
*
- * The above examples convert {@code "Hello World!"} to {@code "Hello%20World%21"}.
+ * The examples above convert {@code "Hello World!"} to {@code "Hello%20World%21"}.
*
*
* @return The UrlStringLookup singleton instance.
@@ -1528,7 +1528,7 @@ public StringLookup urlEncoderStringLookup() {
* String value = new StringSubstitutor(variableResolver).replace("${url:UTF-8:https://www.apache.org}");
*
*
- * The above examples convert {@code "UTF-8:https://www.apache.org"} to the contents of that page.
+ * The examples above convert {@code "UTF-8:https://www.apache.org"} to the contents of that page.
*
- * The above examples convert {@code "com/domain/document.xml:/path/to/node"} to the value of the XPath in the XML document.
+ * The examples above convert {@code "com/domain/document.xml:/path/to/node"} to the value of the XPath in the XML document.
*
*
* @return An XML StringLookup instance.
@@ -1648,10 +1648,10 @@ public StringLookup xmlStringLookup() {
* if a lookup causes causes a path to resolve outside of these fences. Otherwise, the result is unfenced to preserved behavior from previous versions.
*
*
- * We look up the value for the key in the format "DocumentPath:XPath".
+ * We look up the value for the key in the format {@code "DocumentPath:XPath"}.
*
*
- * For example: "com/domain/document.xml:/path/to/node".
+ * For example: {@code "com/domain/document.xml:/path/to/node"}.
*
*
* Using a {@link StringLookup} from the {@link StringLookupFactory}:
@@ -1668,7 +1668,7 @@ public StringLookup xmlStringLookup() {
* StringSubstitutor.createInterpolator().replace("... ${xml:com/domain/document.xml:/path/to/node} ..."));
*
*
- * The above examples convert {@code "com/domain/document.xml:/path/to/node"} to the value of the XPath in the XML document.
+ * The examples above convert {@code "com/domain/document.xml:/path/to/node"} to the value of the XPath in the XML document.
*
*
* @param xPathFactoryFeatures XPathFactory features to set.
@@ -1687,10 +1687,10 @@ public StringLookup xmlStringLookup(final Map xPathFactoryFeatu
* if a lookup causes causes a path to resolve outside of these fences. Otherwise, the result is unfenced to preserved behavior from previous versions.
*
*
- * We look up the value for the key in the format "DocumentPath:XPath".
+ * We look up the value for the key in the format {@code "DocumentPath:XPath"}.
*
*
- * For example: "com/domain/document.xml:/path/to/node".
+ * For example: {@code "com/domain/document.xml:/path/to/node"}.
*
*
* Using a {@link StringLookup} from the {@link StringLookupFactory} fenced by the current directory ({@code Paths.get("")}):
@@ -1713,7 +1713,7 @@ public StringLookup xmlStringLookup(final Map xPathFactoryFeatu
* StringLookupFactory.INSTANCE.xmlStringLookup(Paths.get("")).lookup("../com/domain/document.xml:/path/to/node");
*
*
- * The above examples convert {@code "com/domain/document.xml:/path/to/node"} to the value of the XPath in the XML document.
+ * The examples above convert {@code "com/domain/document.xml:/path/to/node"} to the value of the XPath in the XML document.
*
*
* {@link StringSubstitutor} methods like {@link StringSubstitutor#replace(String)} will throw a {@link IllegalArgumentException} when a file doesn't
From 3e883ed1d3fff96db53480c2d351a6655de1dae7 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Fri, 29 Aug 2025 16:11:13 -0400
Subject: [PATCH 003/188] Bump actions/dependency-review-action from 4.7.2 to
4.7.3 (#698)
Bumps [actions/dependency-review-action](https://github.com/actions/dependency-review-action) from 4.7.2 to 4.7.3.
- [Release notes](https://github.com/actions/dependency-review-action/releases)
- [Commits](https://github.com/actions/dependency-review-action/compare/bc41886e18ea39df68b1b1245f4184881938e050...595b5aeba73380359d98a5e087f648dbb0edce1b)
---
updated-dependencies:
- dependency-name: actions/dependency-review-action
dependency-version: 4.7.3
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
.github/workflows/dependency-review.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.github/workflows/dependency-review.yml b/.github/workflows/dependency-review.yml
index daed9687ff..1e04392423 100644
--- a/.github/workflows/dependency-review.yml
+++ b/.github/workflows/dependency-review.yml
@@ -28,4 +28,4 @@ jobs:
- name: 'Checkout Repository'
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- name: 'Dependency Review PR'
- uses: actions/dependency-review-action@bc41886e18ea39df68b1b1245f4184881938e050 # v4.7.2
+ uses: actions/dependency-review-action@595b5aeba73380359d98a5e087f648dbb0edce1b # v4.7.3
From 5ba7929668286593db244bf888e4c94b53d41b21 Mon Sep 17 00:00:00 2001
From: "Gary D. Gregory"
Date: Sat, 30 Aug 2025 13:29:59 -0400
Subject: [PATCH 004/188] Remove trailing whitespace
---
src/conf/spotbugs-exclude-filter.xml | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/conf/spotbugs-exclude-filter.xml b/src/conf/spotbugs-exclude-filter.xml
index d918d9f0f8..546e6193a4 100644
--- a/src/conf/spotbugs-exclude-filter.xml
+++ b/src/conf/spotbugs-exclude-filter.xml
@@ -63,14 +63,14 @@
-
+
-
-
+
+
-
+
From 53cf6ece273622821c5aa13444800ba94a69be55 Mon Sep 17 00:00:00 2001
From: "Gary D. Gregory"
Date: Sat, 30 Aug 2025 13:34:54 -0400
Subject: [PATCH 005/188] [TEXT-236] Inserting at end of a TextStringBuilder
throws a StringIndexOutOfBoundsException
---
src/changes/changes.xml | 1 +
src/conf/spotbugs-exclude-filter.xml | 6 +++
.../commons/text/TextStringBuilder.java | 14 +++---
.../TextStringBuilderAppendInsertTest.java | 46 +++++++++++++++++++
4 files changed, 60 insertions(+), 7 deletions(-)
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index df97b651b1..362314fa01 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -48,6 +48,7 @@ The type attribute can be add,update,fix,remove.
Fix exception message typo in XmlStringLookup.XmlStringLookup(Map, Path...).
+ Inserting at end of a TextStringBuilder throws a StringIndexOutOfBoundsException.Add experimental CycloneDX VEX file #683.
diff --git a/src/conf/spotbugs-exclude-filter.xml b/src/conf/spotbugs-exclude-filter.xml
index 546e6193a4..c2b01f6b36 100644
--- a/src/conf/spotbugs-exclude-filter.xml
+++ b/src/conf/spotbugs-exclude-filter.xml
@@ -73,4 +73,10 @@
+
+
+
+
+
+
diff --git a/src/main/java/org/apache/commons/text/TextStringBuilder.java b/src/main/java/org/apache/commons/text/TextStringBuilder.java
index 1f194220fe..503bb0567f 100644
--- a/src/main/java/org/apache/commons/text/TextStringBuilder.java
+++ b/src/main/java/org/apache/commons/text/TextStringBuilder.java
@@ -2190,7 +2190,7 @@ public int indexOf(final StringMatcher matcher, int startIndex) {
* @throws IndexOutOfBoundsException if the index is invalid
*/
public TextStringBuilder insert(final int index, final boolean value) {
- validateIndex(index);
+ validateRange(index, size);
if (value) {
ensureCapacityInternal(size + TRUE_STRING_SIZE);
System.arraycopy(buffer, index, buffer, index + TRUE_STRING_SIZE, size - index);
@@ -2212,7 +2212,7 @@ public TextStringBuilder insert(final int index, final boolean value) {
* @throws IndexOutOfBoundsException if the index is invalid
*/
public TextStringBuilder insert(final int index, final char value) {
- validateIndex(index);
+ validateRange(index, size);
ensureCapacityInternal(size + 1);
System.arraycopy(buffer, index, buffer, index + 1, size - index);
buffer[index] = value;
@@ -2229,7 +2229,7 @@ public TextStringBuilder insert(final int index, final char value) {
* @throws IndexOutOfBoundsException if the index is invalid
*/
public TextStringBuilder insert(final int index, final char[] chars) {
- validateIndex(index);
+ validateRange(index, size);
if (chars == null) {
return insert(index, nullText);
}
@@ -2254,7 +2254,7 @@ public TextStringBuilder insert(final int index, final char[] chars) {
* @throws IndexOutOfBoundsException if any index is invalid
*/
public TextStringBuilder insert(final int index, final char[] chars, final int offset, final int length) {
- validateIndex(index);
+ validateRange(index, size);
if (chars == null) {
return insert(index, nullText);
}
@@ -2346,7 +2346,7 @@ public TextStringBuilder insert(final int index, final Object obj) {
* @throws IndexOutOfBoundsException if the index is invalid
*/
public TextStringBuilder insert(final int index, String str) {
- validateIndex(index);
+ validateRange(index, size);
if (str == null) {
str = nullText;
}
@@ -3208,10 +3208,10 @@ public TextStringBuilder trim() {
}
/**
- * Validates that an index is in the range {@code 0 <= index <= size}.
+ * Validates that an index is in the range {@code 0 <= index < size}.
*
* @param index the index to test.
- * @throws IndexOutOfBoundsException Thrown when the index is not the range {@code 0 <= index <= size}.
+ * @throws IndexOutOfBoundsException Thrown when the index is not the range {@code 0 <= index < size}.
*/
protected void validateIndex(final int index) {
if (index < 0 || index >= size) {
diff --git a/src/test/java/org/apache/commons/text/TextStringBuilderAppendInsertTest.java b/src/test/java/org/apache/commons/text/TextStringBuilderAppendInsertTest.java
index 6d7a33c13d..51e431f57c 100644
--- a/src/test/java/org/apache/commons/text/TextStringBuilderAppendInsertTest.java
+++ b/src/test/java/org/apache/commons/text/TextStringBuilderAppendInsertTest.java
@@ -1133,6 +1133,52 @@ void testInsert() {
assertEquals("4.5barbaz", sb.toString());
}
+ @Test
+ void testInsertAtEnd() {
+ final TextStringBuilder sb = new TextStringBuilder();
+ assertEquals("", sb.toString());
+ sb.insert(0, "Hello");
+ assertEquals("Hello", sb.toString());
+ assertThrows(IndexOutOfBoundsException.class, () -> sb.insert(-1, "World"));
+ assertThrows(IndexOutOfBoundsException.class, () -> sb.insert(6, "World"));
+ sb.insert(5, true);
+ assertEquals("Hellotrue", sb.toString());
+ assertThrows(IndexOutOfBoundsException.class, () -> sb.insert(10, false));
+ assertThrows(IndexOutOfBoundsException.class, () -> sb.insert(-20, false));
+ sb.insert(9, 'A');
+ assertEquals("HellotrueA", sb.toString());
+ assertThrows(IndexOutOfBoundsException.class, () -> sb.insert(11, 'B'));
+ assertThrows(IndexOutOfBoundsException.class, () -> sb.insert(-2, 'B'));
+ sb.insert(10, new char[] { 'B', 'C' });
+ assertEquals("HellotrueABC", sb.toString());
+ assertThrows(IndexOutOfBoundsException.class, () -> sb.insert(13, new char[] { 'D', 'E' }));
+ assertThrows(IndexOutOfBoundsException.class, () -> sb.insert(-1, new char[] { 'D', 'E' }));
+ sb.insert(12, new char[] { 'D', 'E', 'F' }, 1, 1);
+ assertEquals("HellotrueABCE", sb.toString());
+ assertThrows(IndexOutOfBoundsException.class, () -> sb.insert(14, new char[] { 'G', 'H', 'I' }, 1, 2));
+ assertThrows(IndexOutOfBoundsException.class, () -> sb.insert(-1, new char[] { 'G', 'H', 'I' }, 1, 1));
+ sb.insert(13, 1.2d);
+ assertEquals("HellotrueABCE1.2", sb.toString());
+ assertThrows(IndexOutOfBoundsException.class, () -> sb.insert(17, 1.3d));
+ assertThrows(IndexOutOfBoundsException.class, () -> sb.insert(-1, 1.3d));
+ sb.insert(16, 1f);
+ assertEquals("HellotrueABCE1.21.0", sb.toString());
+ assertThrows(IndexOutOfBoundsException.class, () -> sb.insert(20, 1.3f));
+ assertThrows(IndexOutOfBoundsException.class, () -> sb.insert(-3, 1.3f));
+ sb.insert(19, 23);
+ assertEquals("HellotrueABCE1.21.023", sb.toString());
+ assertThrows(IndexOutOfBoundsException.class, () -> sb.insert(22, 20));
+ assertThrows(IndexOutOfBoundsException.class, () -> sb.insert(-5, -5));
+ sb.insert(21, 99L);
+ assertEquals("HellotrueABCE1.21.02399", sb.toString());
+ assertThrows(IndexOutOfBoundsException.class, () -> sb.insert(24, 22L));
+ assertThrows(IndexOutOfBoundsException.class, () -> sb.insert(-1, -1L));
+ sb.insert(23, FOO);
+ assertEquals("HellotrueABCE1.21.02399foo", sb.toString());
+ assertThrows(IndexOutOfBoundsException.class, () -> sb.insert(27, FOO));
+ assertThrows(IndexOutOfBoundsException.class, () -> sb.insert(-3, FOO));
+ }
+
@Test
void testInsertWithNullText() {
final TextStringBuilder sb = new TextStringBuilder();
From ac0c6d63ca83a67e88cb0b4c0e1cb580e0ea191e Mon Sep 17 00:00:00 2001
From: "Gary D. Gregory"
Date: Sat, 30 Aug 2025 13:35:27 -0400
Subject: [PATCH 006/188] [TEXT-236] Inserting at end of a TextStringBuilder
throws a StringIndexOutOfBoundsException
---
src/changes/changes.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index 362314fa01..4366dbe10e 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -48,7 +48,7 @@ The type attribute can be add,update,fix,remove.
Fix exception message typo in XmlStringLookup.XmlStringLookup(Map, Path...).
- Inserting at end of a TextStringBuilder throws a StringIndexOutOfBoundsException.
+ Inserting at end of a TextStringBuilder throws a StringIndexOutOfBoundsException.Add experimental CycloneDX VEX file #683.
From 125a97f00d275c431abafff6a38b869e272be1cb Mon Sep 17 00:00:00 2001
From: "Gary D. Gregory"
Date: Sat, 30 Aug 2025 13:39:51 -0400
Subject: [PATCH 007/188] User ternary expression
---
.../java/org/apache/commons/text/TextStringBuilder.java | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/src/main/java/org/apache/commons/text/TextStringBuilder.java b/src/main/java/org/apache/commons/text/TextStringBuilder.java
index 503bb0567f..dcf816f90e 100644
--- a/src/main/java/org/apache/commons/text/TextStringBuilder.java
+++ b/src/main/java/org/apache/commons/text/TextStringBuilder.java
@@ -1185,13 +1185,10 @@ public TextStringBuilder appendNewLine() {
/**
* Appends the text representing {@code null} to this string builder.
*
- * @return this, to enable chaining
+ * @return this, to enable chaining.
*/
public TextStringBuilder appendNull() {
- if (nullText == null) {
- return this;
- }
- return append(nullText);
+ return nullText != null ? append(nullText) : this;
}
/**
From b55435665f8c4a051f1407118bfa17ed176793b2 Mon Sep 17 00:00:00 2001
From: "Gary D. Gregory"
Date: Sat, 30 Aug 2025 13:41:15 -0400
Subject: [PATCH 008/188] Use Objects.toString()
---
.../org/apache/commons/text/TextStringBuilder.java | 13 +++++--------
1 file changed, 5 insertions(+), 8 deletions(-)
diff --git a/src/main/java/org/apache/commons/text/TextStringBuilder.java b/src/main/java/org/apache/commons/text/TextStringBuilder.java
index dcf816f90e..a7db693c2a 100644
--- a/src/main/java/org/apache/commons/text/TextStringBuilder.java
+++ b/src/main/java/org/apache/commons/text/TextStringBuilder.java
@@ -2322,16 +2322,13 @@ public TextStringBuilder insert(final int index, final long value) {
* Inserts the string representation of an object into this builder. Inserting null will use the stored null text
* value.
*
- * @param index the index to add at, must be valid
- * @param obj the object to insert
- * @return this, to enable chaining
- * @throws IndexOutOfBoundsException if the index is invalid
+ * @param index the index to add at, must be valid.
+ * @param obj the object to insert.
+ * @return this, to enable chaining.
+ * @throws IndexOutOfBoundsException if the index is invalid.
*/
public TextStringBuilder insert(final int index, final Object obj) {
- if (obj == null) {
- return insert(index, nullText);
- }
- return insert(index, obj.toString());
+ return insert(index, Objects.toString(obj, nullText));
}
/**
From 0c3cadeeda1aa01869e1d5f72c25e6176121c11e Mon Sep 17 00:00:00 2001
From: "Gary D. Gregory"
Date: Sat, 30 Aug 2025 14:03:06 -0400
Subject: [PATCH 009/188] Use fluent APIs and ternary expressions
---
.../commons/text/TextStringBuilder.java | 51 ++++---------------
1 file changed, 10 insertions(+), 41 deletions(-)
diff --git a/src/main/java/org/apache/commons/text/TextStringBuilder.java b/src/main/java/org/apache/commons/text/TextStringBuilder.java
index a7db693c2a..40d53b1bf4 100644
--- a/src/main/java/org/apache/commons/text/TextStringBuilder.java
+++ b/src/main/java/org/apache/commons/text/TextStringBuilder.java
@@ -114,10 +114,7 @@ public boolean markSupported() {
/** {@inheritDoc} */
@Override
public int read() {
- if (!ready()) {
- return -1;
- }
- return charAt(pos++);
+ return ready() ? charAt(pos++) : -1;
}
/** {@inheritDoc} */
@@ -181,10 +178,7 @@ final class TextStringBuilderTokenizer extends StringTokenizer {
@Override
public String getContent() {
final String str = super.getContent();
- if (str == null) {
- return TextStringBuilder.this.toString();
- }
- return str;
+ return str != null ? str : TextStringBuilder.this.toString();
}
/** {@inheritDoc} */
@@ -1175,11 +1169,7 @@ public TextStringBuilder appendln(final TextStringBuilder str, final int startIn
* @see #setNewLineText(String)
*/
public TextStringBuilder appendNewLine() {
- if (newLine == null) {
- append(System.lineSeparator());
- return this;
- }
- return append(newLine);
+ return append(newLine == null ? System.lineSeparator() : newLine);
}
/**
@@ -1229,10 +1219,7 @@ public TextStringBuilder appendPadding(final int length, final char padChar) {
* @return this, to enable chaining
*/
public TextStringBuilder appendSeparator(final char separator) {
- if (isNotEmpty()) {
- append(separator);
- }
- return this;
+ return isEmpty() ? this : append(separator);
}
/**
@@ -1246,12 +1233,7 @@ public TextStringBuilder appendSeparator(final char separator) {
* @return this, to enable chaining
*/
public TextStringBuilder appendSeparator(final char standard, final char defaultIfEmpty) {
- if (isEmpty()) {
- append(defaultIfEmpty);
- } else {
- append(standard);
- }
- return this;
+ return append(isEmpty() ? defaultIfEmpty : standard);
}
/**
@@ -1277,10 +1259,7 @@ public TextStringBuilder appendSeparator(final char standard, final char default
* @return this, to enable chaining
*/
public TextStringBuilder appendSeparator(final char separator, final int loopIndex) {
- if (loopIndex > 0) {
- append(separator);
- }
- return this;
+ return loopIndex > 0 ? append(separator) : this;
}
/**
@@ -1331,10 +1310,7 @@ public TextStringBuilder appendSeparator(final String separator) {
* @return this, to enable chaining
*/
public TextStringBuilder appendSeparator(final String separator, final int loopIndex) {
- if (separator != null && loopIndex > 0) {
- append(separator);
- }
- return this;
+ return separator != null && loopIndex > 0 ? append(separator) : this;
}
/**
@@ -1366,10 +1342,7 @@ public TextStringBuilder appendSeparator(final String separator, final int loopI
*/
public TextStringBuilder appendSeparator(final String standard, final String defaultIfEmpty) {
final String str = isEmpty() ? defaultIfEmpty : standard;
- if (str != null) {
- append(str);
- }
- return this;
+ return str != null ? append(str) : this;
}
/**
@@ -1454,8 +1427,7 @@ public TextStringBuilder appendWithSeparators(final Object[] array, final String
final String sep = Objects.toString(separator, StringUtils.EMPTY);
append(array[0]);
for (int i = 1; i < array.length; i++) {
- append(sep);
- append(array[i]);
+ append(sep).append(array[i]);
}
}
return this;
@@ -2925,7 +2897,6 @@ public TextStringBuilder reverse() {
if (size == 0) {
return this;
}
-
final int half = size / 2;
final char[] buf = buffer;
for (int leftIdx = 0, rightIdx = size - 1; leftIdx < half; leftIdx++, rightIdx--) {
@@ -2966,9 +2937,7 @@ public String rightString(final int length) {
* @since 1.9
*/
public TextStringBuilder set(final CharSequence str) {
- clear();
- append(str);
- return this;
+ return clear().append(str);
}
/**
From c8058b8353ea0b0d7009dec0c0d7dc7eb5f37c9d Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Fri, 5 Sep 2025 13:34:53 -0700
Subject: [PATCH 010/188] Bump github/codeql-action from 3.29.11 to 3.30.1
(#700)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.29.11 to 3.30.1.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/3c3833e0f8c1c83d449a7478aa59c036a9165498...f1f6e5f6af878fb37288ce1c627459e94dbf7d01)
---
updated-dependencies:
- dependency-name: github/codeql-action
dependency-version: 3.30.1
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
.github/workflows/codeql-analysis.yml | 6 +++---
.github/workflows/scorecards-analysis.yml | 2 +-
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml
index 36b2f321b5..69e3507492 100644
--- a/.github/workflows/codeql-analysis.yml
+++ b/.github/workflows/codeql-analysis.yml
@@ -57,7 +57,7 @@ jobs:
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
- uses: github/codeql-action/init@3c3833e0f8c1c83d449a7478aa59c036a9165498 # 3.29.5
+ uses: github/codeql-action/init@f1f6e5f6af878fb37288ce1c627459e94dbf7d01 # 3.29.5
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
@@ -68,7 +68,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@3c3833e0f8c1c83d449a7478aa59c036a9165498 # 3.29.5
+ uses: github/codeql-action/autobuild@f1f6e5f6af878fb37288ce1c627459e94dbf7d01 # 3.29.5
# âšī¸ Command-line programs to run using the OS shell.
# đ https://git.io/JvXDl
@@ -82,4 +82,4 @@ jobs:
# make release
- name: Perform CodeQL Analysis
- uses: github/codeql-action/analyze@3c3833e0f8c1c83d449a7478aa59c036a9165498 # 3.29.5
+ uses: github/codeql-action/analyze@f1f6e5f6af878fb37288ce1c627459e94dbf7d01 # 3.29.5
diff --git a/.github/workflows/scorecards-analysis.yml b/.github/workflows/scorecards-analysis.yml
index f5ac42eaa8..ef4beb910d 100644
--- a/.github/workflows/scorecards-analysis.yml
+++ b/.github/workflows/scorecards-analysis.yml
@@ -64,6 +64,6 @@ jobs:
retention-days: 5
- name: "Upload to code-scanning"
- uses: github/codeql-action/upload-sarif@3c3833e0f8c1c83d449a7478aa59c036a9165498 # 3.29.5
+ uses: github/codeql-action/upload-sarif@f1f6e5f6af878fb37288ce1c627459e94dbf7d01 # 3.29.5
with:
sarif_file: results.sarif
From 5d356fd01d231dd27dd7c38cb98761343d364075 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Fri, 12 Sep 2025 17:12:30 -0400
Subject: [PATCH 011/188] Bump github/codeql-action from 3.30.1 to 3.30.3
(#702)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.30.1 to 3.30.3.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/f1f6e5f6af878fb37288ce1c627459e94dbf7d01...192325c86100d080feab897ff886c34abd4c83a3)
---
updated-dependencies:
- dependency-name: github/codeql-action
dependency-version: 3.30.3
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
.github/workflows/codeql-analysis.yml | 6 +++---
.github/workflows/scorecards-analysis.yml | 2 +-
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml
index 69e3507492..e61f02688c 100644
--- a/.github/workflows/codeql-analysis.yml
+++ b/.github/workflows/codeql-analysis.yml
@@ -57,7 +57,7 @@ jobs:
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
- uses: github/codeql-action/init@f1f6e5f6af878fb37288ce1c627459e94dbf7d01 # 3.29.5
+ uses: github/codeql-action/init@192325c86100d080feab897ff886c34abd4c83a3 # 3.29.5
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
@@ -68,7 +68,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@f1f6e5f6af878fb37288ce1c627459e94dbf7d01 # 3.29.5
+ uses: github/codeql-action/autobuild@192325c86100d080feab897ff886c34abd4c83a3 # 3.29.5
# âšī¸ Command-line programs to run using the OS shell.
# đ https://git.io/JvXDl
@@ -82,4 +82,4 @@ jobs:
# make release
- name: Perform CodeQL Analysis
- uses: github/codeql-action/analyze@f1f6e5f6af878fb37288ce1c627459e94dbf7d01 # 3.29.5
+ uses: github/codeql-action/analyze@192325c86100d080feab897ff886c34abd4c83a3 # 3.29.5
diff --git a/.github/workflows/scorecards-analysis.yml b/.github/workflows/scorecards-analysis.yml
index ef4beb910d..9f6e1fd0c2 100644
--- a/.github/workflows/scorecards-analysis.yml
+++ b/.github/workflows/scorecards-analysis.yml
@@ -64,6 +64,6 @@ jobs:
retention-days: 5
- name: "Upload to code-scanning"
- uses: github/codeql-action/upload-sarif@f1f6e5f6af878fb37288ce1c627459e94dbf7d01 # 3.29.5
+ uses: github/codeql-action/upload-sarif@192325c86100d080feab897ff886c34abd4c83a3 # 3.29.5
with:
sarif_file: results.sarif
From d454232e0bb4efb973378180c8ba234087b7dddb Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Fri, 19 Sep 2025 17:21:29 -0400
Subject: [PATCH 012/188] Bump graalvm.version from 24.2.2 to 25.0.0 (#703)
Bumps `graalvm.version` from 24.2.2 to 25.0.0.
Updates `org.graalvm.js:js` from 24.2.2 to 25.0.0
- [Release notes](https://github.com/graalvm/graaljs/releases)
- [Changelog](https://github.com/oracle/graaljs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/graalvm/graaljs/compare/vm-24.2.2...vm-25.0.0)
Updates `org.graalvm.js:js-scriptengine` from 24.2.2 to 25.0.0
- [Release notes](https://github.com/graalvm/graaljs/releases)
- [Changelog](https://github.com/oracle/graaljs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/graalvm/graaljs/compare/vm-24.2.2...vm-25.0.0)
Updates `org.graalvm.js:js-language` from 24.2.2 to 25.0.0
- [Release notes](https://github.com/graalvm/graaljs/releases)
- [Changelog](https://github.com/oracle/graaljs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/graalvm/graaljs/compare/vm-24.2.2...vm-25.0.0)
Updates `org.graalvm.truffle:truffle-runtime` from 24.2.2 to 25.0.0
- [Release notes](https://github.com/oracle/graal/releases)
- [Commits](https://github.com/oracle/graal/compare/vm-24.2.2...vm-25.0.0)
---
updated-dependencies:
- dependency-name: org.graalvm.js:js
dependency-version: 25.0.0
dependency-type: direct:development
update-type: version-update:semver-major
- dependency-name: org.graalvm.js:js-scriptengine
dependency-version: 25.0.0
dependency-type: direct:development
update-type: version-update:semver-major
- dependency-name: org.graalvm.js:js-language
dependency-version: 25.0.0
dependency-type: direct:development
update-type: version-update:semver-major
- dependency-name: org.graalvm.truffle:truffle-runtime
dependency-version: 25.0.0
dependency-type: direct:development
update-type: version-update:semver-major
...
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pom.xml b/pom.xml
index 8c9b18d74a..e38a59942a 100644
--- a/pom.xml
+++ b/pom.xml
@@ -500,7 +500,7 @@
[22,)
- 24.2.2
+ 25.0.05.2.0
From 618cc66d41e33652ce8e4d838e2297cd53293d89 Mon Sep 17 00:00:00 2001
From: Gary Gregory
Date: Fri, 19 Sep 2025 17:22:11 -0400
Subject: [PATCH 013/188] Bump graalvm.version from 24.2.2 to 25.0.0 #703
---
src/changes/changes.xml | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index 4366dbe10e..092409b28e 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -54,6 +54,7 @@ The type attribute can be add,update,fix,remove.
Bump commons.bytebuddy.version from 1.17.6 to 1.17.7 #696.Bump org.apache.commons:commons-parent from 85 to 87.
+ Bump graalvm.version from 24.2.2 to 25.0.0 #703.
From ac17677e712c0962b1a145da58e4f3c129505b83 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Fri, 19 Sep 2025 22:26:46 -0400
Subject: [PATCH 014/188] Bump org.apache.commons:commons-parent from 87 to 88
(#704)
Bumps [org.apache.commons:commons-parent](https://github.com/apache/commons-parent) from 87 to 88.
- [Changelog](https://github.com/apache/commons-parent/blob/master/RELEASE-NOTES.txt)
- [Commits](https://github.com/apache/commons-parent/commits)
---
updated-dependencies:
- dependency-name: org.apache.commons:commons-parent
dependency-version: '88'
dependency-type: direct:production
update-type: version-update:semver-major
...
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pom.xml b/pom.xml
index e38a59942a..5cf6ea22bb 100644
--- a/pom.xml
+++ b/pom.xml
@@ -20,7 +20,7 @@
org.apache.commonscommons-parent
- 87
+ 88commons-text1.14.1-SNAPSHOT
From db5ea4fe4424ee2b6b002302de1a84da6ba74810 Mon Sep 17 00:00:00 2001
From: Gary Gregory
Date: Fri, 19 Sep 2025 22:27:18 -0400
Subject: [PATCH 015/188] Bump org.apache.commons:commons-parent from 87 to 88
#704
---
src/changes/changes.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index 092409b28e..c0e5169784 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -53,7 +53,7 @@ The type attribute can be add,update,fix,remove.
Add experimental CycloneDX VEX file #683.Bump commons.bytebuddy.version from 1.17.6 to 1.17.7 #696.
- Bump org.apache.commons:commons-parent from 85 to 87.
+ Bump org.apache.commons:commons-parent from 85 to 88 #704.Bump graalvm.version from 24.2.2 to 25.0.0 #703.
From 1df1c0cdaf5a1101860cf7422d01d06d3d33329d Mon Sep 17 00:00:00 2001
From: "Gary D. Gregory"
Date: Mon, 22 Sep 2025 13:18:33 -0400
Subject: [PATCH 016/188] Javadoc
---
.../commons/text/lookup/AbstractPathFencedLookup.java | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/main/java/org/apache/commons/text/lookup/AbstractPathFencedLookup.java b/src/main/java/org/apache/commons/text/lookup/AbstractPathFencedLookup.java
index 2a980ab2d8..c988738830 100644
--- a/src/main/java/org/apache/commons/text/lookup/AbstractPathFencedLookup.java
+++ b/src/main/java/org/apache/commons/text/lookup/AbstractPathFencedLookup.java
@@ -30,7 +30,7 @@
abstract class AbstractPathFencedLookup extends AbstractStringLookup {
/**
- * Fences guarding Path resolution.
+ * A fence is made of Paths guarding Path resolution.
*/
protected final List fences;
@@ -44,11 +44,11 @@ abstract class AbstractPathFencedLookup extends AbstractStringLookup {
}
/**
- * Gets a Path for the given file name checking that it resolves within our fences.
+ * Gets a Path for the given file name checking that it resolves within our fence.
*
* @param fileName the file name to resolve.
* @return a fenced Path.
- * @throws IllegalArgumentException if the file name is not without our fences.
+ * @throws IllegalArgumentException if the file name is not without our fence.
*/
protected Path getPath(final String fileName) {
final Path path = Paths.get(fileName);
From f3b64e766b6819825217353a76a6864234759c57 Mon Sep 17 00:00:00 2001
From: "Gary D. Gregory"
Date: Mon, 22 Sep 2025 15:36:41 -0400
Subject: [PATCH 017/188] Internal refactoring
Extract a package-private PathFence class from AbstractPathFencedLookup
---
.../text/lookup/AbstractPathFencedLookup.java | 29 ++---
.../apache/commons/text/lookup/PathFence.java | 108 ++++++++++++++++++
2 files changed, 115 insertions(+), 22 deletions(-)
create mode 100644 src/main/java/org/apache/commons/text/lookup/PathFence.java
diff --git a/src/main/java/org/apache/commons/text/lookup/AbstractPathFencedLookup.java b/src/main/java/org/apache/commons/text/lookup/AbstractPathFencedLookup.java
index c988738830..d077c17766 100644
--- a/src/main/java/org/apache/commons/text/lookup/AbstractPathFencedLookup.java
+++ b/src/main/java/org/apache/commons/text/lookup/AbstractPathFencedLookup.java
@@ -14,33 +14,28 @@
* See the license for the specific language governing permissions and
* limitations under the license.
*/
+
package org.apache.commons.text.lookup;
import java.nio.file.Path;
-import java.nio.file.Paths;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-import java.util.Optional;
-import java.util.stream.Collectors;
/**
- * Abstracts guarding Path lookups with fences.
+ * Abstracts string lookup that guards Path lookups with a fence.
*/
abstract class AbstractPathFencedLookup extends AbstractStringLookup {
/**
* A fence is made of Paths guarding Path resolution.
*/
- protected final List fences;
+ protected final PathFence fence;
/**
* Constructs a new instance.
*
- * @param fences The fences guarding Path resolution.
+ * @param paths The fences guarding Path resolution.
*/
- AbstractPathFencedLookup(final Path... fences) {
- this.fences = fences != null ? Arrays.stream(fences).map(Path::toAbsolutePath).collect(Collectors.toList()) : Collections.emptyList();
+ AbstractPathFencedLookup(final Path... paths) {
+ this.fence = PathFence.builder().setPaths(paths).get();
}
/**
@@ -51,16 +46,6 @@ abstract class AbstractPathFencedLookup extends AbstractStringLookup {
* @throws IllegalArgumentException if the file name is not without our fence.
*/
protected Path getPath(final String fileName) {
- final Path path = Paths.get(fileName);
- if (fences.isEmpty()) {
- return path;
- }
- final Path pathAbs = path.normalize().toAbsolutePath();
- final Optional first = fences.stream().filter(pathAbs::startsWith).findFirst();
- if (first.isPresent()) {
- return path;
- }
- throw IllegalArgumentExceptions.format("[%s] -> [%s] not in %s", fileName, pathAbs, fences);
+ return fence.getPath(fileName);
}
-
}
diff --git a/src/main/java/org/apache/commons/text/lookup/PathFence.java b/src/main/java/org/apache/commons/text/lookup/PathFence.java
new file mode 100644
index 0000000000..0428ef2f8e
--- /dev/null
+++ b/src/main/java/org/apache/commons/text/lookup/PathFence.java
@@ -0,0 +1,108 @@
+/*
+ * 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
+ *
+ * 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,
+ * 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.
+ */
+
+package org.apache.commons.text.lookup;
+
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Optional;
+import java.util.function.Supplier;
+import java.util.stream.Collectors;
+
+/**
+ * A Path fence guards Path resolution.
+ *
+ * Keep package-private.
+ */
+final class PathFence {
+
+ /**
+ * Builds {@link PathFence} instances.
+ */
+ static final class Builder implements Supplier {
+
+ /** The empty Path array. */
+ private static final Path[] EMPTY = {};
+
+ /**
+ * A fence is made of Paths guarding Path resolution.
+ */
+ private Path[] paths = EMPTY;
+
+ /**
+ * Sets the paths that delineate this fence.
+ *
+ * @param paths the paths that delineate this fence.
+ * @return {@code this} instance.
+ */
+ Builder setPaths(final Path... paths) {
+ this.paths = paths != null ? paths.clone() : EMPTY;
+ return this;
+ }
+
+ @Override
+ public PathFence get() {
+ return new PathFence(this);
+ }
+ }
+
+ /**
+ * Creates a new builder.
+ *
+ * @return a new builder.
+ */
+ static Builder builder() {
+ return new Builder();
+ }
+
+ /**
+ * A fence is made of Paths guarding Path resolution.
+ */
+ private final List paths;
+
+ /**
+ * Constructs a new instance.
+ *
+ * @param builder A builder.
+ */
+ private PathFence(final Builder builder) {
+ this.paths = Arrays.stream(builder.paths).map(Path::toAbsolutePath).collect(Collectors.toList());
+ }
+
+ /**
+ * Gets a Path for the given file name checking that it resolves within our fence.
+ *
+ * @param fileName the file name to resolve.
+ * @return a fenced Path.
+ * @throws IllegalArgumentException if the file name is not without our fence.
+ */
+ Path getPath(final String fileName) {
+ final Path path = Paths.get(fileName);
+ if (paths.isEmpty()) {
+ return path;
+ }
+ final Path pathAbs = path.normalize().toAbsolutePath();
+ final Optional first = paths.stream().filter(pathAbs::startsWith).findFirst();
+ if (first.isPresent()) {
+ return path;
+ }
+ throw new IllegalArgumentException(String.format("[%s] -> [%s] not in the fence %s", fileName, pathAbs, paths));
+ }
+
+}
From 3abedb8b5c48991be87f8a135ab54a0d2b18e532 Mon Sep 17 00:00:00 2001
From: "Gary D. Gregory"
Date: Wed, 24 Sep 2025 17:40:47 -0400
Subject: [PATCH 018/188] Bump org.apache.commons:commons-lang3 from 3.18.0 to
3.19.0
---
pom.xml | 2 +-
src/changes/changes.xml | 3 ++-
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/pom.xml b/pom.xml
index 5cf6ea22bb..0e51279212 100644
--- a/pom.xml
+++ b/pom.xml
@@ -47,7 +47,7 @@
texthttps://svn.apache.org/repos/infra/websites/production/commons/content/proper/commons-textsite-content
- 3.18.0
+ 3.19.01.17.71.6false
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index c0e5169784..a7e3623057 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -52,9 +52,10 @@ The type attribute can be add,update,fix,remove.
Add experimental CycloneDX VEX file #683.
- Bump commons.bytebuddy.version from 1.17.6 to 1.17.7 #696.Bump org.apache.commons:commons-parent from 85 to 88 #704.
+ Bump commons.bytebuddy.version from 1.17.6 to 1.17.7 #696.Bump graalvm.version from 24.2.2 to 25.0.0 #703.
+ Bump org.apache.commons:commons-lang3 from 3.18.0 to 3.19.0.
From e2277f5400cce07039a16d25c0f2f98fdaf26fbf Mon Sep 17 00:00:00 2001
From: "Gary D. Gregory"
Date: Fri, 26 Sep 2025 10:45:34 -0400
Subject: [PATCH 019/188] Add GH CI 25 and 26-EA
---
.github/workflows/maven.yml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml
index 4890f722c4..6724e87101 100644
--- a/.github/workflows/maven.yml
+++ b/.github/workflows/maven.yml
@@ -27,10 +27,10 @@ jobs:
continue-on-error: ${{ matrix.experimental }}
strategy:
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:
From 03bdf123ab8fb6b95187d3b490391bc3a5e2ce13 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Fri, 26 Sep 2025 16:48:02 -0400
Subject: [PATCH 020/188] Bump github/codeql-action from 3.30.3 to 3.30.5
(#705)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.30.3 to 3.30.5.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/192325c86100d080feab897ff886c34abd4c83a3...3599b3baa15b485a2e49ef411a7a4bb2452e7f93)
---
updated-dependencies:
- dependency-name: github/codeql-action
dependency-version: 3.30.5
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
.github/workflows/codeql-analysis.yml | 6 +++---
.github/workflows/scorecards-analysis.yml | 2 +-
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml
index e61f02688c..af6cd05036 100644
--- a/.github/workflows/codeql-analysis.yml
+++ b/.github/workflows/codeql-analysis.yml
@@ -57,7 +57,7 @@ jobs:
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
- uses: github/codeql-action/init@192325c86100d080feab897ff886c34abd4c83a3 # 3.29.5
+ uses: github/codeql-action/init@3599b3baa15b485a2e49ef411a7a4bb2452e7f93 # 3.29.5
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
@@ -68,7 +68,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@192325c86100d080feab897ff886c34abd4c83a3 # 3.29.5
+ uses: github/codeql-action/autobuild@3599b3baa15b485a2e49ef411a7a4bb2452e7f93 # 3.29.5
# âšī¸ Command-line programs to run using the OS shell.
# đ https://git.io/JvXDl
@@ -82,4 +82,4 @@ jobs:
# make release
- name: Perform CodeQL Analysis
- uses: github/codeql-action/analyze@192325c86100d080feab897ff886c34abd4c83a3 # 3.29.5
+ uses: github/codeql-action/analyze@3599b3baa15b485a2e49ef411a7a4bb2452e7f93 # 3.29.5
diff --git a/.github/workflows/scorecards-analysis.yml b/.github/workflows/scorecards-analysis.yml
index 9f6e1fd0c2..7ec7ae6801 100644
--- a/.github/workflows/scorecards-analysis.yml
+++ b/.github/workflows/scorecards-analysis.yml
@@ -64,6 +64,6 @@ jobs:
retention-days: 5
- name: "Upload to code-scanning"
- uses: github/codeql-action/upload-sarif@192325c86100d080feab897ff886c34abd4c83a3 # 3.29.5
+ uses: github/codeql-action/upload-sarif@3599b3baa15b485a2e49ef411a7a4bb2452e7f93 # 3.29.5
with:
sarif_file: results.sarif
From 78d5cfaf12d96ba7bb6674e4902a9d663a6c36dd Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Fri, 26 Sep 2025 16:48:47 -0400
Subject: [PATCH 021/188] Bump actions/dependency-review-action from 4.7.3 to
4.8.0 (#707)
Bumps [actions/dependency-review-action](https://github.com/actions/dependency-review-action) from 4.7.3 to 4.8.0.
- [Release notes](https://github.com/actions/dependency-review-action/releases)
- [Commits](https://github.com/actions/dependency-review-action/compare/595b5aeba73380359d98a5e087f648dbb0edce1b...56339e523c0409420f6c2c9a2f4292bbb3c07dd3)
---
updated-dependencies:
- dependency-name: actions/dependency-review-action
dependency-version: 4.8.0
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
.github/workflows/dependency-review.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.github/workflows/dependency-review.yml b/.github/workflows/dependency-review.yml
index 1e04392423..edfe875664 100644
--- a/.github/workflows/dependency-review.yml
+++ b/.github/workflows/dependency-review.yml
@@ -28,4 +28,4 @@ jobs:
- name: 'Checkout Repository'
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- name: 'Dependency Review PR'
- uses: actions/dependency-review-action@595b5aeba73380359d98a5e087f648dbb0edce1b # v4.7.3
+ uses: actions/dependency-review-action@56339e523c0409420f6c2c9a2f4292bbb3c07dd3 # v4.8.0
From cb7233acd4fc0b98b1e872925e403d2664f148f7 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Fri, 26 Sep 2025 16:49:01 -0400
Subject: [PATCH 022/188] Bump actions/cache from 4.2.4 to 4.3.0 (#706)
Bumps [actions/cache](https://github.com/actions/cache) from 4.2.4 to 4.3.0.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](https://github.com/actions/cache/compare/0400d5f644dc74513175e3cd8d07132dd4860809...0057852bfaa89a56745cba8c7296529d2fc39830)
---
updated-dependencies:
- dependency-name: actions/cache
dependency-version: 4.3.0
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
.github/workflows/codeql-analysis.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml
index af6cd05036..96554af907 100644
--- a/.github/workflows/codeql-analysis.yml
+++ b/.github/workflows/codeql-analysis.yml
@@ -48,7 +48,7 @@ jobs:
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
persist-credentials: false
- - uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
+ - uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
From 5ef8eea758e862c5212b9dd91d9074664dc2f6e6 Mon Sep 17 00:00:00 2001
From: "Gary D. Gregory"
Date: Wed, 1 Oct 2025 15:46:00 -0400
Subject: [PATCH 023/188] Update JMH test data
---
.../org/apache/commons/text/lcs-perf-analysis-inputs.csv | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/test/resources/org/apache/commons/text/lcs-perf-analysis-inputs.csv b/src/test/resources/org/apache/commons/text/lcs-perf-analysis-inputs.csv
index d000a26c96..53610d3579 100644
--- a/src/test/resources/org/apache/commons/text/lcs-perf-analysis-inputs.csv
+++ b/src/test/resources/org/apache/commons/text/lcs-perf-analysis-inputs.csv
@@ -1,5 +1,5 @@
-"This code is free software; you can redistribute it and/or modify it","under the terms of the GNU General Public License version 2 only, as"
-"You should have received a copy of the GNU General Public License version","2 along with this work; if not, write to the Free Software Foundation,"
+"This is test data for a JMH (the Java Microbenchmark Harness) which is used from the class org.apache.commons.text.jmh.LongestCommonSubsequencePerformance."
+"The quick brown fox jumps over the lazy dog. A man, a plan, a canal, Panama. Was it a car or a cat I saw? Step on no pets. Rats live on no evil star."
"Here, the field iterations will be populated with appropriate values from the @Param annotation by the JMH when it is passed to the benchmark method. The @Setup annotated method is invoked before each invocation of the benchmark and creates a new Hasher ensuring isolation. When the execution is finished, we'll get a result similar to the one below: When running microbenchmarks, it's very important to be aware of optimizations. Otherwise, they may affect the","benchmark results in a very misleading way. To make matters a bit more concrete, let's consider an example: We expect object allocation costs more than doing nothing at all. However, if we run the benchmarks: Apparently finding a place in the TLAB, creating and initializing an object is almost free! Just by looking at these numbers, we should know that something does not quite add up here."
"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. This code is free software; you can redistribute it and/or modify it published by the Free Software Foundation. Oracle designates this This code is distributed in the hope that it will be useful, but WITHOUT FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License You should have received a copy of the GNU General Public License version","Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur? under the terms of the GNU General Public License version 2 only, as particular file as subject to the *Classpath* exception as provided ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or version 2 for more details (a copy is included in the LICENSE file that 2 along with this work; if not, write to the Free Software Foundation,"
"But I must explain to you how all this mistaken idea of denouncing pleasure and praising pain was born and I will give you a complete account of the system, and expound the actual teachings of the great explorer of the truth, the master-builder of human happiness. No one rejects, dislikes, or avoids pleasure itself, because it is pleasure, but because those who do not know how to pursue pleasure rationally encounter consequences that are extremely painful. Nor again is there anyone who loves or pursues or desires to obtain pain of itself, because it is pain, but because occasionally circumstances occur in which toil and pain can procure him some great pleasure. To take a trivial example, which of us ever undertakes laborious physical exercise, except to obtain some advantage from it? But who has any right to find fault with a man who chooses to enjoy a pleasure that has no annoying consequences, or one who avoids a pain that produces no resultant pleasure? Here, the field iterations will be populated with appropriate values from the @Param annotation by the JMH when it is passed to the benchmark method. The @Setup annotated method is invoked before each invocation of the benchmark and creates a new Hasher ensuring isolation. When the execution is finished, we'll get a result similar to the one below: When running microbenchmarks, it's very important to be aware of optimizations. Otherwise, they may affect the","At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Temporibus autem quibusdam et aut officiis debitis aut rerum necessitatibus saepe eveniet ut et voluptates repudiandae sint et molestiae non recusandae. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat. benchmark results in a very misleading way. To make matters a bit more concrete, let's consider an example: We expect object allocation costs more than doing nothing at all. However, if we run the benchmarks: Apparently finding a place in the TLAB, creating and initializing an object is almost free! Just by looking at these numbers, we should know that something does not quite add up here."
From 81f219f61284cd82392085a7210777037c2893ec Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Fri, 3 Oct 2025 17:54:13 -0400
Subject: [PATCH 024/188] Bump github/codeql-action from 3.30.5 to 3.30.6
(#709)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.30.5 to 3.30.6.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/3599b3baa15b485a2e49ef411a7a4bb2452e7f93...64d10c13136e1c5bce3e5fbde8d4906eeaafc885)
---
updated-dependencies:
- dependency-name: github/codeql-action
dependency-version: 3.30.6
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
.github/workflows/codeql-analysis.yml | 6 +++---
.github/workflows/scorecards-analysis.yml | 2 +-
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml
index 96554af907..131d8f6927 100644
--- a/.github/workflows/codeql-analysis.yml
+++ b/.github/workflows/codeql-analysis.yml
@@ -57,7 +57,7 @@ jobs:
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
- uses: github/codeql-action/init@3599b3baa15b485a2e49ef411a7a4bb2452e7f93 # 3.29.5
+ uses: github/codeql-action/init@64d10c13136e1c5bce3e5fbde8d4906eeaafc885 # 3.29.5
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
@@ -68,7 +68,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@3599b3baa15b485a2e49ef411a7a4bb2452e7f93 # 3.29.5
+ uses: github/codeql-action/autobuild@64d10c13136e1c5bce3e5fbde8d4906eeaafc885 # 3.29.5
# âšī¸ Command-line programs to run using the OS shell.
# đ https://git.io/JvXDl
@@ -82,4 +82,4 @@ jobs:
# make release
- name: Perform CodeQL Analysis
- uses: github/codeql-action/analyze@3599b3baa15b485a2e49ef411a7a4bb2452e7f93 # 3.29.5
+ uses: github/codeql-action/analyze@64d10c13136e1c5bce3e5fbde8d4906eeaafc885 # 3.29.5
diff --git a/.github/workflows/scorecards-analysis.yml b/.github/workflows/scorecards-analysis.yml
index 7ec7ae6801..2620d75876 100644
--- a/.github/workflows/scorecards-analysis.yml
+++ b/.github/workflows/scorecards-analysis.yml
@@ -64,6 +64,6 @@ jobs:
retention-days: 5
- name: "Upload to code-scanning"
- uses: github/codeql-action/upload-sarif@3599b3baa15b485a2e49ef411a7a4bb2452e7f93 # 3.29.5
+ uses: github/codeql-action/upload-sarif@64d10c13136e1c5bce3e5fbde8d4906eeaafc885 # 3.29.5
with:
sarif_file: results.sarif
From 4ef7194ddcc7ca88c768a72d76f1c64370d462c8 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Fri, 3 Oct 2025 17:55:16 -0400
Subject: [PATCH 025/188] Bump ossf/scorecard-action from 2.4.2 to 2.4.3 (#708)
Bumps [ossf/scorecard-action](https://github.com/ossf/scorecard-action) from 2.4.2 to 2.4.3.
- [Release notes](https://github.com/ossf/scorecard-action/releases)
- [Changelog](https://github.com/ossf/scorecard-action/blob/main/RELEASE.md)
- [Commits](https://github.com/ossf/scorecard-action/compare/05b42c624433fc40578a4040d5cf5e36ddca8cde...4eaacf0543bb3f2c246792bd56e8cdeffafb205a)
---
updated-dependencies:
- dependency-name: ossf/scorecard-action
dependency-version: 2.4.3
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
.github/workflows/scorecards-analysis.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.github/workflows/scorecards-analysis.yml b/.github/workflows/scorecards-analysis.yml
index 2620d75876..b8af37f418 100644
--- a/.github/workflows/scorecards-analysis.yml
+++ b/.github/workflows/scorecards-analysis.yml
@@ -45,7 +45,7 @@ jobs:
persist-credentials: false
- name: "Run analysis"
- uses: ossf/scorecard-action@05b42c624433fc40578a4040d5cf5e36ddca8cde # 2.4.2
+ uses: ossf/scorecard-action@4eaacf0543bb3f2c246792bd56e8cdeffafb205a # 2.4.3
with:
results_file: results.sarif
results_format: sarif
From 34fec1023b5c55bee9a376bbfdecd9da24b8c515 Mon Sep 17 00:00:00 2001
From: "Gary D. Gregory"
Date: Wed, 8 Oct 2025 15:35:22 -0400
Subject: [PATCH 026/188] Bump org.apache.commons:commons-parent from 88 to 89
---
pom.xml | 2 +-
src/changes/changes.xml | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/pom.xml b/pom.xml
index 0e51279212..8f77daf91d 100644
--- a/pom.xml
+++ b/pom.xml
@@ -20,7 +20,7 @@
org.apache.commonscommons-parent
- 88
+ 89commons-text1.14.1-SNAPSHOT
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index a7e3623057..7dd3974ca6 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -52,7 +52,7 @@ The type attribute can be add,update,fix,remove.
Add experimental CycloneDX VEX file #683.
- Bump org.apache.commons:commons-parent from 85 to 88 #704.
+ Bump org.apache.commons:commons-parent from 85 to 89 #704.Bump commons.bytebuddy.version from 1.17.6 to 1.17.7 #696.Bump graalvm.version from 24.2.2 to 25.0.0 #703.Bump org.apache.commons:commons-lang3 from 3.18.0 to 3.19.0.
From 4d2f10673f1c849c9edfd6090070fa624560931e Mon Sep 17 00:00:00 2001
From: "Gary D. Gregory"
Date: Fri, 10 Oct 2025 07:02:09 -0400
Subject: [PATCH 027/188] Fix typo in StringUtils.trunctate()
IllegalArgumentException message and test assertion messages
---
pom.xml | 2 +-
src/changes/changes.xml | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/pom.xml b/pom.xml
index 8f77daf91d..37c2a41b51 100644
--- a/pom.xml
+++ b/pom.xml
@@ -48,7 +48,7 @@
https://svn.apache.org/repos/infra/websites/production/commons/content/proper/commons-textsite-content3.19.0
- 1.17.7
+ 1.17.81.6false1.37
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index 7dd3974ca6..7397803ebb 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -53,7 +53,7 @@ The type attribute can be add,update,fix,remove.
Add experimental CycloneDX VEX file #683.Bump org.apache.commons:commons-parent from 85 to 89 #704.
- Bump commons.bytebuddy.version from 1.17.6 to 1.17.7 #696.
+ Bump commons.bytebuddy.version from 1.17.6 to 1.17.8 #696.Bump graalvm.version from 24.2.2 to 25.0.0 #703.Bump org.apache.commons:commons-lang3 from 3.18.0 to 3.19.0.
From 0d81869d37e7e0bdf967e466e2471d160a40faa8 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Fri, 10 Oct 2025 16:04:42 -0400
Subject: [PATCH 028/188] Bump github/codeql-action from 3.30.6 to 4.30.8
(#710)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.30.6 to 4.30.8.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/64d10c13136e1c5bce3e5fbde8d4906eeaafc885...f443b600d91635bebf5b0d9ebc620189c0d6fba5)
---
updated-dependencies:
- dependency-name: github/codeql-action
dependency-version: 4.30.8
dependency-type: direct:production
update-type: version-update:semver-major
...
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
.github/workflows/codeql-analysis.yml | 6 +++---
.github/workflows/scorecards-analysis.yml | 2 +-
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml
index 131d8f6927..a999a0751b 100644
--- a/.github/workflows/codeql-analysis.yml
+++ b/.github/workflows/codeql-analysis.yml
@@ -57,7 +57,7 @@ jobs:
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
- uses: github/codeql-action/init@64d10c13136e1c5bce3e5fbde8d4906eeaafc885 # 3.29.5
+ uses: github/codeql-action/init@f443b600d91635bebf5b0d9ebc620189c0d6fba5 # 3.29.5
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
@@ -68,7 +68,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@64d10c13136e1c5bce3e5fbde8d4906eeaafc885 # 3.29.5
+ uses: github/codeql-action/autobuild@f443b600d91635bebf5b0d9ebc620189c0d6fba5 # 3.29.5
# âšī¸ Command-line programs to run using the OS shell.
# đ https://git.io/JvXDl
@@ -82,4 +82,4 @@ jobs:
# make release
- name: Perform CodeQL Analysis
- uses: github/codeql-action/analyze@64d10c13136e1c5bce3e5fbde8d4906eeaafc885 # 3.29.5
+ uses: github/codeql-action/analyze@f443b600d91635bebf5b0d9ebc620189c0d6fba5 # 3.29.5
diff --git a/.github/workflows/scorecards-analysis.yml b/.github/workflows/scorecards-analysis.yml
index b8af37f418..6c7da95500 100644
--- a/.github/workflows/scorecards-analysis.yml
+++ b/.github/workflows/scorecards-analysis.yml
@@ -64,6 +64,6 @@ jobs:
retention-days: 5
- name: "Upload to code-scanning"
- uses: github/codeql-action/upload-sarif@64d10c13136e1c5bce3e5fbde8d4906eeaafc885 # 3.29.5
+ uses: github/codeql-action/upload-sarif@f443b600d91635bebf5b0d9ebc620189c0d6fba5 # 3.29.5
with:
sarif_file: results.sarif
From 903d6268519d6093e9a6c3848cd840605af511c1 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Fri, 17 Oct 2025 16:07:51 -0400
Subject: [PATCH 029/188] Bump github/codeql-action from 4.30.8 to 4.30.9
(#711)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 4.30.8 to 4.30.9.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/f443b600d91635bebf5b0d9ebc620189c0d6fba5...16140ae1a102900babc80a33c44059580f687047)
---
updated-dependencies:
- dependency-name: github/codeql-action
dependency-version: 4.30.9
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
.github/workflows/codeql-analysis.yml | 6 +++---
.github/workflows/scorecards-analysis.yml | 2 +-
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml
index a999a0751b..d3291cb300 100644
--- a/.github/workflows/codeql-analysis.yml
+++ b/.github/workflows/codeql-analysis.yml
@@ -57,7 +57,7 @@ jobs:
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
- uses: github/codeql-action/init@f443b600d91635bebf5b0d9ebc620189c0d6fba5 # 3.29.5
+ uses: github/codeql-action/init@16140ae1a102900babc80a33c44059580f687047 # 3.29.5
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
@@ -68,7 +68,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@f443b600d91635bebf5b0d9ebc620189c0d6fba5 # 3.29.5
+ uses: github/codeql-action/autobuild@16140ae1a102900babc80a33c44059580f687047 # 3.29.5
# âšī¸ Command-line programs to run using the OS shell.
# đ https://git.io/JvXDl
@@ -82,4 +82,4 @@ jobs:
# make release
- name: Perform CodeQL Analysis
- uses: github/codeql-action/analyze@f443b600d91635bebf5b0d9ebc620189c0d6fba5 # 3.29.5
+ uses: github/codeql-action/analyze@16140ae1a102900babc80a33c44059580f687047 # 3.29.5
diff --git a/.github/workflows/scorecards-analysis.yml b/.github/workflows/scorecards-analysis.yml
index 6c7da95500..40a87e44bf 100644
--- a/.github/workflows/scorecards-analysis.yml
+++ b/.github/workflows/scorecards-analysis.yml
@@ -64,6 +64,6 @@ jobs:
retention-days: 5
- name: "Upload to code-scanning"
- uses: github/codeql-action/upload-sarif@f443b600d91635bebf5b0d9ebc620189c0d6fba5 # 3.29.5
+ uses: github/codeql-action/upload-sarif@16140ae1a102900babc80a33c44059580f687047 # 3.29.5
with:
sarif_file: results.sarif
From 12b1e6a9cd5fc2c8e0eb08f2594269a933e3e711 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Fri, 17 Oct 2025 16:08:06 -0400
Subject: [PATCH 030/188] Bump actions/dependency-review-action from 4.8.0 to
4.8.1 (#712)
Bumps [actions/dependency-review-action](https://github.com/actions/dependency-review-action) from 4.8.0 to 4.8.1.
- [Release notes](https://github.com/actions/dependency-review-action/releases)
- [Commits](https://github.com/actions/dependency-review-action/compare/56339e523c0409420f6c2c9a2f4292bbb3c07dd3...40c09b7dc99638e5ddb0bfd91c1673effc064d8a)
---
updated-dependencies:
- dependency-name: actions/dependency-review-action
dependency-version: 4.8.1
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
.github/workflows/dependency-review.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.github/workflows/dependency-review.yml b/.github/workflows/dependency-review.yml
index edfe875664..a657a4ae2c 100644
--- a/.github/workflows/dependency-review.yml
+++ b/.github/workflows/dependency-review.yml
@@ -28,4 +28,4 @@ jobs:
- name: 'Checkout Repository'
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- name: 'Dependency Review PR'
- uses: actions/dependency-review-action@56339e523c0409420f6c2c9a2f4292bbb3c07dd3 # v4.8.0
+ uses: actions/dependency-review-action@40c09b7dc99638e5ddb0bfd91c1673effc064d8a # v4.8.1
From 76df9e54399018163c8cd92bc1e407c7c4296612 Mon Sep 17 00:00:00 2001
From: "Gary D. Gregory"
Date: Sun, 19 Oct 2025 08:48:58 -0400
Subject: [PATCH 031/188] Better internal names and comments
---
.../text/lookup/AbstractPathFencedLookup.java | 4 +--
.../apache/commons/text/lookup/PathFence.java | 32 +++++++++----------
2 files changed, 18 insertions(+), 18 deletions(-)
diff --git a/src/main/java/org/apache/commons/text/lookup/AbstractPathFencedLookup.java b/src/main/java/org/apache/commons/text/lookup/AbstractPathFencedLookup.java
index d077c17766..b4fc4601b8 100644
--- a/src/main/java/org/apache/commons/text/lookup/AbstractPathFencedLookup.java
+++ b/src/main/java/org/apache/commons/text/lookup/AbstractPathFencedLookup.java
@@ -35,7 +35,7 @@ abstract class AbstractPathFencedLookup extends AbstractStringLookup {
* @param paths The fences guarding Path resolution.
*/
AbstractPathFencedLookup(final Path... paths) {
- this.fence = PathFence.builder().setPaths(paths).get();
+ this.fence = PathFence.builder().setRoots(paths).get();
}
/**
@@ -46,6 +46,6 @@ abstract class AbstractPathFencedLookup extends AbstractStringLookup {
* @throws IllegalArgumentException if the file name is not without our fence.
*/
protected Path getPath(final String fileName) {
- return fence.getPath(fileName);
+ return fence.apply(fileName);
}
}
diff --git a/src/main/java/org/apache/commons/text/lookup/PathFence.java b/src/main/java/org/apache/commons/text/lookup/PathFence.java
index 0428ef2f8e..95b9b615f5 100644
--- a/src/main/java/org/apache/commons/text/lookup/PathFence.java
+++ b/src/main/java/org/apache/commons/text/lookup/PathFence.java
@@ -26,7 +26,7 @@
import java.util.stream.Collectors;
/**
- * A Path fence guards Path resolution.
+ * A Path fence guards against using paths outside of a "fence" of made of root paths.
*
* Keep package-private.
*/
@@ -41,9 +41,14 @@ static final class Builder implements Supplier {
private static final Path[] EMPTY = {};
/**
- * A fence is made of Paths guarding Path resolution.
+ * A fence is made of root Paths.
*/
- private Path[] paths = EMPTY;
+ private Path[] roots = EMPTY;
+
+ @Override
+ public PathFence get() {
+ return new PathFence(this);
+ }
/**
* Sets the paths that delineate this fence.
@@ -51,15 +56,10 @@ static final class Builder implements Supplier {
* @param paths the paths that delineate this fence.
* @return {@code this} instance.
*/
- Builder setPaths(final Path... paths) {
- this.paths = paths != null ? paths.clone() : EMPTY;
+ Builder setRoots(final Path... paths) {
+ this.roots = paths != null ? paths.clone() : EMPTY;
return this;
}
-
- @Override
- public PathFence get() {
- return new PathFence(this);
- }
}
/**
@@ -74,7 +74,7 @@ static Builder builder() {
/**
* A fence is made of Paths guarding Path resolution.
*/
- private final List paths;
+ private final List roots;
/**
* Constructs a new instance.
@@ -82,7 +82,7 @@ static Builder builder() {
* @param builder A builder.
*/
private PathFence(final Builder builder) {
- this.paths = Arrays.stream(builder.paths).map(Path::toAbsolutePath).collect(Collectors.toList());
+ this.roots = Arrays.stream(builder.roots).map(Path::toAbsolutePath).collect(Collectors.toList());
}
/**
@@ -92,17 +92,17 @@ private PathFence(final Builder builder) {
* @return a fenced Path.
* @throws IllegalArgumentException if the file name is not without our fence.
*/
- Path getPath(final String fileName) {
+ Path apply(final String fileName) {
final Path path = Paths.get(fileName);
- if (paths.isEmpty()) {
+ if (roots.isEmpty()) {
return path;
}
final Path pathAbs = path.normalize().toAbsolutePath();
- final Optional first = paths.stream().filter(pathAbs::startsWith).findFirst();
+ final Optional first = roots.stream().filter(pathAbs::startsWith).findFirst();
if (first.isPresent()) {
return path;
}
- throw new IllegalArgumentException(String.format("[%s] -> [%s] not in the fence %s", fileName, pathAbs, paths));
+ throw new IllegalArgumentException(String.format("[%s] -> [%s] not in the fence %s", fileName, pathAbs, roots));
}
}
From 346f7ba2b37aa3081a0692e1d3d23266315cccd0 Mon Sep 17 00:00:00 2001
From: "Gary D. Gregory"
Date: Sun, 19 Oct 2025 08:59:58 -0400
Subject: [PATCH 032/188] Fix grammar
---
.github/pull_request_template.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md
index 7578b4da03..4cbe168c3e 100644
--- a/.github/pull_request_template.md
+++ b/.github/pull_request_template.md
@@ -25,6 +25,6 @@ Before you push a pull request, review this list:
- [ ] 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.
- [ ] 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 it 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 a maintainer may squash commits during the merge process.
From 50bfffe72683a7d3816e809edc22f1022bc7a27f Mon Sep 17 00:00:00 2001
From: "Gary D. Gregory"
Date: Sun, 19 Oct 2025 09:29:36 -0400
Subject: [PATCH 033/188] Use https scheme in license link
---
pom.xml | 2 +-
src/conf/security/README.md | 2 +-
src/conf/security/VEX.cyclonedx.xml | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/pom.xml b/pom.xml
index 37c2a41b51..3f8dfc0007 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,
diff --git a/src/conf/security/README.md b/src/conf/security/README.md
index 8629f82a7a..4ac566bc6a 100644
--- a/src/conf/security/README.md
+++ b/src/conf/security/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,
diff --git a/src/conf/security/VEX.cyclonedx.xml b/src/conf/security/VEX.cyclonedx.xml
index dcad061f0e..a347293699 100644
--- a/src/conf/security/VEX.cyclonedx.xml
+++ b/src/conf/security/VEX.cyclonedx.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,
From 9fd0ca67703503557c0f4c08bc6e26f8a1be8f44 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Fri, 24 Oct 2025 16:19:38 -0400
Subject: [PATCH 034/188] Bump github/codeql-action from 4.30.9 to 4.31.0
(#714)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 4.30.9 to 4.31.0.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/16140ae1a102900babc80a33c44059580f687047...4e94bd11f71e507f7f87df81788dff88d1dacbfb)
---
updated-dependencies:
- dependency-name: github/codeql-action
dependency-version: 4.31.0
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
.github/workflows/codeql-analysis.yml | 6 +++---
.github/workflows/scorecards-analysis.yml | 2 +-
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml
index d3291cb300..18730ee4ae 100644
--- a/.github/workflows/codeql-analysis.yml
+++ b/.github/workflows/codeql-analysis.yml
@@ -57,7 +57,7 @@ jobs:
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
- uses: github/codeql-action/init@16140ae1a102900babc80a33c44059580f687047 # 3.29.5
+ uses: github/codeql-action/init@4e94bd11f71e507f7f87df81788dff88d1dacbfb # 3.29.5
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
@@ -68,7 +68,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@16140ae1a102900babc80a33c44059580f687047 # 3.29.5
+ uses: github/codeql-action/autobuild@4e94bd11f71e507f7f87df81788dff88d1dacbfb # 3.29.5
# âšī¸ Command-line programs to run using the OS shell.
# đ https://git.io/JvXDl
@@ -82,4 +82,4 @@ jobs:
# make release
- name: Perform CodeQL Analysis
- uses: github/codeql-action/analyze@16140ae1a102900babc80a33c44059580f687047 # 3.29.5
+ uses: github/codeql-action/analyze@4e94bd11f71e507f7f87df81788dff88d1dacbfb # 3.29.5
diff --git a/.github/workflows/scorecards-analysis.yml b/.github/workflows/scorecards-analysis.yml
index 40a87e44bf..07625fba6f 100644
--- a/.github/workflows/scorecards-analysis.yml
+++ b/.github/workflows/scorecards-analysis.yml
@@ -64,6 +64,6 @@ jobs:
retention-days: 5
- name: "Upload to code-scanning"
- uses: github/codeql-action/upload-sarif@16140ae1a102900babc80a33c44059580f687047 # 3.29.5
+ uses: github/codeql-action/upload-sarif@4e94bd11f71e507f7f87df81788dff88d1dacbfb # 3.29.5
with:
sarif_file: results.sarif
From 2f516325b0bb87a88e621c904f5ceea6c1eb2750 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Fri, 24 Oct 2025 16:19:57 -0400
Subject: [PATCH 035/188] Bump actions/upload-artifact from 4.6.2 to 5.0.0
(#715)
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 4.6.2 to 5.0.0.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/ea165f8d65b6e75b540449e92b4886f43607fa02...330a01c490aca151604b8cf639adc76d48f6c5d4)
---
updated-dependencies:
- dependency-name: actions/upload-artifact
dependency-version: 5.0.0
dependency-type: direct:production
update-type: version-update:semver-major
...
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
.github/workflows/scorecards-analysis.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.github/workflows/scorecards-analysis.yml b/.github/workflows/scorecards-analysis.yml
index 07625fba6f..31b58e38e8 100644
--- a/.github/workflows/scorecards-analysis.yml
+++ b/.github/workflows/scorecards-analysis.yml
@@ -57,7 +57,7 @@ jobs:
publish_results: true
- name: "Upload artifact"
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # 4.6.2
+ uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # 5.0.0
with:
name: SARIF file
path: results.sarif
From f8db46df6dbb3dbd5085d005b6055304108eaf37 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Fri, 24 Oct 2025 16:55:56 -0400
Subject: [PATCH 036/188] Bump org.apache.commons:commons-parent from 89 to 90
(#713)
Bumps [org.apache.commons:commons-parent](https://github.com/apache/commons-parent) from 89 to 90.
- [Changelog](https://github.com/apache/commons-parent/blob/master/RELEASE-NOTES.txt)
- [Commits](https://github.com/apache/commons-parent/commits)
---
updated-dependencies:
- dependency-name: org.apache.commons:commons-parent
dependency-version: '90'
dependency-type: direct:production
update-type: version-update:semver-major
...
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pom.xml b/pom.xml
index 3f8dfc0007..ed37a53d00 100644
--- a/pom.xml
+++ b/pom.xml
@@ -20,7 +20,7 @@
org.apache.commonscommons-parent
- 89
+ 90commons-text1.14.1-SNAPSHOT
From 388effdf87475ba79c8881392e18809832606715 Mon Sep 17 00:00:00 2001
From: Gary Gregory
Date: Fri, 24 Oct 2025 16:56:19 -0400
Subject: [PATCH 037/188] Bump org.apache.commons:commons-parent from 89 to 90
#713
---
src/changes/changes.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index 7397803ebb..78845b2afa 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -52,7 +52,7 @@ The type attribute can be add,update,fix,remove.
Add experimental CycloneDX VEX file #683.
- Bump org.apache.commons:commons-parent from 85 to 89 #704.
+ Bump org.apache.commons:commons-parent from 85 to 90 #704.Bump commons.bytebuddy.version from 1.17.6 to 1.17.8 #696.Bump graalvm.version from 24.2.2 to 25.0.0 #703.Bump org.apache.commons:commons-lang3 from 3.18.0 to 3.19.0.
From 8283f350552eeabb98c87825053f78af58365e7b Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Fri, 24 Oct 2025 16:56:56 -0400
Subject: [PATCH 038/188] Bump graalvm.version from 25.0.0 to 25.0.1 (#716)
Bumps `graalvm.version` from 25.0.0 to 25.0.1.
Updates `org.graalvm.js:js` from 25.0.0 to 25.0.1
- [Release notes](https://github.com/graalvm/graaljs/releases)
- [Changelog](https://github.com/oracle/graaljs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/graalvm/graaljs/compare/vm-25.0.0...vm-25.0.1)
Updates `org.graalvm.js:js-scriptengine` from 25.0.0 to 25.0.1
- [Release notes](https://github.com/graalvm/graaljs/releases)
- [Changelog](https://github.com/oracle/graaljs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/graalvm/graaljs/compare/vm-25.0.0...vm-25.0.1)
Updates `org.graalvm.js:js-language` from 25.0.0 to 25.0.1
- [Release notes](https://github.com/graalvm/graaljs/releases)
- [Changelog](https://github.com/oracle/graaljs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/graalvm/graaljs/compare/vm-25.0.0...vm-25.0.1)
Updates `org.graalvm.truffle:truffle-runtime` from 25.0.0 to 25.0.1
- [Release notes](https://github.com/oracle/graal/releases)
- [Commits](https://github.com/oracle/graal/compare/vm-25.0.0...vm-25.0.1)
---
updated-dependencies:
- dependency-name: org.graalvm.js:js
dependency-version: 25.0.1
dependency-type: direct:development
update-type: version-update:semver-patch
- dependency-name: org.graalvm.js:js-scriptengine
dependency-version: 25.0.1
dependency-type: direct:development
update-type: version-update:semver-patch
- dependency-name: org.graalvm.js:js-language
dependency-version: 25.0.1
dependency-type: direct:development
update-type: version-update:semver-patch
- dependency-name: org.graalvm.truffle:truffle-runtime
dependency-version: 25.0.1
dependency-type: direct:development
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pom.xml b/pom.xml
index ed37a53d00..072b91361c 100644
--- a/pom.xml
+++ b/pom.xml
@@ -500,7 +500,7 @@
[22,)
- 25.0.0
+ 25.0.15.2.0
From 57f197870e0aaba57ea60f24544efb61f607d311 Mon Sep 17 00:00:00 2001
From: Gary Gregory
Date: Fri, 24 Oct 2025 16:57:29 -0400
Subject: [PATCH 039/188] Bump graalvm.version from 25.0.0 to 25.0.1 #716
---
src/changes/changes.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index 78845b2afa..2de17e803e 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -54,7 +54,7 @@ The type attribute can be add,update,fix,remove.
Bump org.apache.commons:commons-parent from 85 to 90 #704.Bump commons.bytebuddy.version from 1.17.6 to 1.17.8 #696.
- Bump graalvm.version from 24.2.2 to 25.0.0 #703.
+ 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.19.0.
From 4f3555954819dda2a9a0ff6f9a8bd694bee56632 Mon Sep 17 00:00:00 2001
From: "Gary D. Gregory"
Date: Sun, 26 Oct 2025 15:33:42 -0400
Subject: [PATCH 040/188] No need for Latin
---
.../commons/text/similarity/LevenshteinDetailedDistance.java | 3 ++-
.../apache/commons/text/similarity/LevenshteinDistance.java | 3 ++-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/main/java/org/apache/commons/text/similarity/LevenshteinDetailedDistance.java b/src/main/java/org/apache/commons/text/similarity/LevenshteinDetailedDistance.java
index a25b988b60..7e3df86aba 100644
--- a/src/main/java/org/apache/commons/text/similarity/LevenshteinDetailedDistance.java
+++ b/src/main/java/org/apache/commons/text/similarity/LevenshteinDetailedDistance.java
@@ -168,7 +168,8 @@ private static LevenshteinResults limitedCompare(SimilarityInput left, Si
* of the cost table. It is also possible to use this to compute the unbounded Levenshtein distance by starting the threshold at 1 and doubling each
* time until the distance is found; this is O(dm), where d is the distance.
*
- * One subtlety comes from needing to ignore entries on the border of our stripe eg. p[] = |#|#|#|* d[] = *|#|#|#| We must ignore the entry to the left
+ * One subtlety comes from needing to ignore entries on the border of our stripe, for example,
+ * p[] = |#|#|#|* d[] = *|#|#|#| We must ignore the entry to the left
* of the leftmost member We must ignore the entry above the rightmost member
*
* Another subtlety comes from our stripe running off the matrix if the strings aren't of the same size. Since string s is always swapped to be the
diff --git a/src/main/java/org/apache/commons/text/similarity/LevenshteinDistance.java b/src/main/java/org/apache/commons/text/similarity/LevenshteinDistance.java
index 787279c6ab..0deb2b525a 100644
--- a/src/main/java/org/apache/commons/text/similarity/LevenshteinDistance.java
+++ b/src/main/java/org/apache/commons/text/similarity/LevenshteinDistance.java
@@ -91,7 +91,8 @@ private static int limitedCompare(SimilarityInput left, SimilarityInput
Date: Thu, 30 Oct 2025 11:04:59 +0000
Subject: [PATCH 041/188] [TEXT-235] Add Damerau-Levenshtein distance (#687)
* [TEXT-235] Implement Damerau-Levenshtein distance
* Fix comment formatting
* Fix style and spotbugs
---------
Co-authored-by: Eirik Lorgen Tanberg
---
.../DamerauLevenshteinDistance.java | 326 ++++++++++++++++++
.../DamerauLevenshteinDistanceTest.java | 220 ++++++++++++
2 files changed, 546 insertions(+)
create mode 100644 src/main/java/org/apache/commons/text/similarity/DamerauLevenshteinDistance.java
create mode 100644 src/test/java/org/apache/commons/text/similarity/DamerauLevenshteinDistanceTest.java
diff --git a/src/main/java/org/apache/commons/text/similarity/DamerauLevenshteinDistance.java b/src/main/java/org/apache/commons/text/similarity/DamerauLevenshteinDistance.java
new file mode 100644
index 0000000000..d7685ebc29
--- /dev/null
+++ b/src/main/java/org/apache/commons/text/similarity/DamerauLevenshteinDistance.java
@@ -0,0 +1,326 @@
+/*
+ * 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
+ *
+ * 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,
+ * 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.
+ */
+package org.apache.commons.text.similarity;
+
+/**
+ * An algorithm for measuring the difference between two character sequences using the
+ * Damerau-Levenshtein Distance.
+ *
+ *
+ * This is the number of changes needed to change one sequence into another, where each change is a single character
+ * modification (deletion, insertion, substitution, or transposition of two adjacent characters).
+ *
+ *
+ * @see Damerau-Levenshtein Distance on Wikipedia
+ * @since 1.15.0
+ */
+public class DamerauLevenshteinDistance implements EditDistance {
+
+ /**
+ * Utility function to ensure distance is valid according to threshold.
+ *
+ * @param distance The distance value
+ * @param threshold The threshold value
+ * @return The distance value, or {@code -1} if distance is greater than threshold
+ */
+ private static int clampDistance(final int distance, final int threshold) {
+ return distance > threshold ? -1 : distance;
+ }
+
+ /**
+ * Finds the Damerau-Levenshtein distance between two CharSequences if it's less than or equal to a given threshold.
+ *
+ * @param left the first SimilarityInput, must not be null.
+ * @param right the second SimilarityInput, must not be null.
+ * @param threshold the target threshold, must not be negative.
+ * @return result distance, or -1 if distance exceeds threshold
+ */
+ private static int limitedCompare(SimilarityInput left, SimilarityInput right, final int threshold) {
+ if (left == null || right == null) {
+ throw new IllegalArgumentException("Left/right inputs must not be null");
+ }
+
+ if (threshold < 0) {
+ throw new IllegalArgumentException("Threshold can not be negative");
+ }
+
+ // Implementation based on https://en.wikipedia.org/wiki/Damerau%E2%80%93Levenshtein_distance#Optimal_string_alignment_distance
+
+ int leftLength = left.length();
+ int rightLength = right.length();
+
+ if (leftLength == 0) {
+ return clampDistance(rightLength, threshold);
+ }
+
+ if (rightLength == 0) {
+ return clampDistance(leftLength, threshold);
+ }
+
+ // Inspired by LevenshteinDistance impl; swap the input strings to consume less memory
+ if (rightLength > leftLength) {
+ final SimilarityInput tmp = left;
+ left = right;
+ right = tmp;
+ leftLength = rightLength;
+ rightLength = right.length();
+ }
+
+ // If the difference between the lengths of the strings is greater than the threshold, we must at least do
+ // threshold operations so we can return early
+ if (leftLength - rightLength > threshold) {
+ return -1;
+ }
+
+ // Use three arrays of minimum possible size to reduce memory usage. This avoids having to create a 2D
+ // array of size leftLength * rightLength
+ int[] curr = new int[rightLength + 1];
+ int[] prev = new int[rightLength + 1];
+ int[] prevPrev = new int[rightLength + 1];
+ int[] temp; // Temp variable use to shuffle arrays at the end of each iteration
+
+ int rightIndex, leftIndex, cost, minCost;
+
+ // Changing empty sequence to [0..i] requires i insertions
+ for (rightIndex = 0; rightIndex <= rightLength; rightIndex++) {
+ prev[rightIndex] = rightIndex;
+ }
+
+ // Calculate how many operations it takes to change right[0..rightIndex] into left[0..leftIndex]
+ // For each iteration
+ // - curr[i] contains the cost of changing right[0..i] into left[0..leftIndex]
+ // (computed in current iteration)
+ // - prev[i] contains the cost of changing right[0..i] into left[0..leftIndex - 1]
+ // (computed in previous iteration)
+ // - prevPrev[i] contains the cost of changing right[0..i] into left[0..leftIndex - 2]
+ // (computed in iteration before previous)
+ for (leftIndex = 1; leftIndex <= leftLength; leftIndex++) {
+ // For right[0..0] we must insert leftIndex characters, which means the cost is always leftIndex
+ curr[0] = leftIndex;
+
+ minCost = Integer.MAX_VALUE;
+
+ for (rightIndex = 1; rightIndex <= rightLength; rightIndex++) {
+ cost = (left.at(leftIndex - 1) == right.at(rightIndex - 1)) ? 0 : 1;
+
+ // Select cheapest operation
+ curr[rightIndex] = Math.min(
+ Math.min(
+ prev[rightIndex] + 1, // Delete current character
+ curr[rightIndex - 1] + 1 // Insert current character
+ ),
+ prev[rightIndex - 1] + cost // Replace (or no cost if same character)
+ );
+
+ // Check if adjacent characters are the same -> transpose if cheaper
+ if (leftIndex > 1
+ && rightIndex > 1
+ && left.at(leftIndex - 1) == right.at(rightIndex - 2)
+ && left.at(leftIndex - 2) == right.at(rightIndex - 1)) {
+ // Use cost here, to properly handle two subsequent equal letters
+ curr[rightIndex] = Math.min(curr[rightIndex], prevPrev[rightIndex - 2] + cost);
+ }
+
+ minCost = Math.min(curr[rightIndex], minCost);
+ }
+
+ // If there was no total cost for this entire iteration to transform right to left[0..leftIndex], there
+ // can not be a way to do it below threshold. This is because we have no way to reduce the overall cost
+ // in later operations.
+ if (minCost > threshold) {
+ return -1;
+ }
+
+ // Rotate arrays for next iteration
+ temp = prevPrev;
+ prevPrev = prev;
+ prev = curr;
+ curr = temp;
+ }
+
+ // Prev contains the value computed in the latest iteration
+ return clampDistance(prev[rightLength], threshold);
+ }
+
+ /**
+ * Finds the Damerau-Levenshtein distance between two inputs using optimal string alignment.
+ *
+ * @param left the first CharSequence, must not be null.
+ * @param right the second CharSequence, must not be null.
+ * @return result distance.
+ * @throws IllegalArgumentException if either CharSequence input is {@code null}.
+ */
+ private static int unlimitedCompare(SimilarityInput left, SimilarityInput right) {
+ if (left == null || right == null) {
+ throw new IllegalArgumentException("Left/right inputs must not be null");
+ }
+
+ /*
+ * Implementation based on https://en.wikipedia.org/wiki/Damerau%E2%80%93Levenshtein_distance#Optimal_string_alignment_distance
+ */
+
+ int leftLength = left.length();
+ int rightLength = right.length();
+
+ if (leftLength == 0) {
+ return rightLength;
+ }
+
+ if (rightLength == 0) {
+ return leftLength;
+ }
+
+ // Inspired by LevenshteinDistance impl; swap the input strings to consume less memory
+ if (rightLength > leftLength) {
+ final SimilarityInput tmp = left;
+ left = right;
+ right = tmp;
+ leftLength = rightLength;
+ rightLength = right.length();
+ }
+
+ // Use three arrays of minimum possible size to reduce memory usage. This avoids having to create a 2D
+ // array of size leftLength * rightLength
+ int[] curr = new int[rightLength + 1];
+ int[] prev = new int[rightLength + 1];
+ int[] prevPrev = new int[rightLength + 1];
+ int[] temp; // Temp variable use to shuffle arrays at the end of each iteration
+
+ int rightIndex, leftIndex, cost;
+
+ // Changing empty sequence to [0..i] requires i insertions
+ for (rightIndex = 0; rightIndex <= rightLength; rightIndex++) {
+ prev[rightIndex] = rightIndex;
+ }
+
+ // Calculate how many operations it takes to change right[0..rightIndex] into left[0..leftIndex]
+ // For each iteration
+ // - curr[i] contains the cost of changing right[0..i] into left[0..leftIndex]
+ // (computed in current iteration)
+ // - prev[i] contains the cost of changing right[0..i] into left[0..leftIndex - 1]
+ // (computed in previous iteration)
+ // - prevPrev[i] contains the cost of changing right[0..i] into left[0..leftIndex - 2]
+ // (computed in iteration before previous)
+ for (leftIndex = 1; leftIndex <= leftLength; leftIndex++) {
+ // For right[0..0] we must insert leftIndex characters, which means the cost is always leftIndex
+ curr[0] = leftIndex;
+
+ for (rightIndex = 1; rightIndex <= rightLength; rightIndex++) {
+ cost = (left.at(leftIndex - 1) == right.at(rightIndex - 1)) ? 0 : 1;
+
+ // Select cheapest operation
+ curr[rightIndex] = Math.min(
+ Math.min(
+ prev[rightIndex] + 1, // Delete current character
+ curr[rightIndex - 1] + 1 // Insert current character
+ ),
+ prev[rightIndex - 1] + cost // Replace (or no cost if same character)
+ );
+
+ // Check if adjacent characters are the same -> transpose if cheaper
+ if (leftIndex > 1
+ && rightIndex > 1
+ && left.at(leftIndex - 1) == right.at(rightIndex - 2)
+ && left.at(leftIndex - 2) == right.at(rightIndex - 1)) {
+ // Use cost here, to properly handle two subsequent equal letters
+ curr[rightIndex] = Math.min(curr[rightIndex], prevPrev[rightIndex - 2] + cost);
+ }
+ }
+
+ // Rotate arrays for next iteration
+ temp = prevPrev;
+ prevPrev = prev;
+ prev = curr;
+ curr = temp;
+ }
+
+ // Prev contains the value computed in the latest iteration
+ return prev[rightLength];
+ }
+
+ /**
+ * Threshold.
+ */
+ private final Integer threshold;
+
+ /**
+ * Constructs a default instance that uses a version of the algorithm that does not use a threshold parameter.
+ */
+ public DamerauLevenshteinDistance() {
+ this(null);
+ }
+
+ /**
+ * Constructs a new instance. If the threshold is not null, distance calculations will be limited to a maximum length.
+ * If the threshold is null, the unlimited version of the algorithm will be used.
+ *
+ * @param threshold If this is null then distances calculations will not be limited. This may not be negative.
+ */
+ public DamerauLevenshteinDistance(final Integer threshold) {
+ if (threshold != null && threshold < 0) {
+ throw new IllegalArgumentException("Threshold must not be negative");
+ }
+ this.threshold = threshold;
+ }
+
+ /**
+ * Computes the Damerau-Levenshtein distance between two Strings.
+ *
+ *
+ * A higher score indicates a greater distance.
+ *
+ *
+ * @param left the first input, must not be null.
+ * @param right the second input, must not be null.
+ * @return result distance, or -1 if threshold is exceeded.
+ * @throws IllegalArgumentException if either String input {@code null}.
+ */
+ @Override
+ public Integer apply(final CharSequence left, final CharSequence right) {
+ return apply(SimilarityInput.input(left), SimilarityInput.input(right));
+ }
+
+ /**
+ * Computes the Damerau-Levenshtein distance between two inputs.
+ *
+ *
+ * A higher score indicates a greater distance.
+ *
+ *
+ * @param The type of similarity score unit.
+ * @param left the first input, must not be null.
+ * @param right the second input, must not be null.
+ * @return result distance, or -1 if threshold is exceeded.
+ * @throws IllegalArgumentException if either String input {@code null}.
+ * @since 1.13.0
+ */
+ public Integer apply(final SimilarityInput left, final SimilarityInput right) {
+ if (threshold != null) {
+ return limitedCompare(left, right, threshold);
+ }
+ return unlimitedCompare(left, right);
+ }
+
+ /**
+ * Gets the distance threshold.
+ *
+ * @return The distance threshold.
+ */
+ public Integer getThreshold() {
+ return threshold;
+ }
+}
diff --git a/src/test/java/org/apache/commons/text/similarity/DamerauLevenshteinDistanceTest.java b/src/test/java/org/apache/commons/text/similarity/DamerauLevenshteinDistanceTest.java
new file mode 100644
index 0000000000..d1c1dcadc6
--- /dev/null
+++ b/src/test/java/org/apache/commons/text/similarity/DamerauLevenshteinDistanceTest.java
@@ -0,0 +1,220 @@
+/*
+ * 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
+ *
+ * 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,
+ * 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.
+ */
+package org.apache.commons.text.similarity;
+
+import static org.junit.jupiter.api.Assertions.assertNull;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertThrows;
+
+import java.util.Arrays;
+import java.util.stream.Stream;
+
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.Arguments;
+import org.junit.jupiter.params.provider.MethodSource;
+
+public class DamerauLevenshteinDistanceTest {
+
+ private static DamerauLevenshteinDistance defaultInstance;
+
+ @BeforeAll
+ static void createInstance() {
+ defaultInstance = new DamerauLevenshteinDistance();
+ }
+
+ @Test
+ void testGetThresholdDirectlyAfterObjectInstantiation() {
+ assertNull(defaultInstance.getThreshold());
+ }
+
+ @Test
+ void testGetThresholdIsCorrect() {
+ DamerauLevenshteinDistance distance = new DamerauLevenshteinDistance(10);
+
+ assertEquals(10, distance.getThreshold());
+ }
+
+ @Test
+ void testNullInputsThrowUnlimited() {
+ assertThrows(IllegalArgumentException.class, () -> defaultInstance.apply(null, "test"));
+ assertThrows(IllegalArgumentException.class, () -> defaultInstance.apply("test", null));
+ assertThrows(IllegalArgumentException.class, () -> defaultInstance.apply(null, SimilarityInput.input("test")));
+ assertThrows(IllegalArgumentException.class, () -> defaultInstance.apply(SimilarityInput.input("test"), null));
+ }
+
+ @Test
+ void testNullInputsThrowLimited() {
+ DamerauLevenshteinDistance instance = new DamerauLevenshteinDistance(10);
+
+ assertThrows(IllegalArgumentException.class, () -> instance.apply(null, "test"));
+ assertThrows(IllegalArgumentException.class, () -> instance.apply("test", null));
+ assertThrows(IllegalArgumentException.class, () -> instance.apply(null, SimilarityInput.input("test")));
+ assertThrows(IllegalArgumentException.class, () -> instance.apply(SimilarityInput.input("test"), null));
+ }
+
+ @Test
+ void testInvalidThresholdThrows() {
+ assertThrows(IllegalArgumentException.class, () -> new DamerauLevenshteinDistance(-1));
+ }
+
+ @ParameterizedTest(name = "DamerauLevenshteinDistance.unlimitedCompare(\"{0}\", \"{1}\") should return {2}")
+ @MethodSource("unlimitedDamerauLevenshteinDistanceTestCases")
+ void testCalculateDamerauLevenshteinDistance(String left, String right, int expectedDistance) {
+ int leftRightDistance = defaultInstance.apply(left, right);
+ int rightLeftDistance = defaultInstance.apply(right, left);
+
+ assertEquals(expectedDistance, leftRightDistance);
+ assertEquals(expectedDistance, rightLeftDistance);
+ }
+
+ @ParameterizedTest(name = "DamerauLevenshteinDistance.unlimitedCompare(\"{0}\", \"{1}\") should return {2} ({3})")
+ @MethodSource("unlimitedDamerauLevenshteinDistanceTestCases_SimilarityInput")
+ void testCalculateDamerauLevenshteinDistance_SimilarityInput(String left, String right, int expectedDistance, final Class> cls) {
+ SimilarityInput
- Use a StringSubstitutorReader
+ Use a StringSubstitutorReader
to avoid reading a whole file into memory as a String to perform string substitution, for example, when a Servlet filters a file to a client.
@@ -99,13 +99,13 @@ limitations under the License.
@@ -192,7 +192,7 @@ limitations under the License.
construct a complex string.
NOTE: The list of lookups available by default changed in version 1.10.0. See the documentation for
- StringLookupFactory
+ StringLookupFactory
for details and instructions on how to reproduce the previous behavior.
From 04d98c4e9d86f2f3eb04079b74885f254fcc8ee8 Mon Sep 17 00:00:00 2001
From: Gary Gregory
Date: Fri, 7 Nov 2025 05:58:53 -0500
Subject: [PATCH 049/188] Bump commons-io:commons-io from 2.20.0 to 2.21.0
---
pom.xml | 2 +-
src/changes/changes.xml | 23 ++++++++++++-----------
2 files changed, 13 insertions(+), 12 deletions(-)
diff --git a/pom.xml b/pom.xml
index c34914b36d..e54d054494 100644
--- a/pom.xml
+++ b/pom.xml
@@ -109,7 +109,7 @@
commons-iocommons-io
- 2.20.0
+ 2.21.0test
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index 61138101f9..e12bb48ac8 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -46,17 +46,18 @@ The type attribute can be add,update,fix,remove.
-
- Fix exception message typo in XmlStringLookup.XmlStringLookup(Map, Path...).
- Inserting at end of a TextStringBuilder throws a StringIndexOutOfBoundsException.
-
- Add experimental CycloneDX VEX file #683.
- Add Damerau-Levenshtein distance #687.
-
- Bump org.apache.commons:commons-parent from 85 to 91 #704.
- Bump commons.bytebuddy.version from 1.17.6 to 1.17.8 #696.
- 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.19.0.
+
+ Fix exception message typo in XmlStringLookup.XmlStringLookup(Map, Path...).
+ Inserting at end of a TextStringBuilder throws a StringIndexOutOfBoundsException.
+
+ Add experimental CycloneDX VEX file #683.
+ Add Damerau-Levenshtein distance #687.
+
+ Bump org.apache.commons:commons-parent from 85 to 91 #704.
+ Bump commons.bytebuddy.version from 1.17.6 to 1.17.8 #696.
+ 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.19.0.
+ Bump commons-io:commons-io from 2.20.0 to 2.21.0.
From 271181b949d248a3f2397e67c44f834c2951486a Mon Sep 17 00:00:00 2001
From: Gary Gregory
Date: Fri, 7 Nov 2025 15:18:39 -0500
Subject: [PATCH 050/188] Typo
---
CONTRIBUTING.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 29041c11c4..9d1083cc5e 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -69,7 +69,7 @@ Making Changes
+ 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.
From 9398a77cf70f668cf0a72fe5746d3e81b75bc9c7 Mon Sep 17 00:00:00 2001
From: Gary Gregory
Date: Sat, 8 Nov 2025 11:23:53 -0500
Subject: [PATCH 051/188] No need to override project/issueManagement/system
---
pom.xml | 1 -
1 file changed, 1 deletion(-)
diff --git a/pom.xml b/pom.xml
index e54d054494..1f331014d0 100644
--- a/pom.xml
+++ b/pom.xml
@@ -414,7 +414,6 @@
https://gitbox.apache.org/repos/asf?p=commons-text.git
- jirahttps://issues.apache.org/jira/browse/TEXT
From 965f90dc297137e703cbd8d3f79b0239de5bef98 Mon Sep 17 00:00:00 2001
From: Gary Gregory
Date: Tue, 11 Nov 2025 07:39:01 -0500
Subject: [PATCH 052/188] Javadoc
---
.../org/apache/commons/text/lookup/StringLookupFactory.java | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/main/java/org/apache/commons/text/lookup/StringLookupFactory.java b/src/main/java/org/apache/commons/text/lookup/StringLookupFactory.java
index e3678f3ff1..229c410d39 100644
--- a/src/main/java/org/apache/commons/text/lookup/StringLookupFactory.java
+++ b/src/main/java/org/apache/commons/text/lookup/StringLookupFactory.java
@@ -363,7 +363,7 @@ Map getDefaultStringLookups() {
/**
* Name of the system property used to determine the string lookups added by the {@link #addDefaultStringLookups(Map)} method. Use of this property is only
- * required in cases where the set of default lookups must be modified. (See the class documentation for details.)
+ * required in cases where the set of default lookups must be modified. (See the {@link StringLookupFactory class documentation} for details.)
*
* @since 1.10.0
*/
@@ -657,6 +657,9 @@ private StringLookupFactory(final Path[] fences) {
* Adds the default string lookups for this class to {@code stringLookupMap}. The default string lookups are a set of built-in lookups added for convenience
* during string interpolation. The defaults may be configured using the {@value #DEFAULT_STRING_LOOKUPS_PROPERTY} system property. See the class
* documentation for details and a list of lookups.
+ *
+ * The format of the property string is a comma-separated list of names from the {@link DefaultStringLookup} enum.
+ *
*
* @param stringLookupMap the map of string lookups to edit.
* @since 1.5
From 0b63d06654e10418ce49f83f882531cf603bf80e Mon Sep 17 00:00:00 2001
From: Gary Gregory
Date: Tue, 11 Nov 2025 07:40:04 -0500
Subject: [PATCH 053/188] Javadoc
---
.../org/apache/commons/text/lookup/StringLookupFactory.java | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/main/java/org/apache/commons/text/lookup/StringLookupFactory.java b/src/main/java/org/apache/commons/text/lookup/StringLookupFactory.java
index 229c410d39..2f163b8e05 100644
--- a/src/main/java/org/apache/commons/text/lookup/StringLookupFactory.java
+++ b/src/main/java/org/apache/commons/text/lookup/StringLookupFactory.java
@@ -364,6 +364,9 @@ Map getDefaultStringLookups() {
/**
* Name of the system property used to determine the string lookups added by the {@link #addDefaultStringLookups(Map)} method. Use of this property is only
* required in cases where the set of default lookups must be modified. (See the {@link StringLookupFactory class documentation} for details.)
+ *
+ * The format of the property string is a comma-separated list of names from the {@link DefaultStringLookup} enum.
+ *
*
* @since 1.10.0
*/
From aab6439edd5c25d399d3435d8f79be20994270f9 Mon Sep 17 00:00:00 2001
From: Michael Hausegger
Date: Fri, 14 Nov 2025 19:47:03 +0100
Subject: [PATCH 054/188] Add unit tests to increase coverage (#719)
* Added new Unit Tests to increase coverage
* Remove trailing whitespace
* I verified a before-and-after JaCoCo report that each change improved coverage.
---------
Co-authored-by: TheRealHaui
Co-authored-by: Gary Gregory
---
.../commons/text/StringSubstitutorTest.java | 7 +++++++
.../text/similarity/HammingDistanceTest.java | 15 +++++++++++++++
.../text/similarity/JaroWinklerDistanceTest.java | 10 ++++++++++
.../similarity/JaroWinklerSimilarityTest.java | 10 ++++++++++
4 files changed, 42 insertions(+)
diff --git a/src/test/java/org/apache/commons/text/StringSubstitutorTest.java b/src/test/java/org/apache/commons/text/StringSubstitutorTest.java
index 0f1fbf4339..3692653f10 100644
--- a/src/test/java/org/apache/commons/text/StringSubstitutorTest.java
+++ b/src/test/java/org/apache/commons/text/StringSubstitutorTest.java
@@ -1078,4 +1078,11 @@ void testSubstitutePreserveEscape() throws IOException {
assertEqualsCharSeq("value $${escaped}", replace(sub, org));
}
+ @Test
+ void testDetectsCyclicSubstitution() {
+ final Map map = new HashMap<>();
+ map.put("name", "");
+ assertThrows(IllegalStateException.class, () -> StringSubstitutor.replace("Hi !", map, "<", ">"));
+ }
+
}
diff --git a/src/test/java/org/apache/commons/text/similarity/HammingDistanceTest.java b/src/test/java/org/apache/commons/text/similarity/HammingDistanceTest.java
index 181d2fe277..918a7bedc2 100644
--- a/src/test/java/org/apache/commons/text/similarity/HammingDistanceTest.java
+++ b/src/test/java/org/apache/commons/text/similarity/HammingDistanceTest.java
@@ -59,6 +59,21 @@ void testHammingDistance_nullRightValue() {
assertThrows(IllegalArgumentException.class, () -> distance.apply("", null));
}
+ @Test
+ void testApply_NullSimilarityInput() {
+ assertThrows(IllegalArgumentException.class, () -> distance.apply(null, new SimilarityCharacterInput("a")));
+ }
+
+ @Test
+ void testApply_SimilarityInputNull() {
+ assertThrows(IllegalArgumentException.class, () -> distance.apply(new SimilarityCharacterInput("a"), null));
+ }
+
+ @Test
+ void testApply_DifferentSimilarityInputLength() {
+ assertThrows(IllegalArgumentException.class, () -> distance.apply(new SimilarityCharacterInput("a"), new SimilarityCharacterInput("ab")));
+ }
+
@Test
void testHammingDistanceCharSequence() {
assertEquals(0, distance.apply("", ""));
diff --git a/src/test/java/org/apache/commons/text/similarity/JaroWinklerDistanceTest.java b/src/test/java/org/apache/commons/text/similarity/JaroWinklerDistanceTest.java
index f1242fb301..412f1e721c 100644
--- a/src/test/java/org/apache/commons/text/similarity/JaroWinklerDistanceTest.java
+++ b/src/test/java/org/apache/commons/text/similarity/JaroWinklerDistanceTest.java
@@ -95,4 +95,14 @@ void testGetJaroWinklerDistance_StringString() {
assertEquals(1 - 0.51111d, distance.apply("foo", " foo"), 0.00001d);
}
+ @Test
+ void testApply_NullSimilarityInput() {
+ assertThrows(IllegalArgumentException.class, () -> distance.apply(null, new SimilarityCharacterInput("a")));
+ }
+
+ @Test
+ void testApply_SimilarityInputNull() {
+ assertThrows(IllegalArgumentException.class, () -> distance.apply(new SimilarityCharacterInput("a"), null));
+ }
+
}
diff --git a/src/test/java/org/apache/commons/text/similarity/JaroWinklerSimilarityTest.java b/src/test/java/org/apache/commons/text/similarity/JaroWinklerSimilarityTest.java
index a5acfb2394..0b1f97052a 100644
--- a/src/test/java/org/apache/commons/text/similarity/JaroWinklerSimilarityTest.java
+++ b/src/test/java/org/apache/commons/text/similarity/JaroWinklerSimilarityTest.java
@@ -136,4 +136,14 @@ void testGetJaroWinklerSimilarity_StringString() {
assertEquals(0.911111d, similarity.apply(wrap("John Horn"), "John Hopkins"), 0.00001d);
}
+ @Test
+ void testApply_NullSimilarityInput() {
+ assertThrows(IllegalArgumentException.class, () -> similarity.apply(null, new SimilarityCharacterInput("a")));
+ }
+
+ @Test
+ void testApply_SimilarityInputNull() {
+ assertThrows(IllegalArgumentException.class, () -> similarity.apply(new SimilarityCharacterInput("a"), null));
+ }
+
}
From 9280e357ac8ef9c9a8b4dc0c35985f9b6a5ef538 Mon Sep 17 00:00:00 2001
From: Gary Gregory
Date: Fri, 14 Nov 2025 13:49:03 -0500
Subject: [PATCH 055/188] Add unit tests to increase coverage #719
---
src/changes/changes.xml | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index e12bb48ac8..21c89d0d00 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -52,6 +52,7 @@ The type attribute can be add,update,fix,remove.
Add experimental CycloneDX VEX file #683.Add Damerau-Levenshtein distance #687.
+ Add unit tests to increase coverage #719.Bump org.apache.commons:commons-parent from 85 to 91 #704.Bump commons.bytebuddy.version from 1.17.6 to 1.17.8 #696.
From 0211ac6868f7329256a093de6b87c67c393cb424 Mon Sep 17 00:00:00 2001
From: Gary Gregory
Date: Fri, 14 Nov 2025 13:59:25 -0500
Subject: [PATCH 056/188] Sort members
---
.../commons/text/StringSubstitutorTest.java | 14 +++---
.../text/similarity/HammingDistanceTest.java | 48 +++++++++----------
.../similarity/JaroWinklerDistanceTest.java | 20 ++++----
.../similarity/JaroWinklerSimilarityTest.java | 28 +++++------
4 files changed, 55 insertions(+), 55 deletions(-)
diff --git a/src/test/java/org/apache/commons/text/StringSubstitutorTest.java b/src/test/java/org/apache/commons/text/StringSubstitutorTest.java
index 3692653f10..75f112ba6b 100644
--- a/src/test/java/org/apache/commons/text/StringSubstitutorTest.java
+++ b/src/test/java/org/apache/commons/text/StringSubstitutorTest.java
@@ -228,6 +228,13 @@ void testConstructorStringSubstitutor() {
assertTrue(target.getVariableSuffixMatcher().toString().endsWith("['s']"), target.getValueDelimiterMatcher().toString());
}
+ @Test
+ void testDetectsCyclicSubstitution() {
+ final Map map = new HashMap<>();
+ map.put("name", "");
+ assertThrows(IllegalStateException.class, () -> StringSubstitutor.replace("Hi !", map, "<", ">"));
+ }
+
/**
* Tests get set.
*/
@@ -1078,11 +1085,4 @@ void testSubstitutePreserveEscape() throws IOException {
assertEqualsCharSeq("value $${escaped}", replace(sub, org));
}
- @Test
- void testDetectsCyclicSubstitution() {
- final Map map = new HashMap<>();
- map.put("name", "");
- assertThrows(IllegalStateException.class, () -> StringSubstitutor.replace("Hi !", map, "<", ">"));
- }
-
}
diff --git a/src/test/java/org/apache/commons/text/similarity/HammingDistanceTest.java b/src/test/java/org/apache/commons/text/similarity/HammingDistanceTest.java
index 918a7bedc2..0b8e5e133c 100644
--- a/src/test/java/org/apache/commons/text/similarity/HammingDistanceTest.java
+++ b/src/test/java/org/apache/commons/text/similarity/HammingDistanceTest.java
@@ -36,42 +36,42 @@ public static void setUp() {
distance = new HammingDistance();
}
- @ParameterizedTest
- @MethodSource("org.apache.commons.text.similarity.SimilarityInputTest#similarityInputsEquals()")
- void testHammingDistance(final Class> cls) {
- assertEquals(0, distance.apply(SimilarityInputTest.build(cls, ""), SimilarityInputTest.build(cls, "")));
- assertEquals(0, distance.apply(SimilarityInputTest.build(cls, "pappa"), SimilarityInputTest.build(cls, "pappa")));
- assertEquals(1, distance.apply(SimilarityInputTest.build(cls, "papaa"), SimilarityInputTest.build(cls, "pappa")));
- assertEquals(3, distance.apply(SimilarityInputTest.build(cls, "karolin"), SimilarityInputTest.build(cls, "kathrin")));
- assertEquals(3, distance.apply(SimilarityInputTest.build(cls, "karolin"), SimilarityInputTest.build(cls, "kerstin")));
- assertEquals(2, distance.apply(SimilarityInputTest.build(cls, "1011101"), SimilarityInputTest.build(cls, "1001001")));
- assertEquals(3, distance.apply(SimilarityInputTest.build(cls, "2173896"), SimilarityInputTest.build(cls, "2233796")));
- assertEquals(2, distance.apply(SimilarityInputTest.build(cls, "ATCG"), SimilarityInputTest.build(cls, "ACCC")));
+ @Test
+ void testApply_DifferentSimilarityInputLength() {
+ assertThrows(IllegalArgumentException.class, () -> distance.apply(new SimilarityCharacterInput("a"), new SimilarityCharacterInput("ab")));
}
@Test
- void testHammingDistance_nullLeftValue() {
- assertThrows(IllegalArgumentException.class, () -> distance.apply(null, ""));
- }
+ void testApply_NullSimilarityInput() {
+ assertThrows(IllegalArgumentException.class, () -> distance.apply(null, new SimilarityCharacterInput("a")));
+ }
@Test
- void testHammingDistance_nullRightValue() {
- assertThrows(IllegalArgumentException.class, () -> distance.apply("", null));
+ void testApply_SimilarityInputNull() {
+ assertThrows(IllegalArgumentException.class, () -> distance.apply(new SimilarityCharacterInput("a"), null));
}
- @Test
- void testApply_NullSimilarityInput() {
- assertThrows(IllegalArgumentException.class, () -> distance.apply(null, new SimilarityCharacterInput("a")));
- }
+ @ParameterizedTest
+ @MethodSource("org.apache.commons.text.similarity.SimilarityInputTest#similarityInputsEquals()")
+ void testHammingDistance(final Class> cls) {
+ assertEquals(0, distance.apply(SimilarityInputTest.build(cls, ""), SimilarityInputTest.build(cls, "")));
+ assertEquals(0, distance.apply(SimilarityInputTest.build(cls, "pappa"), SimilarityInputTest.build(cls, "pappa")));
+ assertEquals(1, distance.apply(SimilarityInputTest.build(cls, "papaa"), SimilarityInputTest.build(cls, "pappa")));
+ assertEquals(3, distance.apply(SimilarityInputTest.build(cls, "karolin"), SimilarityInputTest.build(cls, "kathrin")));
+ assertEquals(3, distance.apply(SimilarityInputTest.build(cls, "karolin"), SimilarityInputTest.build(cls, "kerstin")));
+ assertEquals(2, distance.apply(SimilarityInputTest.build(cls, "1011101"), SimilarityInputTest.build(cls, "1001001")));
+ assertEquals(3, distance.apply(SimilarityInputTest.build(cls, "2173896"), SimilarityInputTest.build(cls, "2233796")));
+ assertEquals(2, distance.apply(SimilarityInputTest.build(cls, "ATCG"), SimilarityInputTest.build(cls, "ACCC")));
+ }
@Test
- void testApply_SimilarityInputNull() {
- assertThrows(IllegalArgumentException.class, () -> distance.apply(new SimilarityCharacterInput("a"), null));
+ void testHammingDistance_nullLeftValue() {
+ assertThrows(IllegalArgumentException.class, () -> distance.apply(null, ""));
}
@Test
- void testApply_DifferentSimilarityInputLength() {
- assertThrows(IllegalArgumentException.class, () -> distance.apply(new SimilarityCharacterInput("a"), new SimilarityCharacterInput("ab")));
+ void testHammingDistance_nullRightValue() {
+ assertThrows(IllegalArgumentException.class, () -> distance.apply("", null));
}
@Test
diff --git a/src/test/java/org/apache/commons/text/similarity/JaroWinklerDistanceTest.java b/src/test/java/org/apache/commons/text/similarity/JaroWinklerDistanceTest.java
index 412f1e721c..509d58bb59 100644
--- a/src/test/java/org/apache/commons/text/similarity/JaroWinklerDistanceTest.java
+++ b/src/test/java/org/apache/commons/text/similarity/JaroWinklerDistanceTest.java
@@ -36,6 +36,16 @@ public static void setUp() {
distance = new JaroWinklerDistance();
}
+ @Test
+ void testApply_NullSimilarityInput() {
+ assertThrows(IllegalArgumentException.class, () -> distance.apply(null, new SimilarityCharacterInput("a")));
+ }
+
+ @Test
+ void testApply_SimilarityInputNull() {
+ assertThrows(IllegalArgumentException.class, () -> distance.apply(new SimilarityCharacterInput("a"), null));
+ }
+
@ParameterizedTest
@MethodSource("org.apache.commons.text.similarity.SimilarityInputTest#similarityInputsEquals()")
void testGetJaroWinklerDistance(final Class> cls) {
@@ -95,14 +105,4 @@ void testGetJaroWinklerDistance_StringString() {
assertEquals(1 - 0.51111d, distance.apply("foo", " foo"), 0.00001d);
}
- @Test
- void testApply_NullSimilarityInput() {
- assertThrows(IllegalArgumentException.class, () -> distance.apply(null, new SimilarityCharacterInput("a")));
- }
-
- @Test
- void testApply_SimilarityInputNull() {
- assertThrows(IllegalArgumentException.class, () -> distance.apply(new SimilarityCharacterInput("a"), null));
- }
-
}
diff --git a/src/test/java/org/apache/commons/text/similarity/JaroWinklerSimilarityTest.java b/src/test/java/org/apache/commons/text/similarity/JaroWinklerSimilarityTest.java
index 0b1f97052a..f2a362dc12 100644
--- a/src/test/java/org/apache/commons/text/similarity/JaroWinklerSimilarityTest.java
+++ b/src/test/java/org/apache/commons/text/similarity/JaroWinklerSimilarityTest.java
@@ -78,6 +78,16 @@ public String toString() {
};
}
+ @Test
+ void testApply_NullSimilarityInput() {
+ assertThrows(IllegalArgumentException.class, () -> similarity.apply(null, new SimilarityCharacterInput("a")));
+ }
+
+ @Test
+ void testApply_SimilarityInputNull() {
+ assertThrows(IllegalArgumentException.class, () -> similarity.apply(new SimilarityCharacterInput("a"), null));
+ }
+
@ParameterizedTest
@MethodSource("org.apache.commons.text.similarity.SimilarityInputTest#similarityInputsEquals()")
void testGetJaroWinklerSimilarity(final Class> cls) {
@@ -111,10 +121,10 @@ void testGetJaroWinklerSimilarity_NullString() {
assertThrows(IllegalArgumentException.class, () -> similarity.apply(null, "clear"));
}
- @Test
- void testGetJaroWinklerSimilarity_StringNull() {
- assertThrows(IllegalArgumentException.class, () -> similarity.apply(" ", null));
- }
+ @Test
+ void testGetJaroWinklerSimilarity_StringNull() {
+ assertThrows(IllegalArgumentException.class, () -> similarity.apply(" ", null));
+ }
@Test
void testGetJaroWinklerSimilarity_StringString() {
@@ -136,14 +146,4 @@ void testGetJaroWinklerSimilarity_StringString() {
assertEquals(0.911111d, similarity.apply(wrap("John Horn"), "John Hopkins"), 0.00001d);
}
- @Test
- void testApply_NullSimilarityInput() {
- assertThrows(IllegalArgumentException.class, () -> similarity.apply(null, new SimilarityCharacterInput("a")));
- }
-
- @Test
- void testApply_SimilarityInputNull() {
- assertThrows(IllegalArgumentException.class, () -> similarity.apply(new SimilarityCharacterInput("a"), null));
- }
-
}
From b696bda8326f196803af3deee16528fc8c7400a0 Mon Sep 17 00:00:00 2001
From: Gary Gregory
Date: Sat, 15 Nov 2025 08:48:47 -0500
Subject: [PATCH 057/188] No tabs for you
---
.../text/similarity/HammingDistanceTest.java | 32 +++++++++----------
.../similarity/JaroWinklerSimilarityTest.java | 16 +++++-----
2 files changed, 24 insertions(+), 24 deletions(-)
diff --git a/src/test/java/org/apache/commons/text/similarity/HammingDistanceTest.java b/src/test/java/org/apache/commons/text/similarity/HammingDistanceTest.java
index 0b8e5e133c..7eb744856e 100644
--- a/src/test/java/org/apache/commons/text/similarity/HammingDistanceTest.java
+++ b/src/test/java/org/apache/commons/text/similarity/HammingDistanceTest.java
@@ -14,6 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+
package org.apache.commons.text.similarity;
import static org.junit.jupiter.api.Assertions.assertEquals;
@@ -42,27 +43,27 @@ void testApply_DifferentSimilarityInputLength() {
}
@Test
- void testApply_NullSimilarityInput() {
- assertThrows(IllegalArgumentException.class, () -> distance.apply(null, new SimilarityCharacterInput("a")));
- }
+ void testApply_NullSimilarityInput() {
+ assertThrows(IllegalArgumentException.class, () -> distance.apply(null, new SimilarityCharacterInput("a")));
+ }
@Test
void testApply_SimilarityInputNull() {
assertThrows(IllegalArgumentException.class, () -> distance.apply(new SimilarityCharacterInput("a"), null));
}
- @ParameterizedTest
- @MethodSource("org.apache.commons.text.similarity.SimilarityInputTest#similarityInputsEquals()")
- void testHammingDistance(final Class> cls) {
- assertEquals(0, distance.apply(SimilarityInputTest.build(cls, ""), SimilarityInputTest.build(cls, "")));
- assertEquals(0, distance.apply(SimilarityInputTest.build(cls, "pappa"), SimilarityInputTest.build(cls, "pappa")));
- assertEquals(1, distance.apply(SimilarityInputTest.build(cls, "papaa"), SimilarityInputTest.build(cls, "pappa")));
- assertEquals(3, distance.apply(SimilarityInputTest.build(cls, "karolin"), SimilarityInputTest.build(cls, "kathrin")));
- assertEquals(3, distance.apply(SimilarityInputTest.build(cls, "karolin"), SimilarityInputTest.build(cls, "kerstin")));
- assertEquals(2, distance.apply(SimilarityInputTest.build(cls, "1011101"), SimilarityInputTest.build(cls, "1001001")));
- assertEquals(3, distance.apply(SimilarityInputTest.build(cls, "2173896"), SimilarityInputTest.build(cls, "2233796")));
- assertEquals(2, distance.apply(SimilarityInputTest.build(cls, "ATCG"), SimilarityInputTest.build(cls, "ACCC")));
- }
+ @ParameterizedTest
+ @MethodSource("org.apache.commons.text.similarity.SimilarityInputTest#similarityInputsEquals()")
+ void testHammingDistance(final Class> cls) {
+ assertEquals(0, distance.apply(SimilarityInputTest.build(cls, ""), SimilarityInputTest.build(cls, "")));
+ assertEquals(0, distance.apply(SimilarityInputTest.build(cls, "pappa"), SimilarityInputTest.build(cls, "pappa")));
+ assertEquals(1, distance.apply(SimilarityInputTest.build(cls, "papaa"), SimilarityInputTest.build(cls, "pappa")));
+ assertEquals(3, distance.apply(SimilarityInputTest.build(cls, "karolin"), SimilarityInputTest.build(cls, "kathrin")));
+ assertEquals(3, distance.apply(SimilarityInputTest.build(cls, "karolin"), SimilarityInputTest.build(cls, "kerstin")));
+ assertEquals(2, distance.apply(SimilarityInputTest.build(cls, "1011101"), SimilarityInputTest.build(cls, "1001001")));
+ assertEquals(3, distance.apply(SimilarityInputTest.build(cls, "2173896"), SimilarityInputTest.build(cls, "2233796")));
+ assertEquals(2, distance.apply(SimilarityInputTest.build(cls, "ATCG"), SimilarityInputTest.build(cls, "ACCC")));
+ }
@Test
void testHammingDistance_nullLeftValue() {
@@ -85,5 +86,4 @@ void testHammingDistanceCharSequence() {
assertEquals(3, distance.apply("2173896", "2233796"));
assertEquals(2, distance.apply("ATCG", "ACCC"));
}
-
}
diff --git a/src/test/java/org/apache/commons/text/similarity/JaroWinklerSimilarityTest.java b/src/test/java/org/apache/commons/text/similarity/JaroWinklerSimilarityTest.java
index f2a362dc12..55986ab59d 100644
--- a/src/test/java/org/apache/commons/text/similarity/JaroWinklerSimilarityTest.java
+++ b/src/test/java/org/apache/commons/text/similarity/JaroWinklerSimilarityTest.java
@@ -14,6 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+
package org.apache.commons.text.similarity;
import static org.junit.jupiter.api.Assertions.assertEquals;
@@ -79,9 +80,9 @@ public String toString() {
}
@Test
- void testApply_NullSimilarityInput() {
- assertThrows(IllegalArgumentException.class, () -> similarity.apply(null, new SimilarityCharacterInput("a")));
- }
+ void testApply_NullSimilarityInput() {
+ assertThrows(IllegalArgumentException.class, () -> similarity.apply(null, new SimilarityCharacterInput("a")));
+ }
@Test
void testApply_SimilarityInputNull() {
@@ -121,10 +122,10 @@ void testGetJaroWinklerSimilarity_NullString() {
assertThrows(IllegalArgumentException.class, () -> similarity.apply(null, "clear"));
}
- @Test
- void testGetJaroWinklerSimilarity_StringNull() {
- assertThrows(IllegalArgumentException.class, () -> similarity.apply(" ", null));
- }
+ @Test
+ void testGetJaroWinklerSimilarity_StringNull() {
+ assertThrows(IllegalArgumentException.class, () -> similarity.apply(" ", null));
+ }
@Test
void testGetJaroWinklerSimilarity_StringString() {
@@ -145,5 +146,4 @@ void testGetJaroWinklerSimilarity_StringString() {
assertEquals(0.941666d, similarity.apply(wrap("aaabcd"), "aaacdb"), 0.00001d);
assertEquals(0.911111d, similarity.apply(wrap("John Horn"), "John Hopkins"), 0.00001d);
}
-
}
From 4d8b9098e05f21e7abaa3bc6300a950c8faa4010 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Sat, 15 Nov 2025 08:49:54 -0500
Subject: [PATCH 058/188] Bump github/codeql-action from 4.31.2 to 4.31.3
(#721)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 4.31.2 to 4.31.3.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/0499de31b99561a6d14a36a5f662c2a54f91beee...014f16e7ab1402f30e7c3329d33797e7948572db)
---
updated-dependencies:
- dependency-name: github/codeql-action
dependency-version: 4.31.3
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
.github/workflows/codeql-analysis.yml | 6 +++---
.github/workflows/scorecards-analysis.yml | 2 +-
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml
index a04eb0532f..a3881f0766 100644
--- a/.github/workflows/codeql-analysis.yml
+++ b/.github/workflows/codeql-analysis.yml
@@ -57,7 +57,7 @@ jobs:
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
- uses: github/codeql-action/init@0499de31b99561a6d14a36a5f662c2a54f91beee # 3.29.5
+ uses: github/codeql-action/init@014f16e7ab1402f30e7c3329d33797e7948572db # 3.29.5
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
@@ -68,7 +68,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@0499de31b99561a6d14a36a5f662c2a54f91beee # 3.29.5
+ uses: github/codeql-action/autobuild@014f16e7ab1402f30e7c3329d33797e7948572db # 3.29.5
# âšī¸ Command-line programs to run using the OS shell.
# đ https://git.io/JvXDl
@@ -82,4 +82,4 @@ jobs:
# make release
- name: Perform CodeQL Analysis
- uses: github/codeql-action/analyze@0499de31b99561a6d14a36a5f662c2a54f91beee # 3.29.5
+ uses: github/codeql-action/analyze@014f16e7ab1402f30e7c3329d33797e7948572db # 3.29.5
diff --git a/.github/workflows/scorecards-analysis.yml b/.github/workflows/scorecards-analysis.yml
index 2372664fcd..8f94802660 100644
--- a/.github/workflows/scorecards-analysis.yml
+++ b/.github/workflows/scorecards-analysis.yml
@@ -64,6 +64,6 @@ jobs:
retention-days: 5
- name: "Upload to code-scanning"
- uses: github/codeql-action/upload-sarif@0499de31b99561a6d14a36a5f662c2a54f91beee # 3.29.5
+ uses: github/codeql-action/upload-sarif@014f16e7ab1402f30e7c3329d33797e7948572db # 3.29.5
with:
sarif_file: results.sarif
From 45584f05c622e80511ae6327220a59c29d6c0da2 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Sat, 15 Nov 2025 08:50:04 -0500
Subject: [PATCH 059/188] Bump actions/dependency-review-action from 4.8.1 to
4.8.2 (#720)
Bumps [actions/dependency-review-action](https://github.com/actions/dependency-review-action) from 4.8.1 to 4.8.2.
- [Release notes](https://github.com/actions/dependency-review-action/releases)
- [Commits](https://github.com/actions/dependency-review-action/compare/40c09b7dc99638e5ddb0bfd91c1673effc064d8a...3c4e3dcb1aa7874d2c16be7d79418e9b7efd6261)
---
updated-dependencies:
- dependency-name: actions/dependency-review-action
dependency-version: 4.8.2
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
.github/workflows/dependency-review.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.github/workflows/dependency-review.yml b/.github/workflows/dependency-review.yml
index a657a4ae2c..11834ed9d1 100644
--- a/.github/workflows/dependency-review.yml
+++ b/.github/workflows/dependency-review.yml
@@ -28,4 +28,4 @@ jobs:
- name: 'Checkout Repository'
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- name: 'Dependency Review PR'
- uses: actions/dependency-review-action@40c09b7dc99638e5ddb0bfd91c1673effc064d8a # v4.8.1
+ uses: actions/dependency-review-action@3c4e3dcb1aa7874d2c16be7d79418e9b7efd6261 # v4.8.2
From d255668d8971dc0f76e399d35dce4e3db3752c08 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Sat, 15 Nov 2025 08:55:57 -0500
Subject: [PATCH 060/188] Bump org.apache.commons:commons-parent from 91 to 92
(#723)
Bumps [org.apache.commons:commons-parent](https://github.com/apache/commons-parent) from 91 to 92.
- [Changelog](https://github.com/apache/commons-parent/blob/master/RELEASE-NOTES.txt)
- [Commits](https://github.com/apache/commons-parent/commits)
---
updated-dependencies:
- dependency-name: org.apache.commons:commons-parent
dependency-version: '92'
dependency-type: direct:production
update-type: version-update:semver-major
...
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pom.xml b/pom.xml
index 1f331014d0..5d2afd3371 100644
--- a/pom.xml
+++ b/pom.xml
@@ -20,7 +20,7 @@
org.apache.commonscommons-parent
- 91
+ 92commons-text1.15.0-SNAPSHOT
From 5c4c7c35952f4654ef872881fd59d60fd995245d Mon Sep 17 00:00:00 2001
From: Gary Gregory
Date: Sat, 15 Nov 2025 08:56:25 -0500
Subject: [PATCH 061/188] Bump org.apache.commons:commons-parent from 91 to 92
#723
---
src/changes/changes.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index 21c89d0d00..5f913a9d7a 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -54,7 +54,7 @@ The type attribute can be add,update,fix,remove.
Add Damerau-Levenshtein distance #687.Add unit tests to increase coverage #719.
- Bump org.apache.commons:commons-parent from 85 to 91 #704.
+ Bump org.apache.commons:commons-parent from 85 to 92 #704, #723.Bump commons.bytebuddy.version from 1.17.6 to 1.17.8 #696.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.19.0.
From d7bc06c49f28cbbde09c01990b5a3c3ca9a14036 Mon Sep 17 00:00:00 2001
From: Gary Gregory
Date: Sat, 15 Nov 2025 08:56:46 -0500
Subject: [PATCH 062/188] Fix typo in exception message for TextStringBuilder
---
src/changes/changes.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index 5f913a9d7a..b24bd1a0f9 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -48,7 +48,7 @@ The type attribute can be add,update,fix,remove.
Fix exception message typo in XmlStringLookup.XmlStringLookup(Map, Path...).
- Inserting at end of a TextStringBuilder throws a StringIndexOutOfBoundsException.
+ Inserting at the end of a TextStringBuilder throws a StringIndexOutOfBoundsException.Add experimental CycloneDX VEX file #683.Add Damerau-Levenshtein distance #687.
From 2b229580f64e8c3cd39e6d172e728e00f21a14cc Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Sat, 15 Nov 2025 09:04:17 -0500
Subject: [PATCH 063/188] Bump commons.bytebuddy.version from 1.17.8 to 1.18.1
(#722)
Bumps `commons.bytebuddy.version` from 1.17.8 to 1.18.1.
Updates `net.bytebuddy:byte-buddy` from 1.17.8 to 1.18.1
- [Release notes](https://github.com/raphw/byte-buddy/releases)
- [Changelog](https://github.com/raphw/byte-buddy/blob/master/release-notes.md)
- [Commits](https://github.com/raphw/byte-buddy/compare/byte-buddy-1.17.8...byte-buddy-1.18.1)
Updates `net.bytebuddy:byte-buddy-agent` from 1.17.8 to 1.18.1
- [Release notes](https://github.com/raphw/byte-buddy/releases)
- [Changelog](https://github.com/raphw/byte-buddy/blob/master/release-notes.md)
- [Commits](https://github.com/raphw/byte-buddy/compare/byte-buddy-1.17.8...byte-buddy-1.18.1)
---
updated-dependencies:
- dependency-name: net.bytebuddy:byte-buddy
dependency-version: 1.18.1
dependency-type: direct:development
update-type: version-update:semver-minor
- dependency-name: net.bytebuddy:byte-buddy-agent
dependency-version: 1.18.1
dependency-type: direct:development
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pom.xml b/pom.xml
index 5d2afd3371..fa0d58d927 100644
--- a/pom.xml
+++ b/pom.xml
@@ -48,7 +48,7 @@
https://svn.apache.org/repos/infra/websites/production/commons/content/proper/commons-textsite-content3.19.0
- 1.17.8
+ 1.18.11.6false1.37
From 213a883d915799e2b087ab28099536a9d7e1b1c6 Mon Sep 17 00:00:00 2001
From: Gary Gregory
Date: Sat, 15 Nov 2025 09:05:03 -0500
Subject: [PATCH 064/188] Bump commons.bytebuddy.version from 1.17.8 to 1.18.1
#722
---
src/changes/changes.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index b24bd1a0f9..260ef37daa 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -55,7 +55,7 @@ The type attribute can be add,update,fix,remove.
Add unit tests to increase coverage #719.Bump org.apache.commons:commons-parent from 85 to 92 #704, #723.
- Bump commons.bytebuddy.version from 1.17.6 to 1.17.8 #696.
+ Bump commons.bytebuddy.version from 1.17.6 to 1.18.1 #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.19.0.Bump commons-io:commons-io from 2.20.0 to 2.21.0.
From b1f661539eac561501a8a860a3f140bc6937c8d4 Mon Sep 17 00:00:00 2001
From: Sebb
Date: Sat, 15 Nov 2025 17:45:49 +0000
Subject: [PATCH 065/188] Dependabot => quarterly
---
.github/dependabot.yml | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/.github/dependabot.yml b/.github/dependabot.yml
index 00079caf1b..90ec55f742 100644
--- a/.github/dependabot.yml
+++ b/.github/dependabot.yml
@@ -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"
From b2b5b978ccc1cdcf08e8812f17657a71bdf3b092 Mon Sep 17 00:00:00 2001
From: Gary Gregory
Date: Sun, 16 Nov 2025 09:56:56 -0500
Subject: [PATCH 066/188] Bump commons-lang3 from 3.19.0 to 3.20.0
---
pom.xml | 2 +-
src/changes/changes.xml | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/pom.xml b/pom.xml
index fa0d58d927..4b221340f6 100644
--- a/pom.xml
+++ b/pom.xml
@@ -47,7 +47,7 @@
texthttps://svn.apache.org/repos/infra/websites/production/commons/content/proper/commons-textsite-content
- 3.19.0
+ 3.20.01.18.11.6false
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index 260ef37daa..a72d382cf3 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -57,7 +57,7 @@ The type attribute can be add,update,fix,remove.
Bump org.apache.commons:commons-parent from 85 to 92 #704, #723.Bump commons.bytebuddy.version from 1.17.6 to 1.18.1 #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.19.0.
+ 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.
From c3c3b598220b63aa1776c56482dd4a9345379783 Mon Sep 17 00:00:00 2001
From: Michael Hausegger
Date: Tue, 18 Nov 2025 18:47:20 +0100
Subject: [PATCH 067/188] TextStringBuilderTest#testAppendToStringBuffer
appends to StringBuffer now (#724)
Co-authored-by: TheRealHaui
---
.../java/org/apache/commons/text/TextStringBuilderTest.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/test/java/org/apache/commons/text/TextStringBuilderTest.java b/src/test/java/org/apache/commons/text/TextStringBuilderTest.java
index 8ef3eaa111..3317543f73 100644
--- a/src/test/java/org/apache/commons/text/TextStringBuilderTest.java
+++ b/src/test/java/org/apache/commons/text/TextStringBuilderTest.java
@@ -246,7 +246,7 @@ void testAppendToCharBuffer() throws Exception {
@Test
void testAppendToStringBuffer() throws Exception {
final TextStringBuilder sb = new TextStringBuilder("1234567890");
- final StringBuilder buffer = new StringBuilder("Test ");
+ final StringBuffer buffer = new StringBuffer("Test ");
sb.appendTo(buffer);
From eb00fd532ac4e3e59772939d434aaf7224fb5246 Mon Sep 17 00:00:00 2001
From: Gary Gregory
Date: Tue, 18 Nov 2025 12:49:03 -0500
Subject: [PATCH 068/188] Fix TextStringBuilderTest.testAppendToCharBuffer() to
use proper argument type #724
---
src/changes/changes.xml | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index a72d382cf3..ef5abe56ee 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -49,6 +49,7 @@ The type attribute can be add,update,fix,remove.
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.Add experimental CycloneDX VEX file #683.Add Damerau-Levenshtein distance #687.
From 6f42263ec6e78cf86b697f936a5bed054068c3d6 Mon Sep 17 00:00:00 2001
From: Gary Gregory
Date: Fri, 21 Nov 2025 14:25:44 +0000
Subject: [PATCH 069/188] Use HTTPS to download XML Schema
---
src/site/xdoc/download_text.xml | 2 +-
src/site/xdoc/issue-tracking.xml | 2 +-
src/site/xdoc/mail-lists.xml | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/site/xdoc/download_text.xml b/src/site/xdoc/download_text.xml
index 12c6a1a08a..4f7cbc7c3a 100644
--- a/src/site/xdoc/download_text.xml
+++ b/src/site/xdoc/download_text.xml
@@ -58,7 +58,7 @@ limitations under the License.
-->
+ xsi:schemaLocation="https://maven.apache.org/XDOC/2.0 https://maven.apache.org/xsd/xdoc-2.0.xsd">
Download Apache Commons TextApache Commons Team
diff --git a/src/site/xdoc/issue-tracking.xml b/src/site/xdoc/issue-tracking.xml
index 83219a0dd5..9ef2de7e3f 100644
--- a/src/site/xdoc/issue-tracking.xml
+++ b/src/site/xdoc/issue-tracking.xml
@@ -43,7 +43,7 @@ limitations under the License.
-->
+ xsi:schemaLocation="https://maven.apache.org/XDOC/2.0 https://maven.apache.org/xsd/xdoc-2.0.xsd">
Apache Commons Text Issue trackingApache Commons Team
diff --git a/src/site/xdoc/mail-lists.xml b/src/site/xdoc/mail-lists.xml
index 806e21bb19..c8734db5fb 100644
--- a/src/site/xdoc/mail-lists.xml
+++ b/src/site/xdoc/mail-lists.xml
@@ -41,7 +41,7 @@ limitations under the License.
-->
+ xsi:schemaLocation="https://maven.apache.org/XDOC/2.0 https://maven.apache.org/xsd/xdoc-2.0.xsd">
Apache Commons Text Mailing ListsApache Commons Team
From db60004c6bdc6d1b15c39fb04c4e9e022d1e1700 Mon Sep 17 00:00:00 2001
From: Gary Gregory
Date: Fri, 21 Nov 2025 14:44:48 +0000
Subject: [PATCH 070/188] Bump CodeQL 4.31.4
---
.github/workflows/codeql-analysis.yml | 6 +++---
.github/workflows/scorecards-analysis.yml | 2 +-
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml
index a3881f0766..60d115d843 100644
--- a/.github/workflows/codeql-analysis.yml
+++ b/.github/workflows/codeql-analysis.yml
@@ -57,7 +57,7 @@ jobs:
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
- uses: github/codeql-action/init@014f16e7ab1402f30e7c3329d33797e7948572db # 3.29.5
+ uses: github/codeql-action/init@e12f0178983d466f2f6028f5cc7a6d786fd97f4b # 4.31.4
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
@@ -68,7 +68,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@014f16e7ab1402f30e7c3329d33797e7948572db # 3.29.5
+ uses: github/codeql-action/autobuild@e12f0178983d466f2f6028f5cc7a6d786fd97f4b # 4.31.4
# âšī¸ Command-line programs to run using the OS shell.
# đ https://git.io/JvXDl
@@ -82,4 +82,4 @@ jobs:
# make release
- name: Perform CodeQL Analysis
- uses: github/codeql-action/analyze@014f16e7ab1402f30e7c3329d33797e7948572db # 3.29.5
+ uses: github/codeql-action/analyze@e12f0178983d466f2f6028f5cc7a6d786fd97f4b # 4.31.4
diff --git a/.github/workflows/scorecards-analysis.yml b/.github/workflows/scorecards-analysis.yml
index 8f94802660..d0348717cf 100644
--- a/.github/workflows/scorecards-analysis.yml
+++ b/.github/workflows/scorecards-analysis.yml
@@ -64,6 +64,6 @@ jobs:
retention-days: 5
- name: "Upload to code-scanning"
- uses: github/codeql-action/upload-sarif@014f16e7ab1402f30e7c3329d33797e7948572db # 3.29.5
+ uses: github/codeql-action/upload-sarif@e12f0178983d466f2f6028f5cc7a6d786fd97f4b # 4.31.4
with:
sarif_file: results.sarif
From 66bafadc42c722ce8e8f99f318408ba5baca13b8 Mon Sep 17 00:00:00 2001
From: Gary Gregory
Date: Fri, 21 Nov 2025 19:46:51 +0000
Subject: [PATCH 071/188] Bump actions/checkout from v5.0.0 to v6.0.0
---
.github/workflows/codeql-analysis.yml | 2 +-
.github/workflows/dependency-review.yml | 2 +-
.github/workflows/maven.yml | 2 +-
.github/workflows/scorecards-analysis.yml | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml
index 60d115d843..db1d51c381 100644
--- a/.github/workflows/codeql-analysis.yml
+++ b/.github/workflows/codeql-analysis.yml
@@ -45,7 +45,7 @@ jobs:
steps:
- name: Checkout repository
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
+ uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
with:
persist-credentials: false
- uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
diff --git a/.github/workflows/dependency-review.yml b/.github/workflows/dependency-review.yml
index 11834ed9d1..b58ce93016 100644
--- a/.github/workflows/dependency-review.yml
+++ b/.github/workflows/dependency-review.yml
@@ -26,6 +26,6 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: 'Checkout Repository'
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
+ uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
- name: 'Dependency Review PR'
uses: actions/dependency-review-action@3c4e3dcb1aa7874d2c16be7d79418e9b7efd6261 # v4.8.2
diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml
index 6724e87101..882c73abbd 100644
--- a/.github/workflows/maven.yml
+++ b/.github/workflows/maven.yml
@@ -34,7 +34,7 @@ jobs:
experimental: true
steps:
- - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
+ - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
with:
persist-credentials: false
- name: Set up JDK ${{ matrix.java }}
diff --git a/.github/workflows/scorecards-analysis.yml b/.github/workflows/scorecards-analysis.yml
index d0348717cf..4270678db1 100644
--- a/.github/workflows/scorecards-analysis.yml
+++ b/.github/workflows/scorecards-analysis.yml
@@ -40,7 +40,7 @@ jobs:
steps:
- name: "Checkout code"
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
+ uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
with:
persist-credentials: false
From 13fe39124867d03110513304edda1312c5c6f0db Mon Sep 17 00:00:00 2001
From: Michael Hausegger
Date: Fri, 21 Nov 2025 23:22:10 +0100
Subject: [PATCH 072/188] Added new test for CharSequenceTranslator#with.
(#725)
* Added new test for CharSequenceTranslator#with.
* Fixed typo
* Reduce whitespace
---------
Co-authored-by: TheRealHaui
Co-authored-by: Gary Gregory
---
src/changes/changes.xml | 2 +-
.../translate/CharSequenceTranslatorTest.java | 53 +++++++++++++++++++
2 files changed, 54 insertions(+), 1 deletion(-)
create mode 100644 src/test/java/org/apache/commons/text/translate/CharSequenceTranslatorTest.java
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index ef5abe56ee..e9c6b331a8 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -49,7 +49,7 @@ The type attribute can be add,update,fix,remove.
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 TextStringBuilderTest.testAppendToCharBuffer() to use proper argument type #724.Add experimental CycloneDX VEX file #683.Add Damerau-Levenshtein distance #687.
diff --git a/src/test/java/org/apache/commons/text/translate/CharSequenceTranslatorTest.java b/src/test/java/org/apache/commons/text/translate/CharSequenceTranslatorTest.java
new file mode 100644
index 0000000000..8bc38cae71
--- /dev/null
+++ b/src/test/java/org/apache/commons/text/translate/CharSequenceTranslatorTest.java
@@ -0,0 +1,53 @@
+/*
+ * 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
+ *
+ * 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,
+ * 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.
+ */
+ package org.apache.commons.text.translate;
+
+import static org.junit.jupiter.api.Assertions.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
+import java.io.IOException;
+import java.io.Writer;
+
+import org.junit.jupiter.api.Test;
+
+
+class CharSequenceTranslatorTest {
+
+ //Used to count translate invocations
+ private int translateInvocationCounter;
+
+ @Test
+ void testWith() throws IOException {
+ CharSequenceTranslator charSequenceTranslatorOne = new TestCharSequenceTranslator();
+ CharSequenceTranslator charSequenceTranslatorTwo = new TestCharSequenceTranslator();
+ CharSequenceTranslator charSequenceTranslatorThree = new TestCharSequenceTranslator();
+ CharSequenceTranslator aggregatedTranslator = charSequenceTranslatorOne.with(charSequenceTranslatorTwo, charSequenceTranslatorThree);
+ aggregatedTranslator.translate("", 0, null);
+ assertTrue(aggregatedTranslator instanceof AggregateTranslator);
+ assertEquals(3, translateInvocationCounter);
+ }
+
+ private final class TestCharSequenceTranslator extends CharSequenceTranslator {
+ @Override
+ public int translate(final CharSequence input, final int index, final Writer writer) {
+ translateInvocationCounter++;
+ return 0;
+ }
+
+ }
+
+}
From 8625878805284992c76ce3a5b0d32fb177f667e3 Mon Sep 17 00:00:00 2001
From: Gary Gregory
Date: Fri, 21 Nov 2025 22:24:39 +0000
Subject: [PATCH 073/188] Sort members
Use final
---
.../translate/CharSequenceTranslatorTest.java | 28 +++++++++----------
1 file changed, 14 insertions(+), 14 deletions(-)
diff --git a/src/test/java/org/apache/commons/text/translate/CharSequenceTranslatorTest.java b/src/test/java/org/apache/commons/text/translate/CharSequenceTranslatorTest.java
index 8bc38cae71..7585f71df1 100644
--- a/src/test/java/org/apache/commons/text/translate/CharSequenceTranslatorTest.java
+++ b/src/test/java/org/apache/commons/text/translate/CharSequenceTranslatorTest.java
@@ -16,8 +16,8 @@
*/
package org.apache.commons.text.translate;
-import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
import java.io.IOException;
import java.io.Writer;
@@ -27,27 +27,27 @@
class CharSequenceTranslatorTest {
+ private final class TestCharSequenceTranslator extends CharSequenceTranslator {
+ @Override
+ public int translate(final CharSequence input, final int index, final Writer writer) {
+ translateInvocationCounter++;
+ return 0;
+ }
+
+ }
+
//Used to count translate invocations
private int translateInvocationCounter;
@Test
void testWith() throws IOException {
- CharSequenceTranslator charSequenceTranslatorOne = new TestCharSequenceTranslator();
- CharSequenceTranslator charSequenceTranslatorTwo = new TestCharSequenceTranslator();
- CharSequenceTranslator charSequenceTranslatorThree = new TestCharSequenceTranslator();
- CharSequenceTranslator aggregatedTranslator = charSequenceTranslatorOne.with(charSequenceTranslatorTwo, charSequenceTranslatorThree);
+ final CharSequenceTranslator charSequenceTranslatorOne = new TestCharSequenceTranslator();
+ final CharSequenceTranslator charSequenceTranslatorTwo = new TestCharSequenceTranslator();
+ final CharSequenceTranslator charSequenceTranslatorThree = new TestCharSequenceTranslator();
+ final CharSequenceTranslator aggregatedTranslator = charSequenceTranslatorOne.with(charSequenceTranslatorTwo, charSequenceTranslatorThree);
aggregatedTranslator.translate("", 0, null);
assertTrue(aggregatedTranslator instanceof AggregateTranslator);
assertEquals(3, translateInvocationCounter);
}
- private final class TestCharSequenceTranslator extends CharSequenceTranslator {
- @Override
- public int translate(final CharSequence input, final int index, final Writer writer) {
- translateInvocationCounter++;
- return 0;
- }
-
- }
-
}
From 2eb7d4c39119b7b6419794d2a0c4488afc8044e2 Mon Sep 17 00:00:00 2001
From: Gary Gregory
Date: Fri, 21 Nov 2025 22:26:29 +0000
Subject: [PATCH 074/188] Add new test for CharSequenceTranslator#with() #725
---
src/changes/changes.xml | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index e9c6b331a8..963c8aa72d 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -54,6 +54,7 @@ The type attribute can be add,update,fix,remove.
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.Bump org.apache.commons:commons-parent from 85 to 92 #704, #723.Bump commons.bytebuddy.version from 1.17.6 to 1.18.1 #696, #722.
From ecff9a0ad3c7a6287532fa3a4293d41dc810a12f Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Sat, 22 Nov 2025 08:53:12 -0500
Subject: [PATCH 075/188] Bump org.apache.commons:commons-parent from 92 to 93
(#726)
Bumps org.apache.commons:commons-parent from 92 to 93.
---
updated-dependencies:
- dependency-name: org.apache.commons:commons-parent
dependency-version: '93'
dependency-type: direct:production
update-type: version-update:semver-major
...
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pom.xml b/pom.xml
index 4b221340f6..b173021fd3 100644
--- a/pom.xml
+++ b/pom.xml
@@ -20,7 +20,7 @@
org.apache.commonscommons-parent
- 92
+ 93commons-text1.15.0-SNAPSHOT
From 05a02e16240d8f4d3f6c623acee41ec916e29440 Mon Sep 17 00:00:00 2001
From: Gary Gregory
Date: Sat, 22 Nov 2025 08:53:43 -0500
Subject: [PATCH 076/188] Bump org.apache.commons:commons-parent from 92 to 93
#726
---
src/changes/changes.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index 963c8aa72d..4a2aaa1c8b 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -56,7 +56,7 @@ The type attribute can be add,update,fix,remove.
Add unit tests to increase coverage #719.Add new test for CharSequenceTranslator#with() #725.
- Bump org.apache.commons:commons-parent from 85 to 92 #704, #723.
+ Bump org.apache.commons:commons-parent from 85 to 93 #704, #723, #726.Bump commons.bytebuddy.version from 1.17.6 to 1.18.1 #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.
From fa7a253aaea60059e418563ee31a3807b8fe5bcd Mon Sep 17 00:00:00 2001
From: Gary Gregory
Date: Sun, 23 Nov 2025 10:01:41 -0500
Subject: [PATCH 077/188] Fix Apache RAT plugin console warnings
---
pom.xml | 16 ++++++++--------
src/changes/changes.xml | 1 +
2 files changed, 9 insertions(+), 8 deletions(-)
diff --git a/pom.xml b/pom.xml
index b173021fd3..5a00fd7778 100644
--- a/pom.xml
+++ b/pom.xml
@@ -139,14 +139,14 @@
org.apache.ratapache-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/lcs-perf-analysis-inputs.csv
+ src/test/resources/org/apache/commons/text/oss-fuzz/**
+
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index 4a2aaa1c8b..b901a067ea 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -50,6 +50,7 @@ The type attribute can be add,update,fix,remove.
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.Add experimental CycloneDX VEX file #683.Add Damerau-Levenshtein distance #687.
From 0c52aa1449895c24088f694f2883fdc3b90e1248 Mon Sep 17 00:00:00 2001
From: Michael Hausegger
Date: Wed, 26 Nov 2025 14:00:14 +0100
Subject: [PATCH 078/188] Added new tests for equals method for
SimilarityCharacterInput class (#727)
Co-authored-by: TheRealHaui
---
.../commons/text/similarity/SimilarityCharacterInputTest.java | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/test/java/org/apache/commons/text/similarity/SimilarityCharacterInputTest.java b/src/test/java/org/apache/commons/text/similarity/SimilarityCharacterInputTest.java
index a8d2ae8400..218fce1916 100644
--- a/src/test/java/org/apache/commons/text/similarity/SimilarityCharacterInputTest.java
+++ b/src/test/java/org/apache/commons/text/similarity/SimilarityCharacterInputTest.java
@@ -42,6 +42,8 @@ void testEquals(final Class> cls) {
assertNotEquals(similarityInput1, similarityInput4);
assertNotEquals(similarityInput2, similarityInput4);
assertNotEquals(similarityInput3, similarityInput4);
+ assertNotEquals(similarityInput1, null);
+ assertNotEquals(similarityInput1, new Object());
}
@ParameterizedTest
From 5f0833414a8a5f498f0e04de47235644f97b0f7a Mon Sep 17 00:00:00 2001
From: Gary Gregory
Date: Wed, 26 Nov 2025 08:01:47 -0500
Subject: [PATCH 079/188] Add test assertions for
SimilarityCharacterInput#equals() class #727
---
src/changes/changes.xml | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index b901a067ea..741b7fc46b 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -56,6 +56,7 @@ The type attribute can be add,update,fix,remove.
Add Damerau-Levenshtein distance #687.Add unit tests to increase coverage #719.Add new test for CharSequenceTranslator#with() #725.
+ Add test assertions for SimilarityCharacterInput#equals() class #727.Bump org.apache.commons:commons-parent from 85 to 93 #704, #723, #726.Bump commons.bytebuddy.version from 1.17.6 to 1.18.1 #696, #722.
From b9fac67ec0cd764924a5dc9181c8bc76fa14c6b5 Mon Sep 17 00:00:00 2001
From: Gary Gregory
Date: Wed, 26 Nov 2025 08:02:22 -0500
Subject: [PATCH 080/188] Add test assertions for
SimilarityCharacterInput#equals() #727
---
src/changes/changes.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index 741b7fc46b..a04993582f 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -56,7 +56,7 @@ The type attribute can be add,update,fix,remove.
Add Damerau-Levenshtein distance #687.Add unit tests to increase coverage #719.Add new test for CharSequenceTranslator#with() #725.
- Add test assertions for SimilarityCharacterInput#equals() class #727.
+ Add test assertions for SimilarityCharacterInput#equals() #727.Bump org.apache.commons:commons-parent from 85 to 93 #704, #723, #726.Bump commons.bytebuddy.version from 1.17.6 to 1.18.1 #696, #722.
From 1c87739cbbc866c7ed0eb7fd110688070e3adcca Mon Sep 17 00:00:00 2001
From: Gary Gregory
Date: Wed, 26 Nov 2025 13:06:18 +0000
Subject: [PATCH 081/188] Fix site XML to use version 2.0.0 XML schema
---
src/changes/changes.xml | 3 ++-
src/site/site.xml | 16 ++++++++--------
2 files changed, 10 insertions(+), 9 deletions(-)
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index a04993582f..c6de2b3687 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -51,12 +51,13 @@ The type attribute can be add,update,fix,remove.
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.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 test assertions for SimilarityCharacterInput#equals() #727.
+ Add test assertions for SimilarityCharacterInput#equals() #727.Bump org.apache.commons:commons-parent from 85 to 93 #704, #723, #726.Bump commons.bytebuddy.version from 1.17.6 to 1.18.1 #696, #722.
diff --git a/src/site/site.xml b/src/site/site.xml
index cf3fee8aaf..484a229cc1 100644
--- a/src/site/site.xml
+++ b/src/site/site.xml
@@ -15,13 +15,13 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-
-
- Commons Text
- /images/logo.png
- /index.html
-
-
+
+
+
+
+
From 3f5295bfa4032058a838290d1c888096da2204bd Mon Sep 17 00:00:00 2001
From: Gary Gregory
Date: Wed, 26 Nov 2025 13:09:26 +0000
Subject: [PATCH 082/188] Use new oak leaf logo
---
src/media/commons-logo-component-100.xcf | Bin 0 -> 25475 bytes
src/media/commons-logo-component.xcf | Bin 0 -> 150711 bytes
src/media/logo.png | Bin 0 -> 9454 bytes
src/media/logo.xcf | Bin 17288 -> 0 bytes
src/site/resources/images/logo.png | Bin 10143 -> 9454 bytes
5 files changed, 0 insertions(+), 0 deletions(-)
create mode 100644 src/media/commons-logo-component-100.xcf
create mode 100644 src/media/commons-logo-component.xcf
create mode 100644 src/media/logo.png
delete mode 100644 src/media/logo.xcf
diff --git a/src/media/commons-logo-component-100.xcf b/src/media/commons-logo-component-100.xcf
new file mode 100644
index 0000000000000000000000000000000000000000..daba87fdaf87936496a613d983e7a1a63c9817a3
GIT binary patch
literal 25475
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