RFR: 8267509: Improve IllegalAccessException message to include the cause of the exception [v3]
Naoto Sato
naoto at openjdk.org
Wed Oct 4 18:11:28 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 increase 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
Would it be helpful if we call `IllegalAccessException.initCause(IllegalArgumentException)` before throwing it?
-------------
PR Comment: https://git.openjdk.org/jdk/pull/15698#issuecomment-1747399304
More information about the core-libs-dev
mailing list