mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 14:54:52 +02:00
8212694: Using Raw String Literals with align() and Integer.MIN_VALUE causes out of memory error
Reviewed-by: smarks, sherman
This commit is contained in:
parent
6a045adbed
commit
7a9db013b7
2 changed files with 16 additions and 1 deletions
|
@ -2967,7 +2967,9 @@ public final class String
|
|||
.mapToInt(String::indexOfNonWhitespace)
|
||||
.min()
|
||||
.orElse(0);
|
||||
return indent(n - outdent, true);
|
||||
// overflow-conscious code
|
||||
int indent = n - outdent;
|
||||
return indent(indent > n ? Integer.MIN_VALUE : indent, true);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue