src/java.base/share/classes/java/lang/reflect/Field.java
changeset 58242 94bb65cb37d3
parent 57503 042dfb697624
child 58679 9c3209ff7550
equal deleted inserted replaced
58241:33de7752835c 58242:94bb65cb37d3
   391      * to be extracted
   391      * to be extracted
   392      * @return the value of the represented field in object
   392      * @return the value of the represented field in object
   393      * {@code obj}; primitive values are wrapped in an appropriate
   393      * {@code obj}; primitive values are wrapped in an appropriate
   394      * object before being returned
   394      * object before being returned
   395      *
   395      *
   396      * @exception IllegalAccessException    if this {@code Field} object
   396      * @throws    IllegalAccessException    if this {@code Field} object
   397      *              is enforcing Java language access control and the underlying
   397      *              is enforcing Java language access control and the underlying
   398      *              field is inaccessible.
   398      *              field is inaccessible.
   399      * @exception IllegalArgumentException  if the specified object is not an
   399      * @throws    IllegalArgumentException  if the specified object is not an
   400      *              instance of the class or interface declaring the underlying
   400      *              instance of the class or interface declaring the underlying
   401      *              field (or a subclass or implementor thereof).
   401      *              field (or a subclass or implementor thereof).
   402      * @exception NullPointerException      if the specified object is null
   402      * @throws    NullPointerException      if the specified object is null
   403      *              and the field is an instance field.
   403      *              and the field is an instance field.
   404      * @exception ExceptionInInitializerError if the initialization provoked
   404      * @throws    ExceptionInInitializerError if the initialization provoked
   405      *              by this method fails.
   405      *              by this method fails.
   406      */
   406      */
   407     @CallerSensitive
   407     @CallerSensitive
   408     @ForceInline // to ensure Reflection.getCallerClass optimization
   408     @ForceInline // to ensure Reflection.getCallerClass optimization
   409     public Object get(Object obj)
   409     public Object get(Object obj)
   421      *
   421      *
   422      * @param obj the object to extract the {@code boolean} value
   422      * @param obj the object to extract the {@code boolean} value
   423      * from
   423      * from
   424      * @return the value of the {@code boolean} field
   424      * @return the value of the {@code boolean} field
   425      *
   425      *
   426      * @exception IllegalAccessException    if this {@code Field} object
   426      * @throws    IllegalAccessException    if this {@code Field} object
   427      *              is enforcing Java language access control and the underlying
   427      *              is enforcing Java language access control and the underlying
   428      *              field is inaccessible.
   428      *              field is inaccessible.
   429      * @exception IllegalArgumentException  if the specified object is not
   429      * @throws    IllegalArgumentException  if the specified object is not
   430      *              an instance of the class or interface declaring the
   430      *              an instance of the class or interface declaring the
   431      *              underlying field (or a subclass or implementor
   431      *              underlying field (or a subclass or implementor
   432      *              thereof), or if the field value cannot be
   432      *              thereof), or if the field value cannot be
   433      *              converted to the type {@code boolean} by a
   433      *              converted to the type {@code boolean} by a
   434      *              widening conversion.
   434      *              widening conversion.
   435      * @exception NullPointerException      if the specified object is null
   435      * @throws    NullPointerException      if the specified object is null
   436      *              and the field is an instance field.
   436      *              and the field is an instance field.
   437      * @exception ExceptionInInitializerError if the initialization provoked
   437      * @throws    ExceptionInInitializerError if the initialization provoked
   438      *              by this method fails.
   438      *              by this method fails.
   439      * @see       Field#get
   439      * @see       Field#get
   440      */
   440      */
   441     @CallerSensitive
   441     @CallerSensitive
   442     @ForceInline // to ensure Reflection.getCallerClass optimization
   442     @ForceInline // to ensure Reflection.getCallerClass optimization
   455      *
   455      *
   456      * @param obj the object to extract the {@code byte} value
   456      * @param obj the object to extract the {@code byte} value
   457      * from
   457      * from
   458      * @return the value of the {@code byte} field
   458      * @return the value of the {@code byte} field
   459      *
   459      *
   460      * @exception IllegalAccessException    if this {@code Field} object
   460      * @throws    IllegalAccessException    if this {@code Field} object
   461      *              is enforcing Java language access control and the underlying
   461      *              is enforcing Java language access control and the underlying
   462      *              field is inaccessible.
   462      *              field is inaccessible.
   463      * @exception IllegalArgumentException  if the specified object is not
   463      * @throws    IllegalArgumentException  if the specified object is not
   464      *              an instance of the class or interface declaring the
   464      *              an instance of the class or interface declaring the
   465      *              underlying field (or a subclass or implementor
   465      *              underlying field (or a subclass or implementor
   466      *              thereof), or if the field value cannot be
   466      *              thereof), or if the field value cannot be
   467      *              converted to the type {@code byte} by a
   467      *              converted to the type {@code byte} by a
   468      *              widening conversion.
   468      *              widening conversion.
   469      * @exception NullPointerException      if the specified object is null
   469      * @throws    NullPointerException      if the specified object is null
   470      *              and the field is an instance field.
   470      *              and the field is an instance field.
   471      * @exception ExceptionInInitializerError if the initialization provoked
   471      * @throws    ExceptionInInitializerError if the initialization provoked
   472      *              by this method fails.
   472      *              by this method fails.
   473      * @see       Field#get
   473      * @see       Field#get
   474      */
   474      */
   475     @CallerSensitive
   475     @CallerSensitive
   476     @ForceInline // to ensure Reflection.getCallerClass optimization
   476     @ForceInline // to ensure Reflection.getCallerClass optimization
   491      *
   491      *
   492      * @param obj the object to extract the {@code char} value
   492      * @param obj the object to extract the {@code char} value
   493      * from
   493      * from
   494      * @return the value of the field converted to type {@code char}
   494      * @return the value of the field converted to type {@code char}
   495      *
   495      *
   496      * @exception IllegalAccessException    if this {@code Field} object
   496      * @throws    IllegalAccessException    if this {@code Field} object
   497      *              is enforcing Java language access control and the underlying
   497      *              is enforcing Java language access control and the underlying
   498      *              field is inaccessible.
   498      *              field is inaccessible.
   499      * @exception IllegalArgumentException  if the specified object is not
   499      * @throws    IllegalArgumentException  if the specified object is not
   500      *              an instance of the class or interface declaring the
   500      *              an instance of the class or interface declaring the
   501      *              underlying field (or a subclass or implementor
   501      *              underlying field (or a subclass or implementor
   502      *              thereof), or if the field value cannot be
   502      *              thereof), or if the field value cannot be
   503      *              converted to the type {@code char} by a
   503      *              converted to the type {@code char} by a
   504      *              widening conversion.
   504      *              widening conversion.
   505      * @exception NullPointerException      if the specified object is null
   505      * @throws    NullPointerException      if the specified object is null
   506      *              and the field is an instance field.
   506      *              and the field is an instance field.
   507      * @exception ExceptionInInitializerError if the initialization provoked
   507      * @throws    ExceptionInInitializerError if the initialization provoked
   508      *              by this method fails.
   508      *              by this method fails.
   509      * @see Field#get
   509      * @see Field#get
   510      */
   510      */
   511     @CallerSensitive
   511     @CallerSensitive
   512     @ForceInline // to ensure Reflection.getCallerClass optimization
   512     @ForceInline // to ensure Reflection.getCallerClass optimization
   527      *
   527      *
   528      * @param obj the object to extract the {@code short} value
   528      * @param obj the object to extract the {@code short} value
   529      * from
   529      * from
   530      * @return the value of the field converted to type {@code short}
   530      * @return the value of the field converted to type {@code short}
   531      *
   531      *
   532      * @exception IllegalAccessException    if this {@code Field} object
   532      * @throws    IllegalAccessException    if this {@code Field} object
   533      *              is enforcing Java language access control and the underlying
   533      *              is enforcing Java language access control and the underlying
   534      *              field is inaccessible.
   534      *              field is inaccessible.
   535      * @exception IllegalArgumentException  if the specified object is not
   535      * @throws    IllegalArgumentException  if the specified object is not
   536      *              an instance of the class or interface declaring the
   536      *              an instance of the class or interface declaring the
   537      *              underlying field (or a subclass or implementor
   537      *              underlying field (or a subclass or implementor
   538      *              thereof), or if the field value cannot be
   538      *              thereof), or if the field value cannot be
   539      *              converted to the type {@code short} by a
   539      *              converted to the type {@code short} by a
   540      *              widening conversion.
   540      *              widening conversion.
   541      * @exception NullPointerException      if the specified object is null
   541      * @throws    NullPointerException      if the specified object is null
   542      *              and the field is an instance field.
   542      *              and the field is an instance field.
   543      * @exception ExceptionInInitializerError if the initialization provoked
   543      * @throws    ExceptionInInitializerError if the initialization provoked
   544      *              by this method fails.
   544      *              by this method fails.
   545      * @see       Field#get
   545      * @see       Field#get
   546      */
   546      */
   547     @CallerSensitive
   547     @CallerSensitive
   548     @ForceInline // to ensure Reflection.getCallerClass optimization
   548     @ForceInline // to ensure Reflection.getCallerClass optimization
   563      *
   563      *
   564      * @param obj the object to extract the {@code int} value
   564      * @param obj the object to extract the {@code int} value
   565      * from
   565      * from
   566      * @return the value of the field converted to type {@code int}
   566      * @return the value of the field converted to type {@code int}
   567      *
   567      *
   568      * @exception IllegalAccessException    if this {@code Field} object
   568      * @throws    IllegalAccessException    if this {@code Field} object
   569      *              is enforcing Java language access control and the underlying
   569      *              is enforcing Java language access control and the underlying
   570      *              field is inaccessible.
   570      *              field is inaccessible.
   571      * @exception IllegalArgumentException  if the specified object is not
   571      * @throws    IllegalArgumentException  if the specified object is not
   572      *              an instance of the class or interface declaring the
   572      *              an instance of the class or interface declaring the
   573      *              underlying field (or a subclass or implementor
   573      *              underlying field (or a subclass or implementor
   574      *              thereof), or if the field value cannot be
   574      *              thereof), or if the field value cannot be
   575      *              converted to the type {@code int} by a
   575      *              converted to the type {@code int} by a
   576      *              widening conversion.
   576      *              widening conversion.
   577      * @exception NullPointerException      if the specified object is null
   577      * @throws    NullPointerException      if the specified object is null
   578      *              and the field is an instance field.
   578      *              and the field is an instance field.
   579      * @exception ExceptionInInitializerError if the initialization provoked
   579      * @throws    ExceptionInInitializerError if the initialization provoked
   580      *              by this method fails.
   580      *              by this method fails.
   581      * @see       Field#get
   581      * @see       Field#get
   582      */
   582      */
   583     @CallerSensitive
   583     @CallerSensitive
   584     @ForceInline // to ensure Reflection.getCallerClass optimization
   584     @ForceInline // to ensure Reflection.getCallerClass optimization
   599      *
   599      *
   600      * @param obj the object to extract the {@code long} value
   600      * @param obj the object to extract the {@code long} value
   601      * from
   601      * from
   602      * @return the value of the field converted to type {@code long}
   602      * @return the value of the field converted to type {@code long}
   603      *
   603      *
   604      * @exception IllegalAccessException    if this {@code Field} object
   604      * @throws    IllegalAccessException    if this {@code Field} object
   605      *              is enforcing Java language access control and the underlying
   605      *              is enforcing Java language access control and the underlying
   606      *              field is inaccessible.
   606      *              field is inaccessible.
   607      * @exception IllegalArgumentException  if the specified object is not
   607      * @throws    IllegalArgumentException  if the specified object is not
   608      *              an instance of the class or interface declaring the
   608      *              an instance of the class or interface declaring the
   609      *              underlying field (or a subclass or implementor
   609      *              underlying field (or a subclass or implementor
   610      *              thereof), or if the field value cannot be
   610      *              thereof), or if the field value cannot be
   611      *              converted to the type {@code long} by a
   611      *              converted to the type {@code long} by a
   612      *              widening conversion.
   612      *              widening conversion.
   613      * @exception NullPointerException      if the specified object is null
   613      * @throws    NullPointerException      if the specified object is null
   614      *              and the field is an instance field.
   614      *              and the field is an instance field.
   615      * @exception ExceptionInInitializerError if the initialization provoked
   615      * @throws    ExceptionInInitializerError if the initialization provoked
   616      *              by this method fails.
   616      *              by this method fails.
   617      * @see       Field#get
   617      * @see       Field#get
   618      */
   618      */
   619     @CallerSensitive
   619     @CallerSensitive
   620     @ForceInline // to ensure Reflection.getCallerClass optimization
   620     @ForceInline // to ensure Reflection.getCallerClass optimization
   635      *
   635      *
   636      * @param obj the object to extract the {@code float} value
   636      * @param obj the object to extract the {@code float} value
   637      * from
   637      * from
   638      * @return the value of the field converted to type {@code float}
   638      * @return the value of the field converted to type {@code float}
   639      *
   639      *
   640      * @exception IllegalAccessException    if this {@code Field} object
   640      * @throws    IllegalAccessException    if this {@code Field} object
   641      *              is enforcing Java language access control and the underlying
   641      *              is enforcing Java language access control and the underlying
   642      *              field is inaccessible.
   642      *              field is inaccessible.
   643      * @exception IllegalArgumentException  if the specified object is not
   643      * @throws    IllegalArgumentException  if the specified object is not
   644      *              an instance of the class or interface declaring the
   644      *              an instance of the class or interface declaring the
   645      *              underlying field (or a subclass or implementor
   645      *              underlying field (or a subclass or implementor
   646      *              thereof), or if the field value cannot be
   646      *              thereof), or if the field value cannot be
   647      *              converted to the type {@code float} by a
   647      *              converted to the type {@code float} by a
   648      *              widening conversion.
   648      *              widening conversion.
   649      * @exception NullPointerException      if the specified object is null
   649      * @throws    NullPointerException      if the specified object is null
   650      *              and the field is an instance field.
   650      *              and the field is an instance field.
   651      * @exception ExceptionInInitializerError if the initialization provoked
   651      * @throws    ExceptionInInitializerError if the initialization provoked
   652      *              by this method fails.
   652      *              by this method fails.
   653      * @see Field#get
   653      * @see Field#get
   654      */
   654      */
   655     @CallerSensitive
   655     @CallerSensitive
   656     @ForceInline // to ensure Reflection.getCallerClass optimization
   656     @ForceInline // to ensure Reflection.getCallerClass optimization
   671      *
   671      *
   672      * @param obj the object to extract the {@code double} value
   672      * @param obj the object to extract the {@code double} value
   673      * from
   673      * from
   674      * @return the value of the field converted to type {@code double}
   674      * @return the value of the field converted to type {@code double}
   675      *
   675      *
   676      * @exception IllegalAccessException    if this {@code Field} object
   676      * @throws    IllegalAccessException    if this {@code Field} object
   677      *              is enforcing Java language access control and the underlying
   677      *              is enforcing Java language access control and the underlying
   678      *              field is inaccessible.
   678      *              field is inaccessible.
   679      * @exception IllegalArgumentException  if the specified object is not
   679      * @throws    IllegalArgumentException  if the specified object is not
   680      *              an instance of the class or interface declaring the
   680      *              an instance of the class or interface declaring the
   681      *              underlying field (or a subclass or implementor
   681      *              underlying field (or a subclass or implementor
   682      *              thereof), or if the field value cannot be
   682      *              thereof), or if the field value cannot be
   683      *              converted to the type {@code double} by a
   683      *              converted to the type {@code double} by a
   684      *              widening conversion.
   684      *              widening conversion.
   685      * @exception NullPointerException      if the specified object is null
   685      * @throws    NullPointerException      if the specified object is null
   686      *              and the field is an instance field.
   686      *              and the field is an instance field.
   687      * @exception ExceptionInInitializerError if the initialization provoked
   687      * @throws    ExceptionInInitializerError if the initialization provoked
   688      *              by this method fails.
   688      *              by this method fails.
   689      * @see       Field#get
   689      * @see       Field#get
   690      */
   690      */
   691     @CallerSensitive
   691     @CallerSensitive
   692     @ForceInline // to ensure Reflection.getCallerClass optimization
   692     @ForceInline // to ensure Reflection.getCallerClass optimization
   752      *
   752      *
   753      * @param obj the object whose field should be modified
   753      * @param obj the object whose field should be modified
   754      * @param value the new value for the field of {@code obj}
   754      * @param value the new value for the field of {@code obj}
   755      * being modified
   755      * being modified
   756      *
   756      *
   757      * @exception IllegalAccessException    if this {@code Field} object
   757      * @throws    IllegalAccessException    if this {@code Field} object
   758      *              is enforcing Java language access control and the underlying
   758      *              is enforcing Java language access control and the underlying
   759      *              field is either inaccessible or final.
   759      *              field is either inaccessible or final.
   760      * @exception IllegalArgumentException  if the specified object is not an
   760      * @throws    IllegalArgumentException  if the specified object is not an
   761      *              instance of the class or interface declaring the underlying
   761      *              instance of the class or interface declaring the underlying
   762      *              field (or a subclass or implementor thereof),
   762      *              field (or a subclass or implementor thereof),
   763      *              or if an unwrapping conversion fails.
   763      *              or if an unwrapping conversion fails.
   764      * @exception NullPointerException      if the specified object is null
   764      * @throws    NullPointerException      if the specified object is null
   765      *              and the field is an instance field.
   765      *              and the field is an instance field.
   766      * @exception ExceptionInInitializerError if the initialization provoked
   766      * @throws    ExceptionInInitializerError if the initialization provoked
   767      *              by this method fails.
   767      *              by this method fails.
   768      */
   768      */
   769     @CallerSensitive
   769     @CallerSensitive
   770     @ForceInline // to ensure Reflection.getCallerClass optimization
   770     @ForceInline // to ensure Reflection.getCallerClass optimization
   771     public void set(Object obj, Object value)
   771     public void set(Object obj, Object value)
   787      *
   787      *
   788      * @param obj the object whose field should be modified
   788      * @param obj the object whose field should be modified
   789      * @param z   the new value for the field of {@code obj}
   789      * @param z   the new value for the field of {@code obj}
   790      * being modified
   790      * being modified
   791      *
   791      *
   792      * @exception IllegalAccessException    if this {@code Field} object
   792      * @throws    IllegalAccessException    if this {@code Field} object
   793      *              is enforcing Java language access control and the underlying
   793      *              is enforcing Java language access control and the underlying
   794      *              field is either inaccessible or final.
   794      *              field is either inaccessible or final.
   795      * @exception IllegalArgumentException  if the specified object is not an
   795      * @throws    IllegalArgumentException  if the specified object is not an
   796      *              instance of the class or interface declaring the underlying
   796      *              instance of the class or interface declaring the underlying
   797      *              field (or a subclass or implementor thereof),
   797      *              field (or a subclass or implementor thereof),
   798      *              or if an unwrapping conversion fails.
   798      *              or if an unwrapping conversion fails.
   799      * @exception NullPointerException      if the specified object is null
   799      * @throws    NullPointerException      if the specified object is null
   800      *              and the field is an instance field.
   800      *              and the field is an instance field.
   801      * @exception ExceptionInInitializerError if the initialization provoked
   801      * @throws    ExceptionInInitializerError if the initialization provoked
   802      *              by this method fails.
   802      *              by this method fails.
   803      * @see       Field#set
   803      * @see       Field#set
   804      */
   804      */
   805     @CallerSensitive
   805     @CallerSensitive
   806     @ForceInline // to ensure Reflection.getCallerClass optimization
   806     @ForceInline // to ensure Reflection.getCallerClass optimization
   823      *
   823      *
   824      * @param obj the object whose field should be modified
   824      * @param obj the object whose field should be modified
   825      * @param b   the new value for the field of {@code obj}
   825      * @param b   the new value for the field of {@code obj}
   826      * being modified
   826      * being modified
   827      *
   827      *
   828      * @exception IllegalAccessException    if this {@code Field} object
   828      * @throws    IllegalAccessException    if this {@code Field} object
   829      *              is enforcing Java language access control and the underlying
   829      *              is enforcing Java language access control and the underlying
   830      *              field is either inaccessible or final.
   830      *              field is either inaccessible or final.
   831      * @exception IllegalArgumentException  if the specified object is not an
   831      * @throws    IllegalArgumentException  if the specified object is not an
   832      *              instance of the class or interface declaring the underlying
   832      *              instance of the class or interface declaring the underlying
   833      *              field (or a subclass or implementor thereof),
   833      *              field (or a subclass or implementor thereof),
   834      *              or if an unwrapping conversion fails.
   834      *              or if an unwrapping conversion fails.
   835      * @exception NullPointerException      if the specified object is null
   835      * @throws    NullPointerException      if the specified object is null
   836      *              and the field is an instance field.
   836      *              and the field is an instance field.
   837      * @exception ExceptionInInitializerError if the initialization provoked
   837      * @throws    ExceptionInInitializerError if the initialization provoked
   838      *              by this method fails.
   838      *              by this method fails.
   839      * @see       Field#set
   839      * @see       Field#set
   840      */
   840      */
   841     @CallerSensitive
   841     @CallerSensitive
   842     @ForceInline // to ensure Reflection.getCallerClass optimization
   842     @ForceInline // to ensure Reflection.getCallerClass optimization
   859      *
   859      *
   860      * @param obj the object whose field should be modified
   860      * @param obj the object whose field should be modified
   861      * @param c   the new value for the field of {@code obj}
   861      * @param c   the new value for the field of {@code obj}
   862      * being modified
   862      * being modified
   863      *
   863      *
   864      * @exception IllegalAccessException    if this {@code Field} object
   864      * @throws    IllegalAccessException    if this {@code Field} object
   865      *              is enforcing Java language access control and the underlying
   865      *              is enforcing Java language access control and the underlying
   866      *              field is either inaccessible or final.
   866      *              field is either inaccessible or final.
   867      * @exception IllegalArgumentException  if the specified object is not an
   867      * @throws    IllegalArgumentException  if the specified object is not an
   868      *              instance of the class or interface declaring the underlying
   868      *              instance of the class or interface declaring the underlying
   869      *              field (or a subclass or implementor thereof),
   869      *              field (or a subclass or implementor thereof),
   870      *              or if an unwrapping conversion fails.
   870      *              or if an unwrapping conversion fails.
   871      * @exception NullPointerException      if the specified object is null
   871      * @throws    NullPointerException      if the specified object is null
   872      *              and the field is an instance field.
   872      *              and the field is an instance field.
   873      * @exception ExceptionInInitializerError if the initialization provoked
   873      * @throws    ExceptionInInitializerError if the initialization provoked
   874      *              by this method fails.
   874      *              by this method fails.
   875      * @see       Field#set
   875      * @see       Field#set
   876      */
   876      */
   877     @CallerSensitive
   877     @CallerSensitive
   878     @ForceInline // to ensure Reflection.getCallerClass optimization
   878     @ForceInline // to ensure Reflection.getCallerClass optimization
   895      *
   895      *
   896      * @param obj the object whose field should be modified
   896      * @param obj the object whose field should be modified
   897      * @param s   the new value for the field of {@code obj}
   897      * @param s   the new value for the field of {@code obj}
   898      * being modified
   898      * being modified
   899      *
   899      *
   900      * @exception IllegalAccessException    if this {@code Field} object
   900      * @throws    IllegalAccessException    if this {@code Field} object
   901      *              is enforcing Java language access control and the underlying
   901      *              is enforcing Java language access control and the underlying
   902      *              field is either inaccessible or final.
   902      *              field is either inaccessible or final.
   903      * @exception IllegalArgumentException  if the specified object is not an
   903      * @throws    IllegalArgumentException  if the specified object is not an
   904      *              instance of the class or interface declaring the underlying
   904      *              instance of the class or interface declaring the underlying
   905      *              field (or a subclass or implementor thereof),
   905      *              field (or a subclass or implementor thereof),
   906      *              or if an unwrapping conversion fails.
   906      *              or if an unwrapping conversion fails.
   907      * @exception NullPointerException      if the specified object is null
   907      * @throws    NullPointerException      if the specified object is null
   908      *              and the field is an instance field.
   908      *              and the field is an instance field.
   909      * @exception ExceptionInInitializerError if the initialization provoked
   909      * @throws    ExceptionInInitializerError if the initialization provoked
   910      *              by this method fails.
   910      *              by this method fails.
   911      * @see       Field#set
   911      * @see       Field#set
   912      */
   912      */
   913     @CallerSensitive
   913     @CallerSensitive
   914     @ForceInline // to ensure Reflection.getCallerClass optimization
   914     @ForceInline // to ensure Reflection.getCallerClass optimization
   931      *
   931      *
   932      * @param obj the object whose field should be modified
   932      * @param obj the object whose field should be modified
   933      * @param i   the new value for the field of {@code obj}
   933      * @param i   the new value for the field of {@code obj}
   934      * being modified
   934      * being modified
   935      *
   935      *
   936      * @exception IllegalAccessException    if this {@code Field} object
   936      * @throws    IllegalAccessException    if this {@code Field} object
   937      *              is enforcing Java language access control and the underlying
   937      *              is enforcing Java language access control and the underlying
   938      *              field is either inaccessible or final.
   938      *              field is either inaccessible or final.
   939      * @exception IllegalArgumentException  if the specified object is not an
   939      * @throws    IllegalArgumentException  if the specified object is not an
   940      *              instance of the class or interface declaring the underlying
   940      *              instance of the class or interface declaring the underlying
   941      *              field (or a subclass or implementor thereof),
   941      *              field (or a subclass or implementor thereof),
   942      *              or if an unwrapping conversion fails.
   942      *              or if an unwrapping conversion fails.
   943      * @exception NullPointerException      if the specified object is null
   943      * @throws    NullPointerException      if the specified object is null
   944      *              and the field is an instance field.
   944      *              and the field is an instance field.
   945      * @exception ExceptionInInitializerError if the initialization provoked
   945      * @throws    ExceptionInInitializerError if the initialization provoked
   946      *              by this method fails.
   946      *              by this method fails.
   947      * @see       Field#set
   947      * @see       Field#set
   948      */
   948      */
   949     @CallerSensitive
   949     @CallerSensitive
   950     @ForceInline // to ensure Reflection.getCallerClass optimization
   950     @ForceInline // to ensure Reflection.getCallerClass optimization
   967      *
   967      *
   968      * @param obj the object whose field should be modified
   968      * @param obj the object whose field should be modified
   969      * @param l   the new value for the field of {@code obj}
   969      * @param l   the new value for the field of {@code obj}
   970      * being modified
   970      * being modified
   971      *
   971      *
   972      * @exception IllegalAccessException    if this {@code Field} object
   972      * @throws    IllegalAccessException    if this {@code Field} object
   973      *              is enforcing Java language access control and the underlying
   973      *              is enforcing Java language access control and the underlying
   974      *              field is either inaccessible or final.
   974      *              field is either inaccessible or final.
   975      * @exception IllegalArgumentException  if the specified object is not an
   975      * @throws    IllegalArgumentException  if the specified object is not an
   976      *              instance of the class or interface declaring the underlying
   976      *              instance of the class or interface declaring the underlying
   977      *              field (or a subclass or implementor thereof),
   977      *              field (or a subclass or implementor thereof),
   978      *              or if an unwrapping conversion fails.
   978      *              or if an unwrapping conversion fails.
   979      * @exception NullPointerException      if the specified object is null
   979      * @throws    NullPointerException      if the specified object is null
   980      *              and the field is an instance field.
   980      *              and the field is an instance field.
   981      * @exception ExceptionInInitializerError if the initialization provoked
   981      * @throws    ExceptionInInitializerError if the initialization provoked
   982      *              by this method fails.
   982      *              by this method fails.
   983      * @see       Field#set
   983      * @see       Field#set
   984      */
   984      */
   985     @CallerSensitive
   985     @CallerSensitive
   986     @ForceInline // to ensure Reflection.getCallerClass optimization
   986     @ForceInline // to ensure Reflection.getCallerClass optimization
  1003      *
  1003      *
  1004      * @param obj the object whose field should be modified
  1004      * @param obj the object whose field should be modified
  1005      * @param f   the new value for the field of {@code obj}
  1005      * @param f   the new value for the field of {@code obj}
  1006      * being modified
  1006      * being modified
  1007      *
  1007      *
  1008      * @exception IllegalAccessException    if this {@code Field} object
  1008      * @throws    IllegalAccessException    if this {@code Field} object
  1009      *              is enforcing Java language access control and the underlying
  1009      *              is enforcing Java language access control and the underlying
  1010      *              field is either inaccessible or final.
  1010      *              field is either inaccessible or final.
  1011      * @exception IllegalArgumentException  if the specified object is not an
  1011      * @throws    IllegalArgumentException  if the specified object is not an
  1012      *              instance of the class or interface declaring the underlying
  1012      *              instance of the class or interface declaring the underlying
  1013      *              field (or a subclass or implementor thereof),
  1013      *              field (or a subclass or implementor thereof),
  1014      *              or if an unwrapping conversion fails.
  1014      *              or if an unwrapping conversion fails.
  1015      * @exception NullPointerException      if the specified object is null
  1015      * @throws    NullPointerException      if the specified object is null
  1016      *              and the field is an instance field.
  1016      *              and the field is an instance field.
  1017      * @exception ExceptionInInitializerError if the initialization provoked
  1017      * @throws    ExceptionInInitializerError if the initialization provoked
  1018      *              by this method fails.
  1018      *              by this method fails.
  1019      * @see       Field#set
  1019      * @see       Field#set
  1020      */
  1020      */
  1021     @CallerSensitive
  1021     @CallerSensitive
  1022     @ForceInline // to ensure Reflection.getCallerClass optimization
  1022     @ForceInline // to ensure Reflection.getCallerClass optimization
  1039      *
  1039      *
  1040      * @param obj the object whose field should be modified
  1040      * @param obj the object whose field should be modified
  1041      * @param d   the new value for the field of {@code obj}
  1041      * @param d   the new value for the field of {@code obj}
  1042      * being modified
  1042      * being modified
  1043      *
  1043      *
  1044      * @exception IllegalAccessException    if this {@code Field} object
  1044      * @throws    IllegalAccessException    if this {@code Field} object
  1045      *              is enforcing Java language access control and the underlying
  1045      *              is enforcing Java language access control and the underlying
  1046      *              field is either inaccessible or final.
  1046      *              field is either inaccessible or final.
  1047      * @exception IllegalArgumentException  if the specified object is not an
  1047      * @throws    IllegalArgumentException  if the specified object is not an
  1048      *              instance of the class or interface declaring the underlying
  1048      *              instance of the class or interface declaring the underlying
  1049      *              field (or a subclass or implementor thereof),
  1049      *              field (or a subclass or implementor thereof),
  1050      *              or if an unwrapping conversion fails.
  1050      *              or if an unwrapping conversion fails.
  1051      * @exception NullPointerException      if the specified object is null
  1051      * @throws    NullPointerException      if the specified object is null
  1052      *              and the field is an instance field.
  1052      *              and the field is an instance field.
  1053      * @exception ExceptionInInitializerError if the initialization provoked
  1053      * @throws    ExceptionInInitializerError if the initialization provoked
  1054      *              by this method fails.
  1054      *              by this method fails.
  1055      * @see       Field#set
  1055      * @see       Field#set
  1056      */
  1056      */
  1057     @CallerSensitive
  1057     @CallerSensitive
  1058     @ForceInline // to ensure Reflection.getCallerClass optimization
  1058     @ForceInline // to ensure Reflection.getCallerClass optimization