Javac reports wrong error offset for unknown identifier of annotation element/value pair

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P4
    • 9
    • Affects Version/s: 8
    • Component/s: tools
    • b36
    • Verified

        Code:
        @MyAnnotation( value=5, foo=6 )
        public class Class2 {
        }
        @interface MyAnnotation {
            int value();
        }

        The error is marked at the value '6', not the identifier 'foo':
        Class2.java:1: error: cannot find symbol
        @MyAnnotation( value=5, foo=6 )
                                                     ^
          symbol: method foo()
          location: @interface MyAnnotation
        1 error

        This worked fine in JDK7 but is broken in JDK8

              Assignee:
              Jan Lahoda
              Reporter:
              Keimpe Bronkhorst (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: