Better exception messages.
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/lang/trunk@231331 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
1c57bb797d
commit
030267a91b
|
@ -556,10 +556,10 @@ public class StrBuilder implements Cloneable {
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
if (startIndex < 0 || startIndex > chars.length) {
|
if (startIndex < 0 || startIndex > chars.length) {
|
||||||
throw new StringIndexOutOfBoundsException("startIndex must be valid");
|
throw new StringIndexOutOfBoundsException("Invalid startIndex: " + length);
|
||||||
}
|
}
|
||||||
if (length < 0 || (startIndex + length) > chars.length) {
|
if (length < 0 || (startIndex + length) > chars.length) {
|
||||||
throw new StringIndexOutOfBoundsException("length must be valid");
|
throw new StringIndexOutOfBoundsException("Invalid length: " + length);
|
||||||
}
|
}
|
||||||
if (length > 0) {
|
if (length > 0) {
|
||||||
int len = length();
|
int len = length();
|
||||||
|
|
Loading…
Reference in New Issue