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

IllegalStateException from Trees.getScope when called from JSR 199

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 7
    • Fix Version/s: 8
    • Component/s: tools
    • Labels:
      None
    • Subcomponent:
    • Resolved In Build:
      b08
    • CPU:
      generic
    • OS:
      generic
    • Verification:
      Verified

      Description

      If you invoke javac via CompilationTask.call, and invoke an annotation processor that calls Trees.getScope, javac will crash with IllegalStateException.

      at com.sun.tools.javac.api.JavacTaskImpl.prepareCompiler(JavacTaskImpl.java:157)
      at com.sun.tools.javac.api.JavacTaskImpl.enter(JavacTaskImpl.java:266)
      at com.sun.tools.javac.api.JavacTrees.getAttrContext(JavacTrees.java:271)
      at com.sun.tools.javac.api.JavacTrees.getScope(JavacTrees.java:230)
      at com.sun.tools.javac.api.JavacTrees.getScope(JavacTrees.java:84)
      at TestGetScope$Scanner.visitIdentifier(TestGetScope.java:97)
      at TestGetScope$Scanner.visitIdentifier(TestGetScope.java:93)
      at com.sun.tools.javac.tree.JCTree$JCIdent.accept(JCTree.java:1711)
      at com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:67)
      at com.sun.source.util.TreeScanner.visitAnnotation(TreeScanner.java:376)
      at com.sun.tools.javac.tree.JCTree$JCAnnotation.accept(JCTree.java:2013)
      at com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:67)
      at com.sun.source.util.TreeScanner.scan(TreeScanner.java:90)
      at com.sun.source.util.TreeScanner.visitModifiers(TreeScanner.java:372)
      at com.sun.tools.javac.tree.JCTree$JCModifiers.accept(JCTree.java:2040)
      at com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:67)
      at com.sun.source.util.TreeScanner.visitClass(TreeScanner.java:128)
      at com.sun.tools.javac.tree.JCTree$JCClassDecl.accept(JCTree.java:618)
      at com.sun.source.util.TreePathScanner.scan(TreePathScanner.java:49)
      at TestGetScope.process(TestGetScope.java:80)
      at com.sun.tools.javac.processing.JavacProcessingEnvironment.callProcessor(JavacProcessingEnvironment.java:752)
      at com.sun.tools.javac.processing.JavacProcessingEnvironment.discoverAndRunProcs(JavacProcessingEnvironment.java:681)
      at com.sun.tools.javac.processing.JavacProcessingEnvironment.access$1700(JavacProcessingEnvironment.java:97)
      at com.sun.tools.javac.processing.JavacProcessingEnvironment$Round.run(JavacProcessingEnvironment.java:988)
      at com.sun.tools.javac.processing.JavacProcessingEnvironment.doProcessing(JavacProcessingEnvironment.java:1122)
      at com.sun.tools.javac.main.JavaCompiler.processAnnotations(JavaCompiler.java:1106)
      at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:824)
      at com.sun.tools.javac.main.Main.compile(Main.java:417)
      ... 9 more

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                jjg Jonathan Gibbons
                Reporter:
                jjg Jonathan Gibbons
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: