----- Mail original ----- > De: "Andrew Dinn" <ad...@redhat.com> > À: "John Rose" <john.r.r...@oracle.com> > Cc: jigsaw-dev@openjdk.java.net > Envoyé: Mercredi 2 Novembre 2016 14:25:01 > Objet: Re: New proposal for #ReflectiveAccessToNonExportedTypes: Open modules > & open packages
> On 02/11/16 01:58, John Rose wrote: >> On Nov 1, 2016, at 12:02 PM, Andrew Dinn <ad...@redhat.com> wrote: >>> >>> I did actually suggest a way of avoiding the use of Unsafe. You >>> give your nominated module full reflective access to >>> java.lang.invoke allowing it to create Lookup instances (it can >>> actually just create a single all privileges lookup and use this to >>> clone others). You don't need to insert a class into >>> java.lang.invoke to do this. You simply add one exports directive >>> on the command line. >> >> The weak link in this otherwise robust scheme is the use of a command >> line option to break into the jli package. Breaking in by the back >> door is awkward and might not deliver the desired Lookup if jli code >> changes. And it probably will, over time. Using the break-in is a >> good Proof of concept but the finished product needs to use a real >> API provided by the JDK, and using a wormhole Lookup actually >> provided by a cooperating jli. I look forward to such a thing in a >> future JDK. > > Me too! But for now it's burglary or bust :-) > >> Perhaps the right surface shape for moderate reflection is Maurizios >> "reflection manifesto" API, which is completely interface driven. >> This means a meta-CE with full deep access could mock up a >> "reflection manifesto" implementation which would expose exactly the >> right moderate surface area, as negotiated with the target module. >> Just an idea… > > Hmm, I have not seen said manifesto. Is it available somewhere public? Maurizio talk about it at last JVM Language Summit https://encrypted.google.com/search?hl=en&q=youtube%20Valhalla%20Reflection The manifesto is here http://cr.openjdk.java.net/~mcimadamore/reflection-manifesto.html > > regards, > > > Andrew Dinn Rémi > ----------- > Senior Principal Software Engineer > Red Hat UK Ltd > Registered in England and Wales under Company Registration No. 03798903 > Directors: Michael Cunningham, Michael ("Mike") O'Neill, Eric Shander