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

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

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 8, 11, 13
    • Fix Version/s: 14
    • Component/s: tools
    • Labels:
      None
    • Subcomponent:
    • Resolved In Build:
      b05

      Description

      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

        Attachments

          Activity

            People

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

              Dates

              Created:
              Updated:
              Resolved: