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
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