static import versus annotations

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P2
    • 5.0
    • Affects Version/s: 5.0
    • Component/s: tools
    • b32
    • generic
    • solaris_8

      Static imports do not affect annotations:

      ====================$ cat -n T.java
           1 import java.lang.annotation.Retention;
           2 import static java.lang.annotation.RetentionPolicy.RUNTIME;
           3
           4 @Retention(RUNTIME)
           5 @interface T {
           6 }
      ====================$ newjavac T.java
      T.java:4: cannot find symbol
      symbol : variable RUNTIME
      location: @interface T
      @Retention(RUNTIME)
                 ^
      1 error
      ====================$

            Assignee:
            Neal Gafter (Inactive)
            Reporter:
            Neal Gafter (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: