Access | Constructor and Description |
---|---|
public |
Modifier and Type | Method and Description |
---|---|
pack-priv static boolean | isIllegalArgument(Class<?>
the accessor class that does the method handle invocation accessorType, RuntimeException ClassCastException, NullPointerException or WrongMethodTypeException e)Determines if the given exception thrown by MethodHandle::invokeExact is caused by an illegal argument passed to Method::invoke or Constructor::newInstance. |
IMPL_PACKAGES | back to summary |
---|---|
private static final Set<String> IMPL_PACKAGES |
AccessorUtils | back to summary |
---|---|
public AccessorUtils() |
isIllegalArgument | back to summary |
---|---|
pack-priv static boolean isIllegalArgument(Class<?> accessorType, RuntimeException e) Determines if the given exception thrown by MethodHandle::invokeExact is caused by an illegal argument passed to Method::invoke or Constructor::newInstance. This method inspects the stack trace of the exception to detect if it is thrown by the method handle core implementation or the implementation of the reflected method or constructor. MethodHandle::invoke throws ClassCastException if the receiver object is not an instance of the declaring class of the method if the method is an instance method, or if a parameter value cannot be converted to the corresponding formal parameter type. It throws NullPointerException if the receiver object is null if the method is an instance method, or if unboxing operation of a parameter fails because the parameter value is null. It throws WrongMethodTypeException if the method type mismatches.
|