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

Based anonymous classes have a weird end position

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • P4
    • Resolution: Fixed
    • 16
    • 16
    • tools
    • None
    • 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

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

              Dates

                Created:
                Updated:
                Resolved: