src/share/classes/java/lang/reflect/Modifier.java

Print this page

        

@@ -349,48 +349,54 @@
     static boolean isMandated(int mod) {
       return (mod & MANDATED) != 0;
     }
 
     /**
-     * See JLSv3 section 8.1.1.
+     * See JLS section 8.1.1.
      */
     private static final int CLASS_MODIFIERS =
         Modifier.PUBLIC         | Modifier.PROTECTED    | Modifier.PRIVATE |
         Modifier.ABSTRACT       | Modifier.STATIC       | Modifier.FINAL   |
         Modifier.STRICT;
 
     /**
-     * See JLSv3 section 9.1.1.
+     * See JLS section 9.1.1.
      */
     private static final int INTERFACE_MODIFIERS =
         Modifier.PUBLIC         | Modifier.PROTECTED    | Modifier.PRIVATE |
         Modifier.ABSTRACT       | Modifier.STATIC       | Modifier.STRICT;
 
 
     /**
-     * See JLSv3 section 8.8.3.
+     * See JLS section 8.8.3.
      */
     private static final int CONSTRUCTOR_MODIFIERS =
         Modifier.PUBLIC         | Modifier.PROTECTED    | Modifier.PRIVATE;
 
     /**
-     * See JLSv3 section 8.4.3.
+     * See JLS section 8.4.3.
      */
     private static final int METHOD_MODIFIERS =
         Modifier.PUBLIC         | Modifier.PROTECTED    | Modifier.PRIVATE |
         Modifier.ABSTRACT       | Modifier.STATIC       | Modifier.FINAL   |
         Modifier.SYNCHRONIZED   | Modifier.NATIVE       | Modifier.STRICT;
 
     /**
-     * See JLSv3 section 8.3.1.
+     * See JLS section 8.3.1.
      */
     private static final int FIELD_MODIFIERS =
         Modifier.PUBLIC         | Modifier.PROTECTED    | Modifier.PRIVATE |
         Modifier.STATIC         | Modifier.FINAL        | Modifier.TRANSIENT |
         Modifier.VOLATILE;
 
     /**
+     * See JLS section 8.4.1.
+     */
+    private static final int PARAMETER_MODIFIERS =
+        Modifier.FINAL;
+
+    /**
      *
      */
     static final int ACCESS_MODIFIERS =
         Modifier.PUBLIC | Modifier.PROTECTED | Modifier.PRIVATE;
 

@@ -444,10 +450,22 @@
      */
     public static int methodModifiers() {
         return METHOD_MODIFIERS;
     }
 
+    /**
+     * Return an {@code int} value OR-ing together the source language
+     * modifiers that can be applied to a parameter.
+     * @return an {@code int} value OR-ing together the source language
+     * modifiers that can be applied to a parameter.
+     *
+     * @jls 8.4.1 Formal Parameters
+     * @since 1.8
+     */
+    public static int parameterModifiers() {
+        return PARAMETER_MODIFIERS;
+    }
 
     /**
      * Return an {@code int} value OR-ing together the source language
      * modifiers that can be applied to a field.
      * @return an {@code int} value OR-ing together the source language