What is the advantage of adding runtime generated classes to a specific named module? If all generated classes are collected in a single module, this module does not have a meaningful readability scope. If enough interfaces are proxied, the proxy module will converge to full read access, wouldn't it?
Why not add such proxy classes to a class loader's unnamed module? 2015-12-08 15:52 GMT+01:00 Sundararajan Athijegannathan < [email protected]>: > addRead -> addReads > > -Sundar > > > On 12/8/2015 8:20 PM, Sundararajan Athijegannathan wrote: > >> Because jdk.proxy1 is a dynamically created module, you've to >> programmatically add read using java.lang.reflect.Module (addRead method) >> API. >> >> -Sundar >> >> On 12/8/2015 8:11 PM, Stephane Epardaud wrote: >> >>> Except I can't add reads to it: >>> >>> $HOME/no-backup/src/jdk1.9.0-jigsaw/bin/java >>> -XaddReads:jdk.proxy1=com.redhat.ceylon.model ... >>> Error occurred during initialization of VM >>> java.lang.RuntimeException: Unknown module: jdk.proxy1 >>> at >>> jdk.internal.module.ModuleBootstrap.fail([email protected]/ModuleBootstrap.java:394) >>> >>> at >>> jdk.internal.module.ModuleBootstrap.addMoreReads([email protected]/ModuleBootstrap.java:319) >>> >>> at >>> jdk.internal.module.ModuleBootstrap.boot([email protected]/ModuleBootstrap.java:229) >>> >>> at java.lang.System.initPhase2([email protected]/System.java:1263) >>> >>> That must be a mistake though, otherwise I can't use reflection to read >>> annotations… >>> >>> 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 original ----- >>>> >>>>> De: "Stephane Epardaud" <[email protected]> >>>>> À: [email protected] >>>>> 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.proxy1.$Proxy3 (in module jdk.proxy1) because module >>>>> com.redhat.ceylon.model does not read module 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. >>>>> >>>>> >> >
