src/share/classes/java/lang/reflect/Field.java
Print this page
@@ -358,12 +358,13 @@
* to be extracted
* @return the value of the represented field in object
* {@code obj}; primitive values are wrapped in an appropriate
* object before being returned
*
- * @exception IllegalAccessException if the underlying field
- * is inaccessible.
+ * @exception IllegalAccessException if this {@code Field} object
+ * enforces Java language access control and the underlying
+ * field is inaccessible.
* @exception IllegalArgumentException if the specified object is not an
* instance of the class or interface declaring the underlying
* field (or a subclass or implementor thereof).
* @exception NullPointerException if the specified object is null
* and the field is an instance field.
@@ -381,12 +382,13 @@
*
* @param obj the object to extract the {@code boolean} value
* from
* @return the value of the {@code boolean} field
*
- * @exception IllegalAccessException if the underlying field
- * is inaccessible.
+ * @exception IllegalAccessException if this {@code Field} object
+ * enforces Java language access control and the underlying
+ * field is inaccessible.
* @exception IllegalArgumentException if the specified object is not
* an instance of the class or interface declaring the
* underlying field (or a subclass or implementor
* thereof), or if the field value cannot be
* converted to the type {@code boolean} by a
@@ -408,12 +410,13 @@
*
* @param obj the object to extract the {@code byte} value
* from
* @return the value of the {@code byte} field
*
- * @exception IllegalAccessException if the underlying field
- * is inaccessible.
+ * @exception IllegalAccessException if this {@code Field} object
+ * enforces Java language access control and the underlying
+ * field is inaccessible.
* @exception IllegalArgumentException if the specified object is not
* an instance of the class or interface declaring the
* underlying field (or a subclass or implementor
* thereof), or if the field value cannot be
* converted to the type {@code byte} by a
@@ -437,12 +440,13 @@
*
* @param obj the object to extract the {@code char} value
* from
* @return the value of the field converted to type {@code char}
*
- * @exception IllegalAccessException if the underlying field
- * is inaccessible.
+ * @exception IllegalAccessException if this {@code Field} object
+ * enforces Java language access control and the underlying
+ * field is inaccessible.
* @exception IllegalArgumentException if the specified object is not
* an instance of the class or interface declaring the
* underlying field (or a subclass or implementor
* thereof), or if the field value cannot be
* converted to the type {@code char} by a
@@ -466,12 +470,13 @@
*
* @param obj the object to extract the {@code short} value
* from
* @return the value of the field converted to type {@code short}
*
- * @exception IllegalAccessException if the underlying field
- * is inaccessible.
+ * @exception IllegalAccessException if this {@code Field} object
+ * enforces Java language access control and the underlying
+ * field is inaccessible.
* @exception IllegalArgumentException if the specified object is not
* an instance of the class or interface declaring the
* underlying field (or a subclass or implementor
* thereof), or if the field value cannot be
* converted to the type {@code short} by a
@@ -495,12 +500,13 @@
*
* @param obj the object to extract the {@code int} value
* from
* @return the value of the field converted to type {@code int}
*
- * @exception IllegalAccessException if the underlying field
- * is inaccessible.
+ * @exception IllegalAccessException if this {@code Field} object
+ * enforces Java language access control and the underlying
+ * field is inaccessible.
* @exception IllegalArgumentException if the specified object is not
* an instance of the class or interface declaring the
* underlying field (or a subclass or implementor
* thereof), or if the field value cannot be
* converted to the type {@code int} by a
@@ -524,12 +530,13 @@
*
* @param obj the object to extract the {@code long} value
* from
* @return the value of the field converted to type {@code long}
*
- * @exception IllegalAccessException if the underlying field
- * is inaccessible.
+ * @exception IllegalAccessException if this {@code Field} object
+ * enforces Java language access control and the underlying
+ * field is inaccessible.
* @exception IllegalArgumentException if the specified object is not
* an instance of the class or interface declaring the
* underlying field (or a subclass or implementor
* thereof), or if the field value cannot be
* converted to the type {@code long} by a
@@ -553,12 +560,13 @@
*
* @param obj the object to extract the {@code float} value
* from
* @return the value of the field converted to type {@code float}
*
- * @exception IllegalAccessException if the underlying field
- * is inaccessible.
+ * @exception IllegalAccessException if this {@code Field} object
+ * enforces Java language access control and the underlying
+ * field is inaccessible.
* @exception IllegalArgumentException if the specified object is not
* an instance of the class or interface declaring the
* underlying field (or a subclass or implementor
* thereof), or if the field value cannot be
* converted to the type {@code float} by a
@@ -582,12 +590,13 @@
*
* @param obj the object to extract the {@code double} value
* from
* @return the value of the field converted to type {@code double}
*
- * @exception IllegalAccessException if the underlying field
- * is inaccessible.
+ * @exception IllegalAccessException if this {@code Field} object
+ * enforces Java language access control and the underlying
+ * field is inaccessible.
* @exception IllegalArgumentException if the specified object is not
* an instance of the class or interface declaring the
* underlying field (or a subclass or implementor
* thereof), or if the field value cannot be
* converted to the type {@code double} by a
@@ -624,13 +633,13 @@
* <p>If this {@code Field} object enforces Java language access control, and
* the underlying field is inaccessible, the method throws an
* {@code IllegalAccessException}.
*
* <p>If the underlying field is final, the method throws an
- * {@code IllegalAccessException} unless
- * {@code setAccessible(true)} has succeeded for this field
- * and this field is non-static. Setting a final field in this way
+ * {@code IllegalAccessException} unless {@code setAccessible(true)}
+ * has succeeded for this {@code Field} object
+ * and the field is non-static. Setting a final field in this way
* is meaningful only during deserialization or reconstruction of
* instances of classes with blank final fields, before they are
* made available for access by other parts of a program. Use in
* any other context may have unpredictable effects, including cases
* in which other parts of a program continue to use the original
@@ -656,12 +665,13 @@
*
* @param obj the object whose field should be modified
* @param value the new value for the field of {@code obj}
* being modified
*
- * @exception IllegalAccessException if the underlying field
- * is inaccessible.
+ * @exception IllegalAccessException if this {@code Field} object
+ * enforces Java language access control and the underlying
+ * field is either inaccessible or final.
* @exception IllegalArgumentException if the specified object is not an
* instance of the class or interface declaring the underlying
* field (or a subclass or implementor thereof),
* or if an unwrapping conversion fails.
* @exception NullPointerException if the specified object is null
@@ -684,12 +694,13 @@
*
* @param obj the object whose field should be modified
* @param z the new value for the field of {@code obj}
* being modified
*
- * @exception IllegalAccessException if the underlying field
- * is inaccessible.
+ * @exception IllegalAccessException if this {@code Field} object
+ * enforces Java language access control and the underlying
+ * field is either inaccessible or final.
* @exception IllegalArgumentException if the specified object is not an
* instance of the class or interface declaring the underlying
* field (or a subclass or implementor thereof),
* or if an unwrapping conversion fails.
* @exception NullPointerException if the specified object is null
@@ -713,12 +724,13 @@
*
* @param obj the object whose field should be modified
* @param b the new value for the field of {@code obj}
* being modified
*
- * @exception IllegalAccessException if the underlying field
- * is inaccessible.
+ * @exception IllegalAccessException if this {@code Field} object
+ * enforces Java language access control and the underlying
+ * field is either inaccessible or final.
* @exception IllegalArgumentException if the specified object is not an
* instance of the class or interface declaring the underlying
* field (or a subclass or implementor thereof),
* or if an unwrapping conversion fails.
* @exception NullPointerException if the specified object is null
@@ -742,12 +754,13 @@
*
* @param obj the object whose field should be modified
* @param c the new value for the field of {@code obj}
* being modified
*
- * @exception IllegalAccessException if the underlying field
- * is inaccessible.
+ * @exception IllegalAccessException if this {@code Field} object
+ * enforces Java language access control and the underlying
+ * field is either inaccessible or final.
* @exception IllegalArgumentException if the specified object is not an
* instance of the class or interface declaring the underlying
* field (or a subclass or implementor thereof),
* or if an unwrapping conversion fails.
* @exception NullPointerException if the specified object is null
@@ -771,12 +784,13 @@
*
* @param obj the object whose field should be modified
* @param s the new value for the field of {@code obj}
* being modified
*
- * @exception IllegalAccessException if the underlying field
- * is inaccessible.
+ * @exception IllegalAccessException if this {@code Field} object
+ * enforces Java language access control and the underlying
+ * field is either inaccessible or final.
* @exception IllegalArgumentException if the specified object is not an
* instance of the class or interface declaring the underlying
* field (or a subclass or implementor thereof),
* or if an unwrapping conversion fails.
* @exception NullPointerException if the specified object is null
@@ -800,12 +814,13 @@
*
* @param obj the object whose field should be modified
* @param i the new value for the field of {@code obj}
* being modified
*
- * @exception IllegalAccessException if the underlying field
- * is inaccessible.
+ * @exception IllegalAccessException if this {@code Field} object
+ * enforces Java language access control and the underlying
+ * field is either inaccessible or final.
* @exception IllegalArgumentException if the specified object is not an
* instance of the class or interface declaring the underlying
* field (or a subclass or implementor thereof),
* or if an unwrapping conversion fails.
* @exception NullPointerException if the specified object is null
@@ -829,12 +844,13 @@
*
* @param obj the object whose field should be modified
* @param l the new value for the field of {@code obj}
* being modified
*
- * @exception IllegalAccessException if the underlying field
- * is inaccessible.
+ * @exception IllegalAccessException if this {@code Field} object
+ * enforces Java language access control and the underlying
+ * field is either inaccessible or final.
* @exception IllegalArgumentException if the specified object is not an
* instance of the class or interface declaring the underlying
* field (or a subclass or implementor thereof),
* or if an unwrapping conversion fails.
* @exception NullPointerException if the specified object is null
@@ -858,12 +874,13 @@
*
* @param obj the object whose field should be modified
* @param f the new value for the field of {@code obj}
* being modified
*
- * @exception IllegalAccessException if the underlying field
- * is inaccessible.
+ * @exception IllegalAccessException if this {@code Field} object
+ * enforces Java language access control and the underlying
+ * field is either inaccessible or final.
* @exception IllegalArgumentException if the specified object is not an
* instance of the class or interface declaring the underlying
* field (or a subclass or implementor thereof),
* or if an unwrapping conversion fails.
* @exception NullPointerException if the specified object is null
@@ -887,12 +904,13 @@
*
* @param obj the object whose field should be modified
* @param d the new value for the field of {@code obj}
* being modified
*
- * @exception IllegalAccessException if the underlying field
- * is inaccessible.
+ * @exception IllegalAccessException if this {@code Field} object
+ * enforces Java language access control and the underlying
+ * field is either inaccessible or final.
* @exception IllegalArgumentException if the specified object is not an
* instance of the class or interface declaring the underlying
* field (or a subclass or implementor thereof),
* or if an unwrapping conversion fails.
* @exception NullPointerException if the specified object is null