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

Calling Trees.getScope early changes names of local/anonymous classes

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 14
    • 8, 11, 13
    • tools
    • None
    • b05

      When Trees.getScope is called before the AST is attributed, the resulting binary names of local/anonymous classes from the compilation may be different from the name from compilation without the Trees.getScope invocation. This may cause issues to some tools, like debuggers.

      To reproduce:
      -download the attached GetScopeProcessor.java Test.java
      -invoke:
      $ rm *.class && javac Test.java
      This should produce: 'Test$1.class' Test.class
      -and then invoke:
      $ rm *.class && javac GetScopeProcessor.java && javac -classpath . -processor GetScopeProcessor Test.java
      This will produce (among others): 'Test$2.class' Test.class

            jlahoda Jan Lahoda
            jlahoda Jan Lahoda
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: