RFR: 8267509: Improve IllegalAccessException message to include the cause of the exception [v3]

Mandy Chung mchung at openjdk.org
Wed Oct 4 18:32:22 UTC 2023


On Wed, 13 Sep 2023 17:52:22 GMT, Mandy Chung <mchung at openjdk.org> wrote:

>> This PR improves IllegalAccessException message thrown by `Lookup::findXXX` APIs if the method's variable arity modifier bit is set and `asVarargsCollector` fails.  It will include the exception message thrown by asVarargsCollector`.
>> 
>> The exception message looks like this:
>> 
>> java.lang.IllegalAccessException: cannot make variable arity: MyClass.m(Object[],int)void/invokeStatic does not have a trailing array parameter
>
> Mandy Chung has updated the pull request incrementally with one additional commit since the last revision:
> 
>   revised message

It's a user error. The exception message makes it clear for the users what's wrong with the requested method.   The cause's stacktrace is less relevant to them.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/15698#issuecomment-1747425360


More information about the core-libs-dev mailing list