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

incorrect position given for duplicate annotation value error

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 7
    • 7
    • tools
    • b84
    • generic
    • generic
    • Verified

      The upcoming fix for errors in the positions for tree nodes has uncovered a latent error in the position used to report a duplicate annotation value.

      For example, look at test/tools/javac/typeAnnotations/failures/common/arrayclass/DuplicateAnnotationValue.java

      The standard (non-raw) output is
      test/tools/javac/typeAnnotations/failures/common/arrayclass/DuplicateAnnotationValue.java:10: duplicate annotation member value value in A
          Object a = String @A(value = 2, value = 1) [].class;
                                                  ^
      1 error


      (caret under the "1")


      With the fixes to 6654037/6919889, the output changes to

      test/tools/javac/typeAnnotations/failures/common/arrayclass/DuplicateAnnotationValue.java:10: duplicate annotation member value value in A
          Object a = String @A(value = 2, value = 1) [].class;
                                                ^
      1 error

      However, this is still not correct -- the correct place for the caret is at the beginning of the second instance of "value".

            jjg Jonathan Gibbons
            jjg Jonathan Gibbons
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: