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

@ -1193,7 +1193,7 @@ public class ObjectStreamClass implements Serializable {
try {
writeObjectMethod.invoke(obj, new Object[]{ out });
} catch (InvocationTargetException ex) {
Throwable th = ex.getTargetException();
Throwable th = ex.getCause();
if (th instanceof IOException) {
throw (IOException) th;
} else {
@ -1223,7 +1223,7 @@ public class ObjectStreamClass implements Serializable {
try {
readObjectMethod.invoke(obj, new Object[]{ in });
} catch (InvocationTargetException ex) {
Throwable th = ex.getTargetException();
Throwable th = ex.getCause();
if (th instanceof ClassNotFoundException) {
throw (ClassNotFoundException) th;
} else if (th instanceof IOException) {
@ -1254,7 +1254,7 @@ public class ObjectStreamClass implements Serializable {
try {
readObjectNoDataMethod.invoke(obj, (Object[]) null);
} catch (InvocationTargetException ex) {
Throwable th = ex.getTargetException();
Throwable th = ex.getCause();
if (th instanceof ObjectStreamException) {
throw (ObjectStreamException) th;
} else {
@ -1283,7 +1283,7 @@ public class ObjectStreamClass implements Serializable {
try {
return writeReplaceMethod.invoke(obj, (Object[]) null);
} catch (InvocationTargetException ex) {
Throwable th = ex.getTargetException();
Throwable th = ex.getCause();
if (th instanceof ObjectStreamException) {
throw (ObjectStreamException) th;
} else {
@ -1313,7 +1313,7 @@ public class ObjectStreamClass implements Serializable {
try {
return readResolveMethod.invoke(obj, (Object[]) null);
} catch (InvocationTargetException ex) {
Throwable th = ex.getTargetException();
Throwable th = ex.getCause();
if (th instanceof ObjectStreamException) {
throw (ObjectStreamException) th;
} else {