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

Multicatch: crash while compiling simple code with a multicatch parameter

XMLWordPrintable

    • b120
    • unknown
    • generic
    • Not verified

      The following code crashes javac:

      class Crash {

      interface Foo {}
      static class X1 extends Exception implements Foo {}
      static class X2 extends Exception implements Foo {}

      public static void main(String[] args) {
      try {
      if (args.length == 0)
      throw new X1();
      else
      throw new X2();
      }
      catch (X1|X2 ex) {
      }
      }
      }

      Stack:

      An exception has occurred in the compiler (1.7.0-internal). Please file a bug at the Java Developer Connection (http://java.sun.com/webapps/bugreport) 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.jvm.ClassWriter.enterInner(ClassWriter.java:996)
      at com.sun.tools.javac.jvm.ClassWriter.writePool(ClassWriter.java:533)
      at com.sun.tools.javac.jvm.ClassWriter.writeClassFile(ClassWriter.java:1698)
      at com.sun.tools.javac.jvm.ClassWriter.writeClass(ClassWriter.java:1579)
      at com.sun.tools.javac.main.JavaCompiler.genCode(JavaCompiler.java:685)
      at com.sun.tools.javac.main.JavaCompiler.generate(JavaCompiler.java:1413)
      at com.sun.tools.javac.main.JavaCompiler.generate(JavaCompiler.java:1381)
      at com.sun.tools.javac.main.JavaCompiler.compile2(JavaCompiler.java:836)
      at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:795)
      at com.sun.tools.javac.main.Main.compile(Main.java:418)
      at com.sun.tools.javac.main.Main.compile(Main.java:336)
      at com.sun.tools.javac.main.Main.compile(Main.java:327)
      at com.sun.tools.javac.Main.compile(Main.java:82)
      at com.sun.tools.javac.Main.main(Main.java:67)

            mcimadamore Maurizio Cimadamore
            mcimadamore Maurizio Cimadamore
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: