RFR(S): 8160564: TEST: Add a test to check the implementation of VersionProps.versionNumbers()

Volker Simonis volker.simonis at gmail.com
Thu Jul 7 14:51:21 UTC 2016


On Thu, Jul 7, 2016 at 4:26 PM, Alan Bateman <Alan.Bateman at oracle.com> wrote:
> On 07/07/2016 14:59, Volker Simonis wrote:
>
>> :
>>
>> - I was a little bit surprised that I could reflectively access and
>> execute java.lang.VersionProps.parseVersionNumbers() where both the
>> class and the method are package private. Maybe this is related to
>> Jigsaw issue #ReflectiveAccessToNonExportedTypes [3]? As I'm not a
>> Jigsaw expert, I'd be graceful to anybody explaining me why this is
>> still so easily possible with Jigsaw?
>>
>>
> java.lang is an exported package and I assume you are using
> setAccessible(true) too.
>

Yes, I do use setAccessible(true) but I naively expected it to fail.

So does it mean the module system does not prevent me from
reflectively using package private classes/methods from exported
packages?

Thanks,
Volker

> -Alan


More information about the core-libs-dev mailing list