mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 15:24:43 +02:00
8264148: Update spec for exceptions retrofitted for exception chaining
Reviewed-by: rriggs, smarks
This commit is contained in:
parent
353807c5f1
commit
815248ab27
22 changed files with 40 additions and 76 deletions
|
@ -29,13 +29,6 @@ package java.lang.reflect;
|
|||
* InvocationTargetException is a checked exception that wraps
|
||||
* an exception thrown by an invoked method or constructor.
|
||||
*
|
||||
* <p>As of release 1.4, this exception has been retrofitted to conform to
|
||||
* the general purpose exception-chaining mechanism. The "target exception"
|
||||
* that is provided at construction time and accessed via the
|
||||
* {@link #getTargetException()} method is now known as the <i>cause</i>,
|
||||
* and may be accessed via the {@link Throwable#getCause()} method,
|
||||
* as well as the aforementioned "legacy method."
|
||||
*
|
||||
* @see Method
|
||||
* @see Constructor
|
||||
* @since 1.1
|
||||
|
@ -90,7 +83,8 @@ public class InvocationTargetException extends ReflectiveOperationException {
|
|||
/**
|
||||
* Get the thrown target exception.
|
||||
*
|
||||
* <p>This method predates the general-purpose exception chaining facility.
|
||||
* @apiNote
|
||||
* This method predates the general-purpose exception chaining facility.
|
||||
* The {@link Throwable#getCause()} method is now the preferred means of
|
||||
* obtaining this information.
|
||||
*
|
||||
|
@ -107,6 +101,7 @@ public class InvocationTargetException extends ReflectiveOperationException {
|
|||
* @return the cause of this exception.
|
||||
* @since 1.4
|
||||
*/
|
||||
@Override
|
||||
public Throwable getCause() {
|
||||
return target;
|
||||
}
|
||||
|
|
|
@ -48,15 +48,6 @@ import jdk.internal.access.SharedSecrets;
|
|||
* {@code RuntimeException}, so it is an unchecked exception
|
||||
* that wraps a checked exception.
|
||||
*
|
||||
* <p>As of release 1.4, this exception has been retrofitted to
|
||||
* conform to the general purpose exception-chaining mechanism. The
|
||||
* "undeclared checked exception that was thrown by the invocation
|
||||
* handler" that may be provided at construction time and accessed via
|
||||
* the {@link #getUndeclaredThrowable()} method is now known as the
|
||||
* <i>cause</i>, and may be accessed via the {@link
|
||||
* Throwable#getCause()} method, as well as the aforementioned "legacy
|
||||
* method."
|
||||
*
|
||||
* @author Peter Jones
|
||||
* @see InvocationHandler
|
||||
* @since 1.3
|
||||
|
@ -94,7 +85,8 @@ public class UndeclaredThrowableException extends RuntimeException {
|
|||
* Returns the {@code Throwable} instance wrapped in this
|
||||
* {@code UndeclaredThrowableException}, which may be {@code null}.
|
||||
*
|
||||
* <p>This method predates the general-purpose exception chaining facility.
|
||||
* @apiNote
|
||||
* This method predates the general-purpose exception chaining facility.
|
||||
* The {@link Throwable#getCause()} method is now the preferred means of
|
||||
* obtaining this information.
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue