Skip to content

Commit

Permalink
Fix parsing of Long.MIN_VALUE
Browse files Browse the repository at this point in the history
Resolves: #8365
  • Loading branch information
luigidellaquila committed Jul 2, 2018
1 parent 8d900e0 commit 6ded5b4
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public void setValue(int sign, String stringValue) {
if (stringValue.endsWith("L") || stringValue.endsWith("l")) {
value = Long.parseLong(stringValue.substring(0, stringValue.length() - 1), radix) * sign;
} else {
long longValue = Long.parseLong(stringValue, radix) * sign;
long longValue = Long.parseLong(sign > 0 ? stringValue : "-" + stringValue, radix);
if (longValue > Integer.MAX_VALUE || longValue < Integer.MIN_VALUE) {
value = longValue;
} else {
Expand Down

0 comments on commit 6ded5b4

Please sign in to comment.