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

strictfp allowed as annotation element modifier

    XMLWordPrintable

Details

    • b119

    Description

      The following file does not compile in 7:

      import java.lang.annotation.*;
      @Retention(RetentionPolicy.RUNTIME)
      @interface T {
          strictfp float ff() default -1.0f;
      }


      $ javac T.java
      T.java:4: error: modifier strictfp not allowed here
          strictfp float ff() default -1.0f;
                         ^
      1 error

      In 8 it compiles.

      JLS for 7 is actually slightly inconsistent here the grammar in the 9.6.1 says AbstractMethodModifier but the grammar in chapter 18 says modifier.

      Attachments

        Activity

          People

            jfranck Joel Borggrén-Franck (Inactive)
            jfranck Joel Borggrén-Franck (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: