RFR(S+M) / 8022701 Accessibility checking: InvocationTargetException is thrown instead of IllegalAccessError
david.r.chase at oracle.com
Thu Sep 12 19:17:24 UTC 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:
> 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
More information about the core-libs-dev