8310849: Pattern matching for instanceof and arrayType cleanup in j.l.invoke and j.l.reflect

Reviewed-by: mchung, darcy
This commit is contained in:
Chen Liang 2023-06-27 16:10:50 +00:00 committed by Mandy Chung
parent 7ce967a10c
commit 2bd4136bdb
34 changed files with 211 additions and 292 deletions

View file

@ -185,8 +185,8 @@ class MethodHandleStatics {
/** Propagate unchecked exceptions and errors, but wrap anything checked and throw that instead. */
/*non-public*/
static Error uncaughtException(Throwable ex) {
if (ex instanceof Error) throw (Error) ex;
if (ex instanceof RuntimeException) throw (RuntimeException) ex;
if (ex instanceof Error error) throw error;
if (ex instanceof RuntimeException re) throw re;
throw new InternalError("uncaught exception", ex);
}
private static String message(String message, Object obj) {