code: public Number parse(String text) throws ParseException {
          ParsePosition parsePosition = new ParsePosition(0);
          Number result = parse(text, parsePosition);
          if (parsePosition.getIndex() == 0) {
              throw new ParseException("Unparseable number: \"" + text + '"',
                                       parsePosition.getErrorIndex());
          }
          return result;
      }
docs: Bug 4375399 [Richard/GCL]