Re: trySetAccessible
Alan Bateman
Alan.Bateman at oracle.com
Mon Aug 28 13:28:53 UTC 2017
On 28/08/2017 13:02, Russell Gold wrote:
>
> That’s unfortunate; I had hoped that one of the real advantages of the
> warning system was to allow us to degrade gracefully, putting in code
> that would continue to work the old way in JDK8 but use new mechanisms
> only when required.
The purpose of the warnings is to identify bad code that may need to be
changed when access to JDK internals is eventually denied. From your
mails it sounds like you attempting to fix some issues (which is good)
but the code is still runs when on JDK 9.
>
>> Have you looked at using multi-release JARs?
>
>
> I’m using them where I can; the problem is that the tooling isn’t
> there, yet. I have found numerous temporary solutions, but none of
> them allow for unit testing against both the old and new code,
If you mean that it's difficult to have several JDKs in the testing
environment then I agree. One thing to look at is the
jdk.util.jar.version and jdk.util.jar.enableMultiRelease properties
(documented in the "Implementation Note" of JarFile) as that should
allow you to use one JDK 9 build to exercise the code in different ways.
-Alan
More information about the jigsaw-dev
mailing list