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

incorrect position given for duplicate annotation value error

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 7
    • Fix Version/s: 7
    • Component/s: tools
    • Labels:
    • Subcomponent:
    • Resolved In Build:
      b84
    • CPU:
      generic
    • OS:
      generic
    • Verification:
      Verified

      Description

      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".

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: