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

Integer seems to be greater than Integer.MAX_VALUE

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 1.4.2, 5.0
    • hotspot
    • generic, x86, itanium
    • generic, linux, windows_2000, windows_xp

      FULL PRODUCT VERSION :
      java version "1.4.2"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2-b28)
      Java HotSpot(TM) Client VM (build 1.4.2-b28, mixed mode)

      FULL OS VERSION :
      Windows XP

      A DESCRIPTION OF THE PROBLEM :
      The following code normally wouldn't enter the if-condition with the System.out.println-statement. But after some loops (14668Loops on my PC)
      it does !

      It occures only with option -server . With -client everything seems to be ok.

      THE PROBLEM WAS REPRODUCIBLE WITH -Xint FLAG: No

      THE PROBLEM WAS REPRODUCIBLE WITH -server FLAG: Yes

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      please run the source above.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      No output is expected. But the code produces output.
      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      public class HotSpotError {
          static public void main(String[] args) {
              int i1 = 0;
              int i2 = Integer.MAX_VALUE;

              while (i1 >= 0) {
                  i1++;
                  if (i1 > i2) {
                      System.out.println("E R R O R: " + i1);
                      return;
                  }
              }
          }
      }
      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      use VM-option -client
      ###@###.### 2004-11-16 19:26:21 GMT

            cfang Changpeng Fang (Inactive)
            tbell Tim Bell
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: