mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 07:14:30 +02:00
8228585: jdk/internal/platform/cgroup/TestCgroupMetrics.java - NumberFormatException because of large long values (memory limit_in_bytes)
Reviewed-by: dholmes, sgehwolf
This commit is contained in:
parent
ff6b5404eb
commit
da6f042616
2 changed files with 22 additions and 3 deletions
|
@ -132,7 +132,7 @@ public class SubSystem {
|
|||
retval = Long.parseLong(strval);
|
||||
} catch (NumberFormatException e) {
|
||||
// For some properties (e.g. memory.limit_in_bytes) we may overflow the range of signed long.
|
||||
// In this case, return Long.max
|
||||
// In this case, return Long.MAX_VALUE
|
||||
BigInteger b = new BigInteger(strval);
|
||||
if (b.compareTo(BigInteger.valueOf(Long.MAX_VALUE)) > 0) {
|
||||
return Long.MAX_VALUE;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue