8264148: Update spec for exceptions retrofitted for exception chaining

Reviewed-by: rriggs, smarks
This commit is contained in:
Joe Darcy 2021-03-30 19:59:59 +00:00
parent 353807c5f1
commit 815248ab27
22 changed files with 40 additions and 76 deletions

View file

@ -33,13 +33,6 @@ package java.io;
* field. The stream is reset to it's initial state and all references
* to objects already deserialized are discarded.
*
* <p>As of release 1.4, this exception has been retrofitted to conform to
* the general purpose exception-chaining mechanism. The "exception causing
* the abort" that is provided at construction time and
* accessed via the public {@link #detail} field is now known as the
* <i>cause</i>, and may be accessed via the {@link Throwable#getCause()}
* method, as well as the aforementioned "legacy field."
*
* @since 1.1
*/
public class WriteAbortedException extends ObjectStreamException {
@ -49,12 +42,13 @@ public class WriteAbortedException extends ObjectStreamException {
/**
* Exception that was caught while writing the ObjectStream.
*
* <p>This field predates the general-purpose exception chaining facility.
* The {@link Throwable#getCause()} method is now the preferred means of
* obtaining this information.
* @deprecated This field predates the general-purpose exception
* chaining facility. The {@link Throwable#getCause()} method is
* now the preferred means of obtaining this information.
*
* @serial
*/
@Deprecated(since="17")
public Exception detail;
/**
@ -87,6 +81,7 @@ public class WriteAbortedException extends ObjectStreamException {
* which may be null.
* @since 1.4
*/
@Override
public Throwable getCause() {
return detail;
}