mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-26 22:34:27 +02:00
8315810: Reimplement sun.reflect.ReflectionFactory::newConstructorForSerialization with method handles
Co-authored-by: Chen Liang <liach@openjdk.org> Reviewed-by: rriggs
This commit is contained in:
parent
eb1f67b160
commit
5cea53d372
10 changed files with 141 additions and 41 deletions
|
@ -1034,12 +1034,12 @@ public final class ObjectStreamClass implements Serializable {
|
|||
new AccessControlContext(domains));
|
||||
} catch (UndeclaredThrowableException x) {
|
||||
Throwable cause = x.getCause();
|
||||
if (cause instanceof InstantiationException)
|
||||
throw (InstantiationException) cause;
|
||||
if (cause instanceof InvocationTargetException)
|
||||
throw (InvocationTargetException) cause;
|
||||
if (cause instanceof IllegalAccessException)
|
||||
throw (IllegalAccessException) cause;
|
||||
if (cause instanceof InstantiationException ie)
|
||||
throw ie;
|
||||
if (cause instanceof InvocationTargetException ite)
|
||||
throw ite;
|
||||
if (cause instanceof IllegalAccessException iae)
|
||||
throw iae;
|
||||
// not supposed to happen
|
||||
throw x;
|
||||
}
|
||||
|
@ -1047,6 +1047,12 @@ public final class ObjectStreamClass implements Serializable {
|
|||
} catch (IllegalAccessException ex) {
|
||||
// should not occur, as access checks have been suppressed
|
||||
throw new InternalError(ex);
|
||||
} catch (InvocationTargetException ex) {
|
||||
Throwable cause = ex.getCause();
|
||||
if (cause instanceof Error err)
|
||||
throw err;
|
||||
else
|
||||
throw ex;
|
||||
} catch (InstantiationError err) {
|
||||
var ex = new InstantiationException();
|
||||
ex.initCause(err);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue