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

Interger.parseInt does not accept hexadecimal ffffffff

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 6u2
    • core-libs
    • x86
    • windows_vista

      java version "1.6.0_02"
       Java(TM) SE Runtime Environment (build
      1.6.0_02-b05)
      Java HotSpot(TM) Client VM (build 1.6.0_02-b05, mixed mode)

      Does this problem occur on J2SE 1.4.x or 5.0.x ? Yes / No (pick one)
        Not known

      Operating System Configuration Information (be specific):

        Windows Vista

      Hardware Configuration Information (be specific):
      AMD Athlon X2-64 2Gb RAM


      Bug Description:
      Integer.parseInt does not accept hexadecimal ffffffff.


      Steps to Reproduce (be specific):


      Compile and run this program:

      public class ParseIntErr {
          public static void main(String[] args){
              int n = Integer.parseInt(args[0],16);
          }
      }

      E:\alcatel\borsotti\jtest>java ParseIntErr ffffffff

      Exception in thread "main" java.lang.NumberFormatException: For input string: "ffffffff"
              at java.lang.NumberFormatException.forInputString(Unknown Source)
              at java.lang.Integer.parseInt
      (Unknown Source)
              at ParseIntErr.main(ParseIntErr.java:3)

      It is wierd that ParseInt cannot accept an integer that can be specified
      in a java source program.

            darcy Joe Darcy
            tyao Ting-Yun Ingrid Yao (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: