Skip to content

Commit 7bcb03a

Browse files
committed
Fix StringIndexOutOfBoundsException message in StrBuilder.append(char[],
int, int)
1 parent c477140 commit 7bcb03a

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/changes/changes.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ The <action> type attribute can be add,update,fix,remove.
111111
<action issue="LANG-1452" type="fix" dev="ggregory" due-to="Gary Gregory, Aleksey Novozhilov, Sara">RecursiveToStringStyle and MultilineRecursiveToStringStyle shouldn't recurse into a java.math.BigDecimal #1584.</action>
112112
<action issue="LANG-1814" type="fix" dev="ggregory" due-to="Ivan Ponomarev">ArrayUtils.subarray(..) may overflow index arithmetic and violate contract for extreme index values.</action>
113113
<action issue="LANG-1816" type="fix" dev="ggregory" due-to="Ivan Ponomarev, Gary Gregory">ArrayUtils contains/indexOf/indexesOf with tolerance fail to match NaN values #1589.</action>
114+
<action type="fix" dev="ggregory" due-to="Ivan Ponomarev, Gary Gregory">Fix StringIndexOutOfBoundsException message in StrBuilder.append(char[], int, int).</action>
114115
<!-- ADD -->
115116
<action type="add" dev="ggregory" due-to="Gary Gregory">Add JavaVersion.JAVA_27.</action>
116117
<action type="add" dev="ggregory" due-to="Gary Gregory">Add SystemUtils.IS_JAVA_27.</action>

src/main/java/org/apache/commons/lang3/text/StrBuilder.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@ public StrBuilder append(final char[] chars, final int startIndex, final int len
394394
return appendNull();
395395
}
396396
if (startIndex < 0 || startIndex > chars.length) {
397-
throw new StringIndexOutOfBoundsException("Invalid startIndex: " + length);
397+
throw new StringIndexOutOfBoundsException("Invalid startIndex: " + startIndex);
398398
}
399399
if (length < 0 || startIndex + length > chars.length) {
400400
throw new StringIndexOutOfBoundsException("Invalid length: " + length);

0 commit comments

Comments
 (0)