8230744: Several classes throw OutOfMemoryError without message

Reviewed-by: psandoz, martin, bchristi, rriggs, smarks
This commit is contained in:
Jim Laskey 2020-06-11 10:08:23 -03:00
parent 2085fd32ff
commit 03642a01af
9 changed files with 27 additions and 53 deletions

View file

@ -661,7 +661,7 @@ final class StringUTF16 {
resultLen = Math.addExact(valLen,
Math.multiplyExact(++p, replLen - targLen));
} catch (ArithmeticException ignored) {
throw new OutOfMemoryError();
throw new OutOfMemoryError("Required length exceeds implementation limit");
}
if (resultLen == 0) {
return "";