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

javac of Kestrel-F fails to compile switch with the only default branch

    Details

    • Subcomponent:
    • CPU:
      sparc
    • OS:
      solaris_2.5.1

      Description



      Name: avC70361 Date: 06/01/99



        The java compiler of jdk1.3(build JDK1.3-F) fails to compile a switch statement with the only default
      branch followed by break operator. The compiler throws unexpected NullPointerException.

      Here is a test demonstrating the bug.
      ----------SwitchTest.java---------------
      public class SwitchTest {
          public SwitchTest() {
              switch(0) {
                  default : break;
              }
          }
      }
      --------The test compilation output---------
      > java -version
      java version "1.3"
      Classic VM (build JDK-1.3-F, green threads, sunwjit)
      > javac SwitchTest.java


      An exception has occurred in the compiler. (v0.8)
      Please file a bug report by sending your program and the following diagnostic to
      ###@###.###.

         Thank you.

      java.lang.NullPointerException
              at com.sun.tools.javac.v8.comp.Gen._case(Gen.java, Compiled Code)
              at com.sun.tools.javac.v8.tree.Tree$Break.visit(Tree.java, Compiled Code)
              at com.sun.tools.javac.v8.comp.Gen.genDef(Gen.java, Compiled Code)
              at com.sun.tools.javac.v8.comp.Gen.genStat(Gen.java, Compiled Code)
              at com.sun.tools.javac.v8.comp.Gen.genStats(Gen.java, Compiled Code)
              at com.sun.tools.javac.v8.comp.Gen._case(Gen.java, Compiled Code)
              at com.sun.tools.javac.v8.tree.Tree$Switch.visit(Tree.java, Compiled Code)
              at com.sun.tools.javac.v8.comp.Gen.genDef(Gen.java, Compiled Code)
              at com.sun.tools.javac.v8.comp.Gen.genStat(Gen.java, Compiled Code)
              at com.sun.tools.javac.v8.comp.Gen.genStats(Gen.java, Compiled Code)
              at com.sun.tools.javac.v8.comp.Gen._case(Gen.java, Compiled Code)
              at com.sun.tools.javac.v8.tree.Tree$Block.visit(Tree.java, Compiled Code)
              at com.sun.tools.javac.v8.comp.Gen.genDef(Gen.java, Compiled Code)
              at com.sun.tools.javac.v8.comp.Gen.genStat(Gen.java, Compiled Code)
              at com.sun.tools.javac.v8.comp.Gen.genMethod(Gen.java, Compiled Code)
              at com.sun.tools.javac.v8.comp.Gen._case(Gen.java, Compiled Code)
              at com.sun.tools.javac.v8.tree.Tree$MethodDef.visit(Tree.java, Compiled Code)
              at com.sun.tools.javac.v8.comp.Gen.genDef(Gen.java, Compiled Code)
              at com.sun.tools.javac.v8.comp.Gen.genClass(Gen.java, Compiled Code)
              at com.sun.tools.javac.v8.JavaCompiler.genCode(JavaCompiler.java, Compiled Code)
              at com.sun.tools.javac.v8.JavaCompiler.compile(JavaCompiler.java, Compiled Code)
              at com.sun.tools.javac.v8.Main.compile(Main.java, Compiled Code)
              at com.sun.tools.javac.Main.main(Main.java, Compiled Code)

      ======================================================================

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                iris Iris Clark
                Reporter:
                duke J. Duke (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: