Re: Class file format version bump Re: is ClassLoader.loadClass() supposed to work on module-info classes?

2015-12-07 Thread Paul Benedict
I have just a quick question on the javadoc. It says "VarHandles cannot be subclassed by the user" but the class is abstract. What is the mechanism to actually prevent someone from subclassing it? Cheers, Paul On Mon, Dec 7, 2015 at 2:51 AM, Paul Sandoz wrote: > > > On

Re: is ClassLoader.loadClass() supposed to work on module-info classes?

2015-12-07 Thread Stephane Epardaud
FTR I have nothing against it being module-info.class. As far as Ceylon is concerned, that or MANIFEST.MF are both fine. What concerns me far more is that it's not self-sufficient since I have to recombine it with another source (OSGi or Maven metadata) to get version numbers and optional

Class file format version bump Re: is ClassLoader.loadClass() supposed to work on module-info classes?

2015-12-07 Thread Paul Sandoz
> On 5 Dec 2015, at 00:09, Alex Buckley wrote: > > On 12/4/2015 11:58 AM, Peter Levart wrote: >> I know about those options. What I was wanting to know is whether the >> class file format will change and for what features. > > It's possible that VarHandles will justify

Re: is ClassLoader.loadClass() supposed to work on module-info classes?

2015-12-05 Thread Ali Ebrahimi
Hi, On Sat, Dec 5, 2015 at 1:39 PM, Alan Bateman wrote: > > > On 05/12/2015 07:00, Ali Ebrahimi wrote: > >> : >> >> module FOO.aop{ >> implements FOO.api; >> } >> >> In other word, consumer module doesn't know any think about implementing >> module since here we

Re: is ClassLoader.loadClass() supposed to work on module-info classes?

2015-12-05 Thread Alan Bateman
On 05/12/2015 07:00, Ali Ebrahimi wrote: : module FOO.aop{ implements FOO.api; } In other word, consumer module doesn't know any think about implementing module since here we have contract and that is API module. think of today's interface. In the distant past, this was known here as

Re: Re: is ClassLoader.loadClass() supposed to work on module-info classes?

2015-12-04 Thread Cédric Champeau
; > Gesendet: Donnerstag, 03. Dezember 2015 um 21:42 Uhr > > Von: "Paul Benedict" <pbened...@apache.org> > > An: "Alex Buckley" <alex.buck...@oracle.com> > > Cc: jigsaw-dev@openjdk.java.net > > Betreff: Re: is ClassLoader.loadClass() supp

Aw: Re: is ClassLoader.loadClass() supposed to work on module-info classes?

2015-12-04 Thread Jochen Theodorou
det: Donnerstag, 03. Dezember 2015 um 21:42 Uhr > Von: "Paul Benedict" <pbened...@apache.org> > An: "Alex Buckley" <alex.buck...@oracle.com> > Cc: jigsaw-dev@openjdk.java.net > Betreff: Re: is ClassLoader.loadClass() supposed to work on module-info > classes

Re: is ClassLoader.loadClass() supposed to work on module-info classes?

2015-12-04 Thread Alan Bateman
On 04/12/2015 08:22, Cédric Champeau wrote: Obviously compiling a single JDK 9 module-info file seems pretty cheap, but if you think about the fact that you will want to have a JDK 8 installed to compile your classes, plus a JDK 9 Jigsaw installed to compile the descriptor, and then add that

Re: is ClassLoader.loadClass() supposed to work on module-info classes?

2015-12-04 Thread Ali Ebrahimi
Hi, On Fri, Dec 4, 2015 at 4:33 AM, Alex Buckley wrote: > On 12/3/2015 4:47 AM, David M. Lloyd wrote: > > If you're splitting or merging modules -- especially someone else's! -- > then you need to let the compiler check that the newly factored modules are > well-formed:

Re: is ClassLoader.loadClass() supposed to work on module-info classes?

2015-12-04 Thread Ali Ebrahimi
Hi, On Fri, Dec 4, 2015 at 2:06 AM, Alex Buckley wrote: > When the author of B decided to shade A, it became B's responsibility to > configure the readability needed by A's reflective code. > In other word, after shading we don't have module A in play but one big module

Re: is ClassLoader.loadClass() supposed to work on module-info classes?

2015-12-04 Thread David M. Lloyd
On 12/04/2015 09:18 AM, Alan Bateman wrote: On 04/12/2015 12:59, David M. Lloyd wrote: So you're saying that if I have C depending on A, then update A or I split A and B in my distribution, I need to recompile C? I don't think that's a realistic proposition. Do I then have to recompile

Re: is ClassLoader.loadClass() supposed to work on module-info classes?

2015-12-04 Thread Alan Bateman
On 04/12/2015 12:59, David M. Lloyd wrote: So you're saying that if I have C depending on A, then update A or I split A and B in my distribution, I need to recompile C? I don't think that's a realistic proposition. Do I then have to recompile things that depend on C? Or things that

Re: is ClassLoader.loadClass() supposed to work on module-info classes?

2015-12-04 Thread Peter Levart
On 12/04/2015 09:41 AM, Alan Bateman wrote: On 04/12/2015 08:22, Cédric Champeau wrote: Obviously compiling a single JDK 9 module-info file seems pretty cheap, but if you think about the fact that you will want to have a JDK 8 installed to compile your classes, plus a JDK 9 Jigsaw

Re: is ClassLoader.loadClass() supposed to work on module-info classes?

2015-12-04 Thread David M. Lloyd
On 12/04/2015 08:18 AM, Cédric Champeau wrote: Just a related question: Do you expect the class file format to change in JDK9 and for what features? If it is only for supporting the module-info.class then would something like the following be possible: javac -source 9 -target 8 -mp modlib

Re: is ClassLoader.loadClass() supposed to work on module-info classes?

2015-12-04 Thread Jonathan Gibbons
On 12/04/2015 06:33 AM, Stephane Epardaud wrote: On 04/12/2015 15:21, David M. Lloyd wrote: IIRC there is *already* within Java 9 an option to compile against previous JDK ABIs (which are bundled with JDK 9), isn't there? Ah that's interesting, I got hit by calls to byteBuffer(int) which

Re: is ClassLoader.loadClass() supposed to work on module-info classes?

2015-12-04 Thread Stephane Epardaud
On 04/12/2015 15:21, David M. Lloyd wrote: IIRC there is *already* within Java 9 an option to compile against previous JDK ABIs (which are bundled with JDK 9), isn't there? Ah that's interesting, I got hit by calls to byteBuffer(int) which compiled in JDK9 to ByteBuffer.position(int) which

Re: is ClassLoader.loadClass() supposed to work on module-info classes?

2015-12-04 Thread David M. Lloyd
On 12/03/2015 07:03 PM, Alex Buckley wrote: On 12/3/2015 4:47 AM, David M. Lloyd wrote: On 12/02/2015 04:49 PM, Alex Buckley wrote: Now we reach the disagreement. We don't think the module declaration will be as fluid as you do. Yes, frameworks and other tools will want to modify module

Re: is ClassLoader.loadClass() supposed to work on module-info classes?

2015-12-04 Thread Alan Bateman
On 04/12/2015 15:52, David M. Lloyd wrote: Ah, yeah specifically I'm referring to splitting/merging or upgrading some given module in an existing system, possibly using aggregate modules for compatibility or alternatively updating the module descriptors of existing installed modules to

Re: is ClassLoader.loadClass() supposed to work on module-info classes?

2015-12-04 Thread Peter Levart
On 12/04/2015 03:37 PM, Jonathan Gibbons wrote: On 12/04/2015 06:33 AM, Stephane Epardaud wrote: On 04/12/2015 15:21, David M. Lloyd wrote: IIRC there is *already* within Java 9 an option to compile against previous JDK ABIs (which are bundled with JDK 9), isn't there? Ah that's

Re: is ClassLoader.loadClass() supposed to work on module-info classes?

2015-12-04 Thread Remi Forax
- Mail original - > De: "Alex Buckley" <alex.buck...@oracle.com> > À: jigsaw-dev@openjdk.java.net > Envoyé: Samedi 5 Décembre 2015 00:09:16 > Objet: Re: is ClassLoader.loadClass() supposed to work on module-info classes? > > On 12/4/2015 11:58 AM, Pe

Re: is ClassLoader.loadClass() supposed to work on module-info classes?

2015-12-04 Thread Ali Ebrahimi
Hi, On Sat, Dec 5, 2015 at 3:42 AM, Alex Buckley wrote: > On 12/4/2015 7:52 AM, David M. Lloyd wrote: > >> >> Yes, the tool is a Java compiler, piggybacking on the fact that a > compiler already needs to figure out an observable universe of types to > compile the source

Re: is ClassLoader.loadClass() supposed to work on module-info classes?

2015-12-03 Thread Rafael Winterhalter
As I understand it, this is not sufficient. Assuming A is a serialization library: If the object of C contains an instance encapsulated by D, then B would need to make sure that it can read C and D before handing the instance to A. For this it would of course be necessary to understand the inner

Re: is ClassLoader.loadClass() supposed to work on module-info classes?

2015-12-03 Thread Alan Bateman
On 03/12/2015 19:43, Rafael Winterhalter wrote: But then library B needs to find all modules potentially involved. With the classical example of a serialization library that traverses a full object graph, this would require B to do the same for anytime an object is handed to the shaded

Re: is ClassLoader.loadClass() supposed to work on module-info classes?

2015-12-03 Thread Alex Buckley
Yes, A's reflective access to C's classes will fail, due to the action of B's author in grabbing and shading A. Module B is responsible for configuring its (B's) readability to the module containing C's classes (be that a named module if C has been modularized, or the unnamed module if C is

Re: is ClassLoader.loadClass() supposed to work on module-info classes?

2015-12-03 Thread Alan Bateman
On 03/12/2015 18:30, Rafael Winterhalter wrote: As a follow-up question. What if I need to import a library into my namespace and therewith module? ("shaded dependencies") This is a quite common practice to avoid version conflicts. Would for example the reflection semantics for these classes

Re: is ClassLoader.loadClass() supposed to work on module-info classes?

2015-12-03 Thread Rafael Winterhalter
Sorry, I realize that I was not precise. Assuming that pre-module library A is shaded by modularized library B. User code C is then using library B. Internally, library B passes objects to library A that is using reflection on C without being aware of the module boundary. Would this now fail as

Re: is ClassLoader.loadClass() supposed to work on module-info classes?

2015-12-03 Thread Alex Buckley
On 12/3/2015 10:04 AM, Peter Levart wrote: Loosely related to this debate, I would like to ask what's the story with modular jars that can run on JDK8 classpath and as modules on JDK9. How is one supposed to create such jar file as it must have: - classes compiled with JDK8 javac (or JDK9 javac

Re: is ClassLoader.loadClass() supposed to work on module-info classes?

2015-12-03 Thread Rafael Winterhalter
But then library B needs to find all modules potentially involved. With the classical example of a serialization library that traverses a full object graph, this would require B to do the same for anytime an object is handed to the shaded dependency. To me that appears impractical. Am 03.12.2015

Re: is ClassLoader.loadClass() supposed to work on module-info classes?

2015-12-03 Thread Alex Buckley
On 12/3/2015 2:04 PM, Peter Levart wrote: On 12/03/2015 08:46 PM, Alex Buckley wrote: On 12/3/2015 10:04 AM, Peter Levart wrote: Loosely related to this debate, I would like to ask what's the story with modular jars that can run on JDK8 classpath and as modules on JDK9. How is one supposed to

Re: is ClassLoader.loadClass() supposed to work on module-info classes?

2015-12-03 Thread Alex Buckley
When the author of B decided to shade A, it became B's responsibility to configure the readability needed by A's reflective code. "But B doesn't know anything about how A works. The shading was only to use a different version of A than was observable on the modulepath." OK, then shading A

Re: is ClassLoader.loadClass() supposed to work on module-info classes?

2015-12-03 Thread Rafael Winterhalter
Given that B, a public library that is not aware of C (and does therefore not read C) wants to access that module's class via reflection, it needs to add a read edge to C as discussed. If an object of C references an object of D that is returned by reflection on objects of C, the same holds for

Re: is ClassLoader.loadClass() supposed to work on module-info classes?

2015-12-03 Thread Alex Buckley
"needs to find all modules potentially involved" ? Module B needs to configure readability to solely the module containing the class that A's code (well, the code-that-used-to-be-A-but-is-now-part-of-B) wishes to access reflectively. Here it is: objFromC.getClass().getModule(). Alex On

Re: is ClassLoader.loadClass() supposed to work on module-info classes?

2015-12-03 Thread Alex Buckley
You've presented a new fact about A. Yes, if A is going to dereference the object graph starting from the object created by C's code (presumably as an instance of one of C's classes) and passed to B's code, then B would need to read all the modules containing the classes of objects in the

Re: is ClassLoader.loadClass() supposed to work on module-info classes?

2015-12-03 Thread Paul Benedict
On Thu, Dec 3, 2015 at 1:46 PM, Alex Buckley wrote: > I expect you will say, "Encode exports somewhere other than the module > declaration, such as with @Exported annotations on types or packages." To > which I repeat: "if we're going to introduce the concept of a >

Re: is ClassLoader.loadClass() supposed to work on module-info classes?

2015-12-03 Thread Alan Bateman
On 03/12/2015 19:58, Rafael Winterhalter wrote: : Assuming A is a serialization library: If the object of C contains an instance encapsulated by D, then B would need to make sure that it can read C and D before handing the instance to A. For this it would of course be necessary to understand

Re: is ClassLoader.loadClass() supposed to work on module-info classes?

2015-12-03 Thread Alex Buckley
On 12/3/2015 4:47 AM, David M. Lloyd wrote: On 12/02/2015 04:49 PM, Alex Buckley wrote: Now we reach the disagreement. We don't think the module declaration will be as fluid as you do. Yes, frameworks and other tools will want to modify module declarations (usually by addition of dependencies

Re: is ClassLoader.loadClass() supposed to work on module-info classes?

2015-12-02 Thread David M. Lloyd
On 12/02/2015 08:46 AM, Remi Forax wrote: - Mail original - De: "Alan Bateman" <alan.bate...@oracle.com> À: "Stephane Epardaud" <s...@epardaud.fr>, jigsaw-dev@openjdk.java.net Envoyé: Mercredi 2 Décembre 2015 14:56:00 Objet: Re: is ClassLoader.loadClass()

Re: is ClassLoader.loadClass() supposed to work on module-info classes?

2015-12-02 Thread Jeff MAURY
De: "David M. Lloyd" <david.ll...@redhat.com> >>> À: jigsaw-dev@openjdk.java.net >>> Envoyé: Mercredi 2 Décembre 2015 15:52:56 >>> Objet: Re: is ClassLoader.loadClass() supposed to work on module-info >>> classes? >>> >>> On

Re: is ClassLoader.loadClass() supposed to work on module-info classes?

2015-12-02 Thread Paul Benedict
-- > > De: "Alan Bateman" <alan.bate...@oracle.com> > > À: "Stephane Epardaud" <s...@epardaud.fr>, jigsaw-dev@openjdk.java.net > > Envoyé: Mercredi 2 Décembre 2015 14:56:00 > > Objet: Re: is ClassLoader.loadClass() supposed to work on module-inf

Re: is ClassLoader.loadClass() supposed to work on module-info classes?

2015-12-02 Thread Stephane Epardaud
On 02/12/15 14:56, Alan Bateman wrote: > The this_class should be /module-info but in any case, The funny thing is that this module-info.class was created by the Java 9+Jigsaw EA "stock" javac. How it got the ".Test" class mixed up in there is not clear to me. Perhaps as a result of me

Re: is ClassLoader.loadClass() supposed to work on module-info classes?

2015-12-02 Thread David M. Lloyd
On 12/02/2015 09:05 AM, Remi Forax wrote: - Mail original - De: "David M. Lloyd" <david.ll...@redhat.com> À: jigsaw-dev@openjdk.java.net Envoyé: Mercredi 2 Décembre 2015 15:52:56 Objet: Re: is ClassLoader.loadClass() supposed to work on module-info classes? On 12/

Re: is ClassLoader.loadClass() supposed to work on module-info classes?

2015-12-02 Thread Alan Bateman
On 02/12/2015 14:35, Stephane Epardaud wrote: On 02/12/15 14:56, Alan Bateman wrote: The this_class should be /module-info but in any case, The funny thing is that this module-info.class was created by the Java 9+Jigsaw EA "stock" javac. How it got the ".Test" class mixed up in there is not

Re: is ClassLoader.loadClass() supposed to work on module-info classes?

2015-12-02 Thread Stefan Fuchs
...@apache.org] Sent: Wednesday, December 02, 2015 9:53 AM To: Remi Forax Cc: jigsaw-dev@openjdk.java.net Subject: Re: is ClassLoader.loadClass() supposed to work on module-info classes? This is probably a good time to (once again) bring up the objection that the Module Descriptor shouldn't be a class

Re: is ClassLoader.loadClass() supposed to work on module-info classes?

2015-12-02 Thread Alex Buckley
On 12/2/2015 8:31 AM, Paul Benedict wrote: All that information is locked in binary format but it should be human readable. I should be able to go in myself and do this with a text editor. I shouldn't have to compile a file anymore than I have to compile my MANIFEST.MF or web.xml or

Re: is ClassLoader.loadClass() supposed to work on module-info classes?

2015-12-02 Thread Paul Benedict
Alex, the primary benefit of annotations (vs. XML) is delivering code and configuration in one bundle. It's unnecessary to deliver configuration separately (i.e., XML) if you have a component that primarily has one way of being configured. That's exactly why annotations are very valuable in EE

is ClassLoader.loadClass() supposed to work on module-info classes?

2015-12-02 Thread Stephane Epardaud
Just tried it and got: Exception in thread "main" java.lang.ClassFormatError: Illegal class name "com.ceylon.java9.Test" in class file module-info at java.lang.ClassLoader.defineClass1(java.base@9.0/Native Method) at java.lang.ClassLoader.defineClass(java.base@9.0/ClassLoader.java:854)

Re: is ClassLoader.loadClass() supposed to work on module-info classes?

2015-12-02 Thread Alan Bateman
On 02/12/2015 11:01, Stephane Epardaud wrote: Just tried it and got: Exception in thread "main" java.lang.ClassFormatError: Illegal class name "com.ceylon.java9.Test" in class file module-info at java.lang.ClassLoader.defineClass1(java.base@9.0/Native Method) at