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

(javac) Starting positions of ClassTree for enum constants

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P5 P5
    • tbd
    • 7
    • tools
    • generic
    • generic

      Consider the following code:
      enum Test {
          A {};
      }

      The "A {}" is modeled as a field whose initializer is a NewClassTree, containing a ClassTree as its ClassBody. Currently, the NewClassTree's starting position is:
          A {};
            ^
      but the embedded ClassTree's position is:
          A {};
          ^

      Which confuses the NetBeans code generator, as the inner tree is outside the bounds of the outer tree. I propose this position is changed to:
          A {};
            ^

      Similarly for enum constants with parameters, the NewClassTree's position would be kept as
          A (1) {};
            ^
      and the ClassTree's position would be:
          A (1) {};
                ^

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

              Created:
              Updated:
              Imported:
              Indexed: