mirror of
https://github.com/openjdk/jdk.git
synced 2026-04-05 04:31:36 +00:00
8026818: Defmeth failures with -mode invoke
Added test for IllegalAccessException -> IllegalAccessError path to check if root cause was AbstractMethodError Reviewed-by: jrose
This commit is contained in:
parent
7ebab2dbcd
commit
2ebcd75a95
@ -441,8 +441,13 @@ class MethodHandleNatives {
|
||||
assert(refKindIsValid(refKind));
|
||||
return lookup.linkMethodHandleConstant((byte) refKind, defc, name, type);
|
||||
} catch (IllegalAccessException ex) {
|
||||
Error err = new IllegalAccessError(ex.getMessage());
|
||||
throw initCauseFrom(err, ex);
|
||||
Throwable cause = ex.getCause();
|
||||
if (cause instanceof AbstractMethodError) {
|
||||
throw (AbstractMethodError) cause;
|
||||
} else {
|
||||
Error err = new IllegalAccessError(ex.getMessage());
|
||||
throw initCauseFrom(err, ex);
|
||||
}
|
||||
} catch (NoSuchMethodException ex) {
|
||||
Error err = new NoSuchMethodError(ex.getMessage());
|
||||
throw initCauseFrom(err, ex);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user