src/java.base/share/classes/java/lang/Long.java
changeset 51412 8f7e3f9ddbc0
parent 50211 5afedc9e4662
child 51509 758b3f3f3a8d
--- a/src/java.base/share/classes/java/lang/Long.java	Wed Aug 15 10:00:16 2018 -0700
+++ b/src/java.base/share/classes/java/lang/Long.java	Wed Aug 15 10:16:15 2018 -0700
@@ -675,11 +675,11 @@
                     negative = true;
                     limit = Long.MIN_VALUE;
                 } else if (firstChar != '+') {
-                    throw NumberFormatException.forInputString(s);
+                    throw NumberFormatException.forInputString(s, radix);
                 }
 
                 if (len == 1) { // Cannot have lone "+" or "-"
-                    throw NumberFormatException.forInputString(s);
+                    throw NumberFormatException.forInputString(s, radix);
                 }
                 i++;
             }
@@ -689,17 +689,17 @@
                 // Accumulating negatively avoids surprises near MAX_VALUE
                 int digit = Character.digit(s.charAt(i++),radix);
                 if (digit < 0 || result < multmin) {
-                    throw NumberFormatException.forInputString(s);
+                    throw NumberFormatException.forInputString(s, radix);
                 }
                 result *= radix;
                 if (result < limit + digit) {
-                    throw NumberFormatException.forInputString(s);
+                    throw NumberFormatException.forInputString(s, radix);
                 }
                 result -= digit;
             }
             return negative ? result : -result;
         } else {
-            throw NumberFormatException.forInputString(s);
+            throw NumberFormatException.forInputString(s, radix);
         }
     }
 
@@ -945,7 +945,7 @@
                 return result;
             }
         } else {
-            throw NumberFormatException.forInputString(s);
+            throw NumberFormatException.forInputString(s, radix);
         }
     }
 
@@ -1063,7 +1063,7 @@
                 return result;
             }
         } else {
-            throw NumberFormatException.forInputString("");
+            throw NumberFormatException.forInputString("", radix);
         }
     }