Re: trySetAccessible​

2017-07-11 Thread Alan Bateman
On 11/07/2017 15:37, Jochen Theodorou wrote: : we need that on the level of a class member. Not every method in a class from an exported package is accessible or has been made accessible via runtime mechanisms. The CLI options don't change the class or member modifiers so you should be able t

Re: trySetAccessible​

2017-07-11 Thread Jochen Theodorou
On 11.07.2017 12:11, Alan Bateman wrote: On 11/07/2017 10:16, Uwe Schindler wrote: [...] But now it is impossible for us to check, if something is not open by default. Module::getDescriptor will return the module descriptor for named modules. So in this case, Object.class.getModule().getDes

Re: trySetAccessible​

2017-07-11 Thread Alan Bateman
On 11/07/2017 10:16, Uwe Schindler wrote: : Sorry, I mixed up the parameters. So basically the "correct" code to check if something like java.lang.String is open to Groovy would be: Module groovyModule = CachedClass.class.getModule(); // org.codehaus.groovy.reflection.CachedClass; Class clazz

RE: trySetAccessible​

2017-07-11 Thread Uwe Schindler
Moin, > > we understand all this. But what you say is also not true. I started a > > second > approach to fix the issue by using canAccess() and also checking the module > stuff. For that I executed the following code on the Groovy unnamed > module: > > > > import org.codehaus.groovy.reflection.C