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

SourcePositions are wrong for Strings concatenated with '+' operator

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: P4
    • Resolution: Unresolved
    • Affects Version/s: 7
    • Fix Version/s: tbd_minor
    • Component/s: tools
    • Labels:

      Description

      SourcePositions reports the wrong start/end offsets for ExpressionTrees containing Strings concatenated with '+' operator, and in some cases (annotation arguments) the end offset is -1.
      Compile and run the attached program with tools.jar in the classpath.
      It prints out:
      Annotation argument: + "ll") pu
      StartOffset: 22
      EndOffset: -1
      Field init: + "ll"
      StartOffset: 86
      EndOffset: 92

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated: