Generated by
JDiff

java.lang.reflect Documentation Differences

This file contains all the changes in documentation in the package java.lang.reflect as colored differences. Deletions are shown like this, and additions are shown like this.
If no deletions or additions are shown in an entry, the HTML tags will be what has changed. The new HTML tags are shown in the differences. If no documentation existed, and then some was added in a later version, this change is noted in the appropriate class pages of differences, but the change is not shown on this page. Only changes in existing text are shown here. Similarly, documentation which was inherited from another class or interface is not shown here.
Note that an HTML error in the new documentation may cause the display of other documentation changes to be presented incorrectly. For instance, failure to close a <code> tag will cause all subsequent paragraphs to be displayed differently.

Class AccessibleObject

The AccessibleObject class is the base class for Field Method and Constructor objects. It provides the ability to flag a reflected object as suppressing default Java language access control checks when it is used. The access checks--for public default (package) access protected and private members--are performed when Fields Methods or Constructors are used to set or get fields to invoke methods or to create and initialize new instances of classes respectively.

Setting the accessible flag in a reflected object permits sophisticated applications with sufficient privilege such as Java Object Serialization or other persistence mechanisms to manipulate objects in a manner that would normally be prohibited. @see Field @see Method @see Constructor @see ReflectPermission @since JDK11.2

Class AccessibleObject, void setAccessible(AccessibleObject[], boolean)

Convenience method to set the accessible flag for an array of objects with a single security check (for efficiency).

First if there is a security manager its checkPermission method is called with a ReflectPermission("suppressAccessChecks") permission.

A SecurityException is raised if flag is true but accessibility of any of the elements of the input array may not be changed (for example if the element object is a Constructor object for the class I the event of such a SecurityException the accessiblity of objects is set to flag for array elements upto (and excluding) the element for which the exception occurred; the accessiblity of elements beyond (and including) the element for which the exception occurred is unchanged. @param array the array of AccessibleObjects @param flag the new value for the accessible flag in each object @throws SecurityException if the request is denied. @see SecurityManager#checkPermission @see java.lang.RuntimePermission

Class AccessibleObject, void setAccessible(boolean)

Set the accessible flag for this object to the indicated boolean value. A value of true indicates that the reflected object should suppress Java language access checking when it is used. A value of false indicates that the reflected object should enforce Java language access checks.

First if there is a security manager its checkPermission method is called with a ReflectPermission("suppressAccessChecks") permission.

A SecurityException is raised if flag is true but accessibility of this object may not be changed (for example if this element object is a Constructor object for the class

SecurityException is raised if this object is a java.lang.reflect.Constructor object for the class java.lang.Class and flag is true. @param flag the new value for the accessible flag @throws SecurityException if the request is denied. @see SecurityManager#checkPermission @see java.lang.RuntimePermission


Class Array, Object newInstance(Class, int)

Creates a new array with the specified component type and length. Invoking this method is equivalent to creating an array as follows:
 int[] x = {length]}; Array.newInstance[(componentType x]); 
@param componentType the Class object representing the component type of the new array @param length the length of the new array @return the new array @exception NullPointerException if the specified componentType parameter is null @exception NegativeArraySizeException if the specified length is negative

Class Constructor

Constructor provides information about and access to a single constructor for a class.

Constructor permits widening conversions to occur when matching the actual parameters to newInstance() with the underlying constructor's formal parameters but throws an IllegalArgumentException if a narrowing conversion would occur. @see Member @see java.lang.Class @see java.lang.Class#getConstructors() @see java.lang.Class#getConstructor(Class[]) @see java.lang.Class#getDeclaredConstructors() @author Nakul Saraiya


Class Field

A Field provides information about and dynamic access to a single field of a class or an interface. The reflected field may be a class (static) field or an instance field.

A Field permits widening conversions to occur during a get or set access operation but throws an IllegalArgumentException if a narrowing conversion would occur. @see Member @see java.lang.Class @see java.lang.Class#getFields() @see java.lang.Class#getField(String) @see java.lang.Class#getDeclaredFields() @see java.lang.Class#getDeclaredField(String) @author Nakul Saraiya


Class Modifier, boolean isStrict(int)

Return true if the specifier integer includes the strictstrictfp modifier.
Class Modifier, int STRICT

The int value representing the strictstrictfp modifier.

Class ReflectPermission

The Permission class for reflective operations. A ReflectPermission is a named permission and has no actions. The only name currently defined is suppressAccessChecks which allows suppressing the standard Java language access checks -- for public default (package) access protected and private members -- performed by reflected objects at their point of use.

The following table provides a summary description of what the permission allows and discusses the risks of granting code the permission.

Permission Target Name What the Permission Allows Risks of Allowing this Permission
suppressAccessChecks ability to access fields and invoke methods in a class. Note that this includes not only public but protected and private fields and methods as well. This is dangerous in that information (possibly confidential) and methods normally unavailable would be accessible to malicious code.
@see java.security.Permission @see java.security.BasicPermission @see AccessibleObject @see Field#get @see Field#set @see Method#invoke @see Constructor#newInstance @since JDK11.2