8267509: Improve IllegalAccessException message to include the cause of the exception

Reviewed-by: liach, naoto
This commit is contained in:
Mandy Chung 2023-10-04 18:39:25 +00:00
parent ddacf92713
commit 36314a90c1

View File

@ -1719,7 +1719,8 @@ assertEquals("[three, thee, tee]", asListFix.invoke((Object)argv).toString());
try {
return this.withVarargs(true);
} catch (IllegalArgumentException ex) {
throw member.makeAccessException("cannot make variable arity", null);
throw new IllegalAccessException("cannot make variable arity: " + member +
" does not have a trailing array parameter");
}
}