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

static import versus annotations

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P2
    • Resolution: Fixed
    • Affects Version/s: 5.0
    • Fix Version/s: 5.0
    • Component/s: tools
    • Labels:
    • Subcomponent:
    • Resolved In Build:
      b32
    • CPU:
      generic
    • OS:
      solaris_8

      Description

      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
      ====================$

        Attachments

          Activity

            People

            Assignee:
            gafter Neal Gafter
            Reporter:
            gafter Neal Gafter
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: