digit = Character.digit(s.charAt(i++),radix); if (digit < 0) { throw NumberFormatException.forInputString(s); } else { result = -digit; throw NumberFormatException.forInputString(s); throw NumberFormatException.forInputString(s); throw NumberFormatException.forInputString(s); throw NumberFormatException.forInputString(s); return result; } else { /* Only got "-" */ throw NumberFormatException.forInputString(s);
if (result < multmin) { throw NumberFormatException.forInputString(s); }
String input = "123hello"; double d = parseDouble(input); // Runtime Error public double parseDouble(String input, DecimalFormat format) throws NumberFormatException { if (input.equals("-") || input.equals("-.")) throw NumberFormatException.forInputString(input); if (!input.matches("\\-?[0-9]*(\\.[0-9]*)?")) throw NumberFormatException.forInputString(input); // From here, we are sure it is numeric. return format.parse(intput, new ParsePosition(0)); }
arg5 = MIN_VALUE; } else if (arg8 != 43) { throw NumberFormatException.forInputString(arg); throw NumberFormatException.forInputString(arg); arg7 = Character.digit(arg.charAt(arg3++), arg0); if (arg7 < 0) { throw NumberFormatException.forInputString(arg); throw NumberFormatException.forInputString(arg); throw NumberFormatException.forInputString(arg); throw NumberFormatException.forInputString(arg);
limit = Integer.MIN_VALUE; } else if (firstChar != '+') throw NumberFormatException.forInputString(s); throw NumberFormatException.forInputString(s); i++; throw NumberFormatException.forInputString(s); throw NumberFormatException.forInputString(s); throw NumberFormatException.forInputString(s); throw NumberFormatException.forInputString(s);
limit = Integer.MIN_VALUE; } else if (firstChar != '+') throw NumberFormatException.forInputString(s); throw NumberFormatException.forInputString(s); i++; throw NumberFormatException.forInputString(s); throw NumberFormatException.forInputString(s); throw NumberFormatException.forInputString(s); throw NumberFormatException.forInputString(s);
limit = Integer.MIN_VALUE; } else if (firstChar != '+') throw NumberFormatException.forInputString(s); throw NumberFormatException.forInputString(s); i++; throw NumberFormatException.forInputString(s); throw NumberFormatException.forInputString(s); throw NumberFormatException.forInputString(s); throw NumberFormatException.forInputString(s);
limit = Long.MIN_VALUE; } else if (firstChar != '+') throw NumberFormatException.forInputString(s); throw NumberFormatException.forInputString(s); i++; throw NumberFormatException.forInputString(s); throw NumberFormatException.forInputString(s); throw NumberFormatException.forInputString(s); throw NumberFormatException.forInputString(s);
digit = Character.digit(s.charAt(i++),radix); if (digit < 0) { throw NumberFormatException.forInputString(s); } else { result = -digit; throw NumberFormatException.forInputString(s); throw NumberFormatException.forInputString(s); throw NumberFormatException.forInputString(s); throw NumberFormatException.forInputString(s); return result; } else { /* Only got "-" */ throw NumberFormatException.forInputString(s);
limit = Long.MIN_VALUE; } else if (firstChar != '+') throw NumberFormatException.forInputString(s); throw NumberFormatException.forInputString(s); i++; throw NumberFormatException.forInputString(s); throw NumberFormatException.forInputString(s); throw NumberFormatException.forInputString(s); throw NumberFormatException.forInputString(s);