jdk.internal.reflect.ReflectionFactory and SecurityManager

Paul Sandoz paul.sandoz at oracle.com
Mon Jan 9 22:07:02 UTC 2017

> On 9 Jan 2017, at 13:27, Martin Buchholz <martinrb at google.com> wrote:
> My whitebox tests tend to use private access only for reading, but I can imagine cases where it is useful to give testing code stronger access than for regular VarHandles, maybe even to write final fields, for example for fuzz testing or reliably creating an internal state that can only happen with a race.  There's may be a case for providing such a big hammer, if it's sufficiently hard to get at, but I can live without it.

That big hammer could be jdk.internal.misc.Unsafe for certain tightly bound tests that really need it.

> My preference would be to encourage people to use MethodHandles.privateLookupIn.
> I'm a convert!


> It will take a while for privateLookupIn to become "common knowledge".

I shall endeavour to mention it at Devoxx US in March where John and I will present on java.lang.invoke.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/jtreg-use/attachments/20170109/c1bb88a8/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 841 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://mail.openjdk.java.net/pipermail/jtreg-use/attachments/20170109/c1bb88a8/signature.asc>

More information about the jtreg-use mailing list