< prev index next >
src/java.base/share/classes/java/lang/reflect/AccessibleObject.java
Print this page
*** 174,183 ****
--- 174,190 ----
* members with default (package) access, protected instance members, or
* protected constructors when the declaring class is in a different module
* to the caller and the package containing the declaring class is not open
* to the caller's module. </p>
*
+ * <p> If this reflected object is a final field declared in a
+ * {@linkplain Class#isHiddenClass() hidden class}, this method can
+ * only be used to suppress checks for Java language access control
+ * to gain read access but not write access even if the {@code accessible}
+ * flag is {@code true}. That is, final fields in a hidden class are
+ * not modifiable.
+ *
* <p> If there is a security manager, its
* {@code checkPermission} method is first called with a
* {@code ReflectPermission("suppressAccessChecks")} permission.
*
* @param flag the new value for the {@code accessible} flag
< prev index next >