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

Integer.parseInt(String) should not accept just '+'

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 7
    • 6
    • core-libs
    • b17
    • x86
    • linux
    • Not verified

      A DESCRIPTION OF THE REQUEST :
      When calling Integer.parseInt(String) with the string "+", a FormatNumberException is not thrown.

      JUSTIFICATION :
      Just as Integer.parseInt(String) throws a FormatNumberException if string is just "-", shouldn't the same behaviour be expected if string is just "+".

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      I think that a FormatNumberException should be thrown if the string is just "+".


      ACTUAL -
      No FormatNumberException is thrown if the string is just "+".

            darcy Joe Darcy
            ndcosta Nelson Dcosta (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: