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

Based anonymous classes have a weird end position

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 16
    • Fix Version/s: 16
    • Component/s: tools
    • Labels:
      None
    • Subcomponent:
    • Resolved In Build:
      b28

      Description

      Consider code like:
      ---
      class Test {
          class I {}
          static Object I = new Test().new I() {};
      }
      ---

      The 'new Test().new I() {}' snippet is represented by NewClassTree, which contains a ClassTree for the actual anonymous class. That nested ClassTree has a synthesized extends clause, which is "Test.I". But, this synthesized clause has a wrong end position - it is the end position of the anonymous class (it is not completely clear what are the best positions for the synthesized tree, but the end of the whole anonymous class seems definitely incorrect, and is inconsistent with the value for non-based anonymous classes).

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                Created:
                Updated:
                Resolved: