XMLWordPrintable

      A fellow Checker Framework developer recently discovered an issue
      (https://code.google.com/p/checker-framework/issues/detail?id=344)
      that can be reproduced with trunk jdk9:

      ===
      import java.lang.annotation.*;

      class TestIssue344 {
          public void foo() {
              try {
                  return;
              } catch (@TA Exception e) {
              }
          }
      }

      @Target(ElementType.TYPE_USE)
      @interface TA {}
      ====

      Compiling this file results in:

      An exception has occurred in the compiler (1.9.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: Could not find exception index for type
      annotation @TA on exception parameter
      at com.sun.tools.javac.util.Assert.error(Assert.java:132)
      at com.sun.tools.javac.jvm.Code.fillExceptionParameterPositions(Code.java:2157)
      at com.sun.tools.javac.jvm.Gen.genMethod(Gen.java:964)
      at com.sun.tools.javac.jvm.Gen.visitMethodDef(Gen.java:872)
      at com.sun.tools.javac.tree.JCTree$JCMethodDecl.accept(JCTree.java:814)
      at com.sun.tools.javac.jvm.Gen.genDef(Gen.java:615)
      at com.sun.tools.javac.jvm.Gen.genClass(Gen.java:2385)
      at com.sun.tools.javac.main.JavaCompiler.genCode(JavaCompiler.java:741)
      at com.sun.tools.javac.main.JavaCompiler.generate(JavaCompiler.java:1578)
      at com.sun.tools.javac.main.JavaCompiler.generate(JavaCompiler.java:1542)
      at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:897)
      at com.sun.tools.javac.main.Main.compile(Main.java:536)
      at com.sun.tools.javac.main.Main.compile(Main.java:383)
      at com.sun.tools.javac.main.Main.compile(Main.java:372)
      at com.sun.tools.javac.main.Main.compile(Main.java:363)
      at com.sun.tools.javac.Main.compile(Main.java:56)
      at com.sun.tools.javac.Main.main(Main.java:42)

      This issue does not occur in the jdk8 version.

            Unassigned Unassigned
            wmdietl Werner Dietl
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: