Handle UndeclaredThrowableException/NoSuchFieldException in JDK 12+
@@ -202,16 +202,14 @@ public class ClientProxyImpl extends AbstractClient implements
}
MethodHandle mh = lookup.unreflectSpecial(m, declaringClass).bindTo(o);
return params != null && params.length > 0 ? mh.invokeWithArguments(params) : mh.invoke();
- } catch (IllegalAccessException e) {
- try {
+ } catch (Throwable t) {
+ try { // try using built-in JDK 9+ API for invoking default method
return invokeDefaultMethodUsingPrivateLookup(declaringClass, o, m, params);
} catch (final NoSuchMethodException ex) {
- throw new WrappedException(e);
- }
- } catch (Throwable t) {
throw new WrappedException(t);
}
}
+ }
});
} catch (PrivilegedActionException pae) {
Throwable wrapped = pae.getCause();
