Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-1232934

Integer.parseInteger incorrectly accepts "-"

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P3 P3
    • None
    • 1.0
    • hotspot
    • None
    • sparc
    • solaris_1

      The call Integer.parseInt("-", 10) incorrectly returns 0.
      It should throw a NumberFormatException.

      There is a similar problem with Long.parseLong("-", 10).

            fyellinsunw Frank Yellin (Inactive)
            duke J. Duke
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: