RFR(S+M) / 8022701 Accessibility checking: InvocationTargetException is thrown instead of IllegalAccessError
David Chase
david.r.chase at oracle.com
Thu Sep 12 12:17:24 PDT 2013
The test is adapted from the test in the bug report.
The headline on the bug report is wrong -- because it uses reflection in the test to do the invocation,
the thrown exception is wrapped with InvocationTargetException, which is completely correct.
HOWEVER, the exception inside the wrapper is the wrong one.
The new test checks the exception in both the reflective-invocation and plain-invocation cases,
and also checks both a method handle call (which threw the wrong exception) and a plain
call (which threw, and throws, the right exception).
The test also uses a tweaked classloader to substitute the borked bytecodes necessary to get
the error, so it is not only shell-free, it can also be run outside jtreg.
On 2013-09-12, at 2:34 PM, Christian Thalinger <christian.thalinger at oracle.com> wrote:
>
> On Sep 12, 2013, at 11:28 AM, David Chase <david.r.chase at oracle.com> wrote:
>
>> New webrev, commented line removed:
>> http://cr.openjdk.java.net/~drchase/8022701/webrev.03/
>
> I think the change is good given that the tests work now. Is your test derived from the test in the bug report?
>
> And it would be good if John could also have a quick look (just be to be sure).
>
> -- Chris
>
>>
>> On 2013-09-12, at 1:53 PM, David Chase <david.r.chase at oracle.com> wrote:
>>
>>> I believe it produced extraneous output -- it was not clear to me that it was either necessary or useful to fully describe all the converted exceptions that lead to the defined exception being thrown. The commented line should have just been removed (I think).
>>>
>>> On 2013-09-12, at 1:24 PM, Christian Thalinger <christian.thalinger at oracle.com> wrote:
>>>
>>>> + // err.initCause(ex);
>>>>
>>>> Why is this commented?
>>>>
>>>> -- Chris
>>
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 163 bytes
Desc: Message signed with OpenPGP using GPGMail
Url : http://mail.openjdk.java.net/pipermail/mlvm-dev/attachments/20130912/2e3fec94/signature.asc
More information about the mlvm-dev
mailing list