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

REGRESSION: Assignment of final variable during static initialization crashes

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3
    • Resolution: Duplicate
    • Affects Version/s: 1.4.1
    • Fix Version/s: None
    • Component/s: tools
    • Labels:
    • Subcomponent:
    • CPU:
      x86
    • OS:
      windows_2000

      Description



      Name: rmT116609 Date: 06/27/2002


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

      FULL OPERATING SYSTEM VERSION :
      Microsoft Windows 2000 [Version 5.00.2195]

      DESCRIPTION OF THE PROBLEM :

      Assignment of final variable during static initialization crashes

      Source code:
      ------------

      public final class bug {
          static {
                     object = new Object();
          }

          private static final Object object;
      }



      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      1)javac bug.java


      ERROR MESSAGES/STACK TRACES THAT OCCUR :
      An exception has occurred in the compiler (1.4.1-beta). Please file a bug at the Java Developer Connection (http://java.sun.com/cgi-bin/bugreport.cgi) after checking the Bug Parade for duplicates. Include your program and the following diagnostic in your report. Thank you.
      java.lang.AssertionError
              at com.sun.tools.javac.v8.util.Bits.incl(Bits.java:73)
              at com.sun.tools.javac.v8.comp.Flow.letInit(Flow.java:181)
              at com.sun.tools.javac.v8.comp.Flow.letInit(Flow.java:199)
              at com.sun.tools.javac.v8.comp.Flow.visitAssign(Flow.java:930)
              at com.sun.tools.javac.v8.tree.Tree$Assign.accept(Tree.java:959)
              at com.sun.tools.javac.v8.comp.Flow.analyze(Flow.java:409)
              at com.sun.tools.javac.v8.comp.Flow.analyzeExpr(Flow.java:428)
              at com.sun.tools.javac.v8.comp.Flow.visitExec(Flow.java:864)
              at com.sun.tools.javac.v8.tree.Tree$Exec.accept(Tree.java:776)
              at com.sun.tools.javac.v8.comp.Flow.analyze(Flow.java:409)
              at com.sun.tools.javac.v8.comp.Flow.analyzeStat(Flow.java:483)
              at com.sun.tools.javac.v8.comp.Flow.analyzeStats(Flow.java:502)
              at com.sun.tools.javac.v8.comp.Flow.visitBlock(Flow.java:632)
              at com.sun.tools.javac.v8.tree.Tree$Block.accept(Tree.java:550)
              at com.sun.tools.javac.v8.comp.Flow.analyze(Flow.java:409)
              at com.sun.tools.javac.v8.comp.Flow.analyzeDef(Flow.java:468)
              at com.sun.tools.javac.v8.comp.Flow.visitClassDef(Flow.java:526)
              at com.sun.tools.javac.v8.tree.Tree$ClassDef.accept(Tree.java:446)
              at com.sun.tools.javac.v8.comp.Flow.analyze(Flow.java:409)
              at com.sun.tools.javac.v8.comp.Flow.analyzeDef(Flow.java:468)
              at com.sun.tools.javac.v8.comp.Flow.analyzeTree(Flow.java:1041)
              at com.sun.tools.javac.v8.JavaCompiler.compile(JavaCompiler.java:367)
              at com.sun.tools.javac.v8.Main.compile(Main.java:523)
              at com.sun.tools.javac.Main.compile(Main.java:39)
              at com.sun.tools.javac.Main.main(Main.java:30)

      REPRODUCIBILITY :
      This bug can be reproduced always.

      With JDK1.4.0, 1.4.0_01:
      ------------------------

      C:\>javac bug.java
      bug.java:3: illegal forward reference
                     object = new Object();
                     ^
      1 error


      Release Regression From : 1.4.0_01
      The above release value was the last known release where this
      bug was known to work. Since then there has been a regression.

      (Review ID: 158548)
      ======================================================================

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              gafter Neal Gafter
              Reporter:
              rmandalasunw Ranjith Mandala (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: