8219876: (bf) Improve IndexOutOfBoundsException messages in $Type$Buffer classes

Reviewed-by: alanb, rriggs
This commit is contained in:
Brian Burkhalter 2019-03-15 16:24:07 -07:00
parent 5c5089b0a2
commit 7211761cab
6 changed files with 14 additions and 27 deletions

View file

@ -37,8 +37,7 @@ class StringCharBuffer // package-private
StringCharBuffer(CharSequence s, int start, int end) { // package-private
super(-1, start, end, s.length());
int n = s.length();
if ((start < 0) || (start > n) || (end < start) || (end > n))
throw new IndexOutOfBoundsException();
Objects.checkFromToIndex(start, end, n);
str = s;
this.isReadOnly = true;
}