equal
deleted
inserted
replaced
130 |
130 |
131 try { |
131 try { |
132 retval = Long.parseLong(strval); |
132 retval = Long.parseLong(strval); |
133 } catch (NumberFormatException e) { |
133 } catch (NumberFormatException e) { |
134 // For some properties (e.g. memory.limit_in_bytes) we may overflow the range of signed long. |
134 // For some properties (e.g. memory.limit_in_bytes) we may overflow the range of signed long. |
135 // In this case, return Long.max |
135 // In this case, return Long.MAX_VALUE |
136 BigInteger b = new BigInteger(strval); |
136 BigInteger b = new BigInteger(strval); |
137 if (b.compareTo(BigInteger.valueOf(Long.MAX_VALUE)) > 0) { |
137 if (b.compareTo(BigInteger.valueOf(Long.MAX_VALUE)) > 0) { |
138 return Long.MAX_VALUE; |
138 return Long.MAX_VALUE; |
139 } |
139 } |
140 } |
140 } |