Re: Is there really a jdk.proxy1 module?

2015-12-09 Thread Peter Levart
On 12/09/2015 09:43 AM, Stephane Epardaud wrote: On 08/12/15 23:32, Mandy Chung wrote: Good point. Existing code should use Annotation.annotationType() instead of Annotation.getClass(). Annotation is an interface. Calling annotation.getClass() will only return the implementation class that ma

Re: Is there really a jdk.proxy1 module?

2015-12-09 Thread Stephane Epardaud
On 08/12/15 23:32, Mandy Chung wrote: > Good point. Existing code should use Annotation.annotationType() > instead of Annotation.getClass(). Annotation is an interface. Calling > annotation.getClass() will only return the implementation class that > may be encapsulated and not exported to the cal

Re: Is there really a jdk.proxy1 module?

2015-12-08 Thread Mandy Chung
> On Dec 8, 2015, at 2:05 PM, Peter Levart wrote: > > Hi Mandy, > > I don't think such special-casing for proxy classes is warranted and would > just complicate security-sensitive code. That was definitely a concern. Good point. Existing code should use Annotation.annotationType() inste

Re: Is there really a jdk.proxy1 module?

2015-12-08 Thread Peter Levart
On 12/08/2015 05:20 PM, Mandy Chung wrote: I believe your code is calling Class::getMethod on proxy class something like: Method m = proxy.getClass().getMethod(“Y”); m.invoke(proxy,….); The above reflects on the generated proxy class but not the proxy interface X. If you did t

Re: Is there really a jdk.proxy1 module?

2015-12-08 Thread forax
ax" > Cc: jigsaw-dev@openjdk.java.net > Envoyé: Mardi 8 Décembre 2015 16:28:40 > Objet: Re: Is there really a jdk.proxy1 module? > > "Usually used" by whom? You cannot create a proxy class in a class > loader that cannot "see" the interfaces it implements, so if

Re: Is there really a jdk.proxy1 module?

2015-12-08 Thread Stephane Epardaud
On 08/12/15 17:20, Mandy Chung wrote: > I believe your code is calling Class::getMethod on proxy class something like: > > Method m = proxy.getClass().getMethod(“Y”); > m.invoke(proxy,….); Right, it has to use reflection because it doesn't "read" the application. > The above reflects

Re: Is there really a jdk.proxy1 module?

2015-12-08 Thread Mandy Chung
> On Dec 8, 2015, at 7:10 AM, Stephane Epardaud wrote: > > On 08/12/15 16:07, Peter Levart wrote: >> >> >> Do you really have to addRead() ? Visibility of of classes >> (Class.forName()) should only depend on class loader delegation. >> Enumerating members, when you already have a java.lang.Cl

Re: Is there really a jdk.proxy1 module?

2015-12-08 Thread Stephane Epardaud
On 08/12/15 16:47, Peter Levart wrote: > I have a scanner that can scan annotations of type X (by name) and >> member Y (by name) so it must use reflection to load the annotation and >> member. > > You can do that without readability of the target module. Apparently not, see my exception. > >> I

Re: Is there really a jdk.proxy1 module?

2015-12-08 Thread Peter Levart
Hi Stephane, On 12/08/2015 04:10 PM, Stephane Epardaud wrote: On 08/12/15 16:07, Peter Levart wrote: Except now I have to add a read to scan annotations of another module, Do you really have to addRead() ? Visibility of of classes (Class.forName()) should only depend on class loader delegatio

Re: Is there really a jdk.proxy1 module?

2015-12-08 Thread David M. Lloyd
ss loader that is usually used is not the module class loader but one of its parent. Rémi - Mail original - De: "David M. Lloyd" À: jigsaw-dev@openjdk.java.net Envoyé: Mardi 8 Décembre 2015 16:05:06 Objet: Re: Is there really a jdk.proxy1 module? Or better yet, to the module de

Re: Is there really a jdk.proxy1 module?

2015-12-08 Thread Stephane Epardaud
Thanks, that helps, and that does describe what happened to me. On 08/12/15 16:17, Alan Bateman wrote: > The accessibility of the proxy class will be determined based on the > accessibility of the proxy interfaces. If there are proxy interfaces > is non-exported packages then the proxy will get ge

Re: Is there really a jdk.proxy1 module?

2015-12-08 Thread Alan Bateman
On 08/12/2015 14:21, Stephane Epardaud wrote: I'm getting: java.lang.IllegalAccessException: class com.redhat.ceylon.model.loader.impl.reflect.mirror.ReflectionAnnotation (in module com.redhat.ceylon.model) cannot access class com.sun.proxy.jdk.proxy1.$Proxy3 (in module jdk.proxy1) because modul

Re: Is there really a jdk.proxy1 module?

2015-12-08 Thread Remi Forax
No, because the class loader that is usually used is not the module class loader but one of its parent. Rémi - Mail original - > De: "David M. Lloyd" > À: jigsaw-dev@openjdk.java.net > Envoyé: Mardi 8 Décembre 2015 16:05:06 > Objet: Re: Is there really a jdk.

Re: Is there really a jdk.proxy1 module?

2015-12-08 Thread Stephane Epardaud
On 08/12/15 16:07, Peter Levart wrote: > >> Except now I have to add a read to scan annotations of another module, > > Do you really have to addRead() ? Visibility of of classes > (Class.forName()) should only depend on class loader delegation. > Enumerating members, when you already have a java.

Re: Is there really a jdk.proxy1 module?

2015-12-08 Thread Remi Forax
that a module is a sigle compilation unit. Rémi - Mail original - > De: "Stephane Epardaud" > À: jigsaw-dev@openjdk.java.net > Envoyé: Mardi 8 Décembre 2015 15:59:26 > Objet: Re: Is there really a jdk.proxy1 module? > > Actually no, I've found th

Re: Is there really a jdk.proxy1 module?

2015-12-08 Thread Peter Levart
On 12/08/2015 03:59 PM, Stephane Epardaud wrote: Actually no, I've found that insted of accessing the proxy class directly I should just access the proxied annotation class and it works. Thanks anyway. That's right. I was about to ask you about what you are doing to require access to implem

Re: Is there really a jdk.proxy1 module?

2015-12-08 Thread David M. Lloyd
ardaud" À: jigsaw-dev@openjdk.java.net Envoyé: Mardi 8 Décembre 2015 15:21:57 Objet: Is there really a jdk.proxy1 module? I'm getting: java.lang.IllegalAccessException: class com.redhat.ceylon.model.loader.impl.reflect.mirror.ReflectionAnnotation (in module com.redhat.ceylon.model) can

Re: Is there really a jdk.proxy1 module?

2015-12-08 Thread Rafael Winterhalter
… >>> >>> On 08/12/15 15:32, Remi Forax wrote: >>> >>>> No, >>>> jdk.proxy1 is a module created dynamically by the class >>>> java.lang.reflect.Proxy. >>>> >>>> Rémi >>>> >>>> - Mail origina

Re: Is there really a jdk.proxy1 module?

2015-12-08 Thread Stephane Epardaud
Actually no, I've found that insted of accessing the proxy class directly I should just access the proxied annotation class and it works. Thanks anyway. Except now I have to add a read to scan annotations of another module, which naturally introduces a cycle. This can't be right. Suppose I've a F

Re: Is there really a jdk.proxy1 module?

2015-12-08 Thread Sundararajan Athijegannathan
net Envoyé: Mardi 8 Décembre 2015 15:21:57 Objet: Is there really a jdk.proxy1 module? I'm getting: java.lang.IllegalAccessException: class com.redhat.ceylon.model.loader.impl.reflect.mirror.ReflectionAnnotation (in module com.redhat.ceylon.model) cannot access class com.sun.proxy.jdk.pro

Re: Is there really a jdk.proxy1 module?

2015-12-08 Thread Sundararajan Athijegannathan
orax wrote: No, jdk.proxy1 is a module created dynamically by the class java.lang.reflect.Proxy. Rémi - Mail original - De: "Stephane Epardaud" À: jigsaw-dev@openjdk.java.net Envoyé: Mardi 8 Décembre 2015 15:21:57 Objet: Is there really a jdk.pr

Re: Is there really a jdk.proxy1 module?

2015-12-08 Thread Stephane Epardaud
;> À: jigsaw-dev@openjdk.java.net >> Envoyé: Mardi 8 Décembre 2015 15:21:57 >> Objet: Is there really a jdk.proxy1 module? >> >> I'm getting: >> >> java.lang.IllegalAccessException: class >> com.redhat.ceylon.model.loader.impl.reflect.mirror.Reflect

Re: Is there really a jdk.proxy1 module?

2015-12-08 Thread Remi Forax
No, jdk.proxy1 is a module created dynamically by the class java.lang.reflect.Proxy. Rémi - Mail original - > De: "Stephane Epardaud" > À: jigsaw-dev@openjdk.java.net > Envoyé: Mardi 8 Décembre 2015 15:21:57 > Objet: Is there really a jdk.proxy1 mo

Is there really a jdk.proxy1 module?

2015-12-08 Thread Stephane Epardaud
odule jdk.proxy1 When using reflection to load annotations. Is there really a "jdk.proxy1" module I need to import when doing reflection? Sounds fishy, no? Cheers.