Is there really a jdk.proxy1 module?

Stephane Epardaud stef at epardaud.fr
Tue Dec 8 15:10:30 UTC 2015



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.lang.Class object
> likewise. Looking-up annotations likewise.
>
> What exactly are you trying to do and what exception do you get?

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. I got that when accessing the annotation's member Method:


java.lang.IllegalAccessException: class
com.redhat.ceylon.model.loader.impl.reflect.mirror.ReflectionAnnotation
(in module com.redhat.ceylon.model) cannot access interface
com.redhat.ceylon.compiler.java.metadata.Module (in module
ceylon.language) because module ceylon.language does not export package
com.redhat.ceylon.compiler.java.metadata to module com.redhat.ceylon.model
    at
sun.reflect.Reflection.throwIllegalAccessException(java.base at 9.0/Reflection.java:455)
    at
sun.reflect.Reflection.ensureMemberAccess(java.base at 9.0/Reflection.java:130)
    at
java.lang.reflect.AccessibleObject.slowCheckMemberAccess(java.base at 9.0/AccessibleObject.java:370)
    at
java.lang.reflect.AccessibleObject.checkAccess(java.base at 9.0/AccessibleObject.java:362)
    at java.lang.reflect.Method.invoke(java.base at 9.0/Method.java:525)

> Cycles are checked only when constructing a Layer. Later, they are not
> any more. The problem with cycles is mainly in compile-time as I
> understand.

Well, they're not really a problem at all at compile-time, not any more
than Class cycles are a problem, in the sense that the workaround is
simple: compile them at the same time. But OK, at least I can solve my
issue by introducing cycles at runtime.


More information about the jigsaw-dev mailing list