From ooo_saturn7 at mail.ru Fri Dec 1 08:31:11 2023 From: ooo_saturn7 at mail.ru (=?UTF-8?B?QWxleCBPcmxvdg==?=) Date: Fri, 01 Dec 2023 11:31:11 +0300 Subject: =?UTF-8?B?SlBNUyBwcm92aWRlcnMgbmFtaW5nIGNvbnZlbnRpb24=?= Message-ID: <1701419471.490454337@f211.i.mail.ru> Hi all, ? Lets suppose that I have FooService interface and I want to make JPMS provider for it (provides FooService with ...). Could anyone say ow?I should name my provider: FooServiceProvider or FooProvider? ? -- Best regards, Alex Orlov -------------- next part -------------- An HTML attachment was scrubbed... URL: From alex.buckley at oracle.com Fri Dec 1 19:50:38 2023 From: alex.buckley at oracle.com (Alex Buckley) Date: Fri, 1 Dec 2023 11:50:38 -0800 Subject: JPMS providers naming convention In-Reply-To: <1701419471.490454337@f211.i.mail.ru> References: <1701419471.490454337@f211.i.mail.ru> Message-ID: Foo for the service, FooProvider for the service provider. I don't see why clients should have to spell out FooService rather than Foo in the many places where they refer to (the type of) the service. As for implementations of the Foo service, the javadoc for ServiceLoader says: "A _service provider_ (or just _provider_) is a class that ..." -- suggesting that FooProvider is just as good as FooServiceProvider. Even better is to avoid "Provider" altogether. Use which ever name best describes this particular implementation of Foo, and don't distort the names just because objects will be created via `ServiceLoader` rather than via `new`. Note that the example in the javadoc doesn't use "Service" or "Provider" in any names. Alex On 12/1/2023 12:31 AM, Alex Orlov wrote: > Hi all, > Lets suppose that I have FooService interface and I want to make JPMS > provider for it (provides FooService with ...). Could anyone say ow?I > should name my provider: FooServiceProvider or FooProvider? > -- > Best regards, Alex Orlov From zjx001202 at gmail.com Wed Dec 6 19:04:25 2023 From: zjx001202 at gmail.com (Glavo) Date: Thu, 7 Dec 2023 03:04:25 +0800 Subject: A new JPMS-friendly Java program packaging format Message-ID: Hey everyone, Recently, I have been busy developing a new JPMS-friendly Java program packaging format: JApp (https://github.com/Glavo/japp). JApp is intended as a better alternative to shadow jar (fat jar). Users need to specify the module path and classpath when creating a JApp file. Resources in all module path/classpath entries (JAR or directory) are packaged into a single japp file, but unlike shadow jars, japp isolates resources from different module path/classpath entries. For example, we can create a japp file with the following command: japp create -o myapp.japp \ --module-path commons-lang3-3.14.0.jar:commons-io-2.15.1.jar \ --classpath guava-32.1.3-jre.jar:gson-2.10.1.jar This will create a japp file named `myjapp.japp` that contains resources from four jar files. At runtime, the URIs for the resources from the four JAR files each look like this: japp:/modules/org.apache.commons.lang3/org/apache/commons/lang3/ObjectUtils.class japp:/modules/org.apache.commons.io/org/apache/commons/io/IOUtils.class japp:/classpath/guava-32.1.3-jre.jar/com/google/common/collect/Multimap.class japp:/classpath/gson-2.10.1.jar/com/google/gson/Gson.class At runtime, each entry in the module path and classpath is independent, just like passing the `--classpath`/`--module-path` option directly to the `java` command. By sharing the class constant pool, using zstd as the compression method, and compressing the file metadata, japp files are generally smaller than shadow jars. JApp files also support specifying some conditions, such as requirements for the Java version. JApp selects the Java runtime to use to run the program based on these conditions. Here is its GitHub repository, for more features and detailed instructions please refer to the README: https://github.com/Glavo/japp Now that the basic features of JApp are complete, I'm sharing it here in the hope that more people will try it and give feedback. Thank you to everyone who is willing to read this email! Glavo -------------- next part -------------- An HTML attachment was scrubbed... URL: From zjx001202 at gmail.com Wed Dec 6 19:12:55 2023 From: zjx001202 at gmail.com (Glavo) Date: Thu, 7 Dec 2023 03:12:55 +0800 Subject: A new JPMS-friendly Java program packaging format In-Reply-To: References: Message-ID: Sorry, there were some formatting errors during pasting, please excuse me. Glavo On Thu, Dec 7, 2023 at 3:04?AM Glavo wrote: > Hey everyone, > > Recently, I have been busy developing a new JPMS-friendly Java program > packaging format: JApp (https://github.com/Glavo/japp). > > JApp is intended as a better alternative to shadow jar (fat jar). > Users need to specify the module path and classpath when creating a JApp > file. > Resources in all module path/classpath entries (JAR or directory) are > packaged into a single japp file, > but unlike shadow jars, japp isolates resources from different module > path/classpath entries. > > For example, we can create a japp file with the following command: > > japp create -o myapp.japp \ > --module-path commons-lang3-3.14.0.jar:commons-io-2.15.1.jar \ > --classpath guava-32.1.3-jre.jar:gson-2.10.1.jar > > > This will create a japp file named `myjapp.japp` that contains resources > from four jar files. > At runtime, the URIs for the resources from the four JAR files each look > like this: > > > japp:/modules/org.apache.commons.lang3/org/apache/commons/lang3/ObjectUtils.class > japp:/modules/org.apache.commons.io/org/apache/commons/io/IOUtils.class > > japp:/classpath/guava-32.1.3-jre.jar/com/google/common/collect/Multimap.class > japp:/classpath/gson-2.10.1.jar/com/google/gson/Gson.class > At runtime, each entry in the module path and classpath is independent, > just like passing the `--classpath`/`--module-path` option directly to the > `java` command. > > By sharing the class constant pool, using zstd as the compression method, > and > compressing the file metadata, japp files are generally smaller than > shadow jars. > > JApp files also support specifying some conditions, such as requirements > for the Java version. > JApp selects the Java runtime to use to run the program based on these > conditions. > > Here is its GitHub repository, for more features and detailed instructions > please refer to the README: > > https://github.com/Glavo/japp > > Now that the basic features of JApp are complete, I'm sharing it here in > the hope > that more people will try it and give feedback. > > Thank you to everyone who is willing to read this email! > > Glavo > -------------- next part -------------- An HTML attachment was scrubbed... URL: From zjx001202 at gmail.com Thu Dec 7 08:10:11 2023 From: zjx001202 at gmail.com (Glavo) Date: Thu, 7 Dec 2023 16:10:11 +0800 Subject: A new JPMS-friendly Java program packaging format In-Reply-To: References: Message-ID: > Please provide a way to exclude files or packages from a particular Jar. For example, I may not want Multimap.class in the Guava Jar. This feature is very useful. I'll put this on my TODO list. > Is this compatible with Proguard's and Graal VM's to trim fat Jars? Both of these will eliminate unused classes, methods, and fields to reduce the size of the fat Jar. I have some interest in Proguard and will look into it at a later date. As for GraalVM, I have no plans to support it yet. I think japp and native-image are parallel. If users need it, they should probably build native-image directly through the build script instead of creating a japp file first and then build native-image based on the japp file. Moreover, I don?t seem to be able to provide support for native-image in a non-intrusive way, I can only modify the source code of GraalVM itself. Therefore, I won't consider it for now. Glavo On Thu, Dec 7, 2023 at 7:29?AM Nathan Reynolds wrote: > Please provide a way to exclude files or packages from a particular Jar. > For example, I may not want Multimap.class in the Guava Jar. > > Is this compatible with Proguard's and Graal VM's to trim fat Jars? Both > of these will eliminate unused classes, methods, and fields to reduce the > size of the fat Jar. > > On Wed, Dec 6, 2023 at 3:17?PM Glavo wrote: > >> Hey everyone, >> >> Recently, I have been busy developing a new JPMS-friendly Java program >> packaging format: JApp (https://github.com/Glavo/japp). >> >> JApp is intended as a better alternative to shadow jar (fat jar). >> Users need to specify the module path and classpath when creating a JApp >> file. >> Resources in all module path/classpath entries (JAR or directory) are >> packaged into a single japp file, >> but unlike shadow jars, japp isolates resources from different module >> path/classpath entries. >> >> For example, we can create a japp file with the following command: >> >> japp create -o myapp.japp \ >> --module-path commons-lang3-3.14.0.jar:commons-io-2.15.1.jar \ >> --classpath guava-32.1.3-jre.jar:gson-2.10.1.jar >> >> >> This will create a japp file named `myjapp.japp` that contains resources >> from four jar files. >> At runtime, the URIs for the resources from the four JAR files each look >> like this: >> >> >> japp:/modules/org.apache.commons.lang3/org/apache/commons/lang3/ObjectUtils.class >> japp:/modules/org.apache.commons.io/org/apache/commons/io/IOUtils.class >> >> japp:/classpath/guava-32.1.3-jre.jar/com/google/common/collect/Multimap.class >> japp:/classpath/gson-2.10.1.jar/com/google/gson/Gson.class >> At runtime, each entry in the module path and classpath is independent, >> just like passing the `--classpath`/`--module-path` option directly to >> the `java` command. >> >> By sharing the class constant pool, using zstd as the compression method, >> and >> compressing the file metadata, japp files are generally smaller than >> shadow jars. >> >> JApp files also support specifying some conditions, such as requirements >> for the Java version. >> JApp selects the Java runtime to use to run the program based on these >> conditions. >> >> Here is its GitHub repository, for more features and detailed >> instructions please refer to the README: >> >> https://github.com/Glavo/japp >> >> Now that the basic features of JApp are complete, I'm sharing it here in >> the hope >> that more people will try it and give feedback. >> >> Thank you to everyone who is willing to read this email! >> >> Glavo >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From pavelturk2000 at gmail.com Thu Dec 14 10:56:17 2023 From: pavelturk2000 at gmail.com (PavelTurk) Date: Thu, 14 Dec 2023 12:56:17 +0200 Subject: How many times one module can exist in layer graph Message-ID: Hello?all. Let's?suppose?that?we?have?4?layers: 1)?boot 2)?layerA?(parent?-?boot) 3)?layerB?(parent-boot) 4)?layerC?(parents?-?layerA,?layerB) Layers?A,B,C?were?created?using?defineModulesWithOneLoader?(...). And?we?have?two?modules?-?moduleX?and?moduleY.?ModuleX?uses?moduleY. ModuleX?is?located?in?layerC. Do?I?understand?correctly?that?moduleY?can?be?located?in?any?layer,?but?only in?ONE?layer??I?mean,?that?it?is?impossible?to?place?moduleY?in?any?TWO?layers at?the?same?time?-?for?example?in?boot?layer?and?layerB. I am asking this because I read that it was possible but I tried all variants and always got ResolutionException: Module ModuleX reads more than one module named ModuleY. Best?regards,?Pavel From Alan.Bateman at oracle.com Thu Dec 14 13:07:05 2023 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Thu, 14 Dec 2023 13:07:05 +0000 Subject: How many times one module can exist in layer graph In-Reply-To: References: Message-ID: <64d9be2a-ec37-4356-ae1f-56b43c885e22@oracle.com> On 14/12/2023 10:56, PavelTurk wrote: > Hello?all. > > Let's?suppose?that?we?have?4?layers: > 1)?boot > 2)?layerA?(parent?-?boot) > 3)?layerB?(parent-boot) > 4)?layerC?(parents?-?layerA,?layerB) > > Layers?A,B,C?were?created?using?defineModulesWithOneLoader?(...). > > And?we?have?two?modules?-?moduleX?and?moduleY.?ModuleX?uses?moduleY. > ModuleX?is?located?in?layerC. > > Do?I?understand?correctly?that?moduleY?can?be?located?in?any?layer,?but?only > > in?ONE?layer??I?mean,?that?it?is?impossible?to?place?moduleY?in?any?TWO?layers > > at?the?same?time?-?for?example?in?boot?layer?and?layerB. > > I am asking this because I read that it was possible but I tried all > variants and > always got ResolutionException: Module ModuleX reads more than one > module named > ModuleY. It's possible to have a module "X" n several module layers at the same time. It's hard to diagnose things from the info in your mail. Can you print the Configuration object for layer A, B and C and paste it into a reply? There may be implied readability in the picture, or it may be related to using a multi-parent Configuration, I can't tell. Also when you say X uses Y then I assume you don't mean services, instead you mean X requires Y, is that right? -Alan From pavelturk2000 at gmail.com Thu Dec 14 15:39:41 2023 From: pavelturk2000 at gmail.com (PavelTurk) Date: Thu, 14 Dec 2023 17:39:41 +0200 Subject: How many times one module can exist in layer graph In-Reply-To: <64d9be2a-ec37-4356-ae1f-56b43c885e22@oracle.com> References: <64d9be2a-ec37-4356-ae1f-56b43c885e22@oracle.com> Message-ID: Hello, Alan Thank you very much for your answer. I could reproduce this problem. Please, see https://github.com/PavelTurk/jpms-test1 There is a detailed readme and only one class that throws ResolutionException. Best regards, Pavel On 12/14/23 3:07 PM, Alan Bateman wrote: > On 14/12/2023 10:56, PavelTurk wrote: >> Hello?all. >> >> Let's?suppose?that?we?have?4?layers: >> 1)?boot >> 2)?layerA?(parent?-?boot) >> 3)?layerB?(parent-boot) >> 4)?layerC?(parents?-?layerA,?layerB) >> >> Layers?A,B,C?were?created?using?defineModulesWithOneLoader?(...). >> >> And?we?have?two?modules?-?moduleX?and?moduleY.?ModuleX?uses?moduleY. >> ModuleX?is?located?in?layerC. >> >> Do?I?understand?correctly?that?moduleY?can?be?located?in?any?layer,?but?only >> in?ONE?layer??I?mean,?that?it?is?impossible?to?place?moduleY?in?any?TWO?layers >> at?the?same?time?-?for?example?in?boot?layer?and?layerB. >> >> I am asking this because I read that it was possible but I tried all variants and >> always got ResolutionException: Module ModuleX reads more than one module named >> ModuleY. > > It's possible to have a module "X" n several module layers at the same time. > > It's hard to diagnose things from the info in your mail. Can you print the Configuration object for layer A, B and C and paste it into a reply? There may be implied readability in the picture, or it may be related to using a multi-parent Configuration, I can't tell. Also when you say X uses Y then I assume you don't mean services, instead you mean X requires Y, is that right? > > -Alan From anandebeh at gmail.com Thu Dec 14 23:58:18 2023 From: anandebeh at gmail.com (Anand Beh) Date: Thu, 14 Dec 2023 18:58:18 -0500 Subject: How many times one module can exist in layer graph In-Reply-To: References: <64d9be2a-ec37-4356-ae1f-56b43c885e22@oracle.com> Message-ID: Hi Pavel, It seems to be the issue that you're loading the Gson jar twice -- once in layer A and once in layer B. The problem is analogous to loading the same jar file in different ClassLoaders (in fact, that's what is happening behind the scenes). You'll get different Class instances, which quickly turns into a debugging nightmare, a hellish classloading situation which was one of the original motivations for JPMS. If, by saying "moduleY can only be located in ONE layer," you mean that moduleY must only be *loaded* by one layer, then yes, I would say that you are correct. However, in terms of usability, and this is what Alan seems to be getting at, you can indeed have Gson be visible to multiple layers at the same time. Hope this helps. Anand On Thu, Dec 14, 2023 at 11:55?AM PavelTurk wrote: > Hello, Alan > > Thank you very much for your answer. I could reproduce this problem. > Please, see https://github.com/PavelTurk/jpms-test1 > There is a detailed readme and only one class that throws > ResolutionException. > > Best regards, Pavel > > On 12/14/23 3:07 PM, Alan Bateman wrote: > > On 14/12/2023 10:56, PavelTurk wrote: > >> Hello all. > >> > >> Let's suppose that we have 4 layers: > >> 1) boot > >> 2) layerA (parent - boot) > >> 3) layerB (parent-boot) > >> 4) layerC (parents - layerA, layerB) > >> > >> Layers A,B,C were created using defineModulesWithOneLoader?(...). > >> > >> And we have two modules - moduleX and moduleY. ModuleX uses moduleY. > >> ModuleX is located in layerC. > >> > >> > Do I understand correctly that moduleY can be located in any layer, but only > >> > in ONE layer? I mean, that it is impossible to place moduleY in any TWO layers > >> at the same time - for example in boot layer and layerB. > >> > >> I am asking this because I read that it was possible but I tried all > variants and > >> always got ResolutionException: Module ModuleX reads more than one > module named > >> ModuleY. > > > > It's possible to have a module "X" n several module layers at the same > time. > > > > It's hard to diagnose things from the info in your mail. Can you print > the Configuration object for layer A, B and C and paste it into a reply? > There may be implied readability in the picture, or it may be related to > using a multi-parent Configuration, I can't tell. Also when you say X uses > Y then I assume you don't mean services, instead you mean X requires Y, is > that right? > > > > -Alan > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From alex.buckley at oracle.com Fri Dec 15 01:26:37 2023 From: alex.buckley at oracle.com (Alex Buckley) Date: Thu, 14 Dec 2023 17:26:37 -0800 Subject: How many times one module can exist in layer graph In-Reply-To: References: <64d9be2a-ec37-4356-ae1f-56b43c885e22@oracle.com> Message-ID: Since layer A and layer B each have their own class loader, there is no problem with each layer loading the same module. Unfortunately, Guava is still not an explicit module (https://github.com/google/guava/issues/2970). It is an automatic module. This means it gets a "boost" in terms of the modules that it reads. In fact, we think the implementation of module resolution is giving it _too much_ of a boost, because Guava in layer B ends up reading both Gson in layer B and Gson in layer A. Alan is investigating. FWIW, Gson is an explicit module (https://github.com/google/gson/blob/main/gson/src/main/java/module-info.java). This is great for developers, and also saves this layer A+B scenario from being even more complicated. Alex On 12/14/2023 3:58 PM, Anand Beh wrote: > Hi Pavel, > > It seems to be the issue that you're loading the Gson jar twice -- once > in layer A and once in layer B. The problem is analogous to loading the > same jar file in different ClassLoaders (in fact, that's what is > happening behind the scenes). You'll get different Class instances, > which quickly turns into a debugging nightmare, a hellish classloading > situation which was one of the original motivations for JPMS. > > If, by saying "moduleY can only be located in ONE layer," you mean that > moduleY must only be /loaded/?by one layer, then yes, I would say that > you are correct. However, in terms of usability, and this is what Alan > seems to be getting at, you can indeed have Gson be visible to multiple > layers at the same time. > > Hope this helps. > > Anand > > On Thu, Dec 14, 2023 at 11:55?AM PavelTurk > wrote: > > Hello, Alan > > Thank you very much for your answer. I could reproduce this problem. > Please, see https://github.com/PavelTurk/jpms-test1 > > There is a detailed readme and only one class that throws > ResolutionException. > > Best regards, Pavel > > On 12/14/23 3:07 PM, Alan Bateman wrote: > > On 14/12/2023 10:56, PavelTurk wrote: > >> Hello?all. > >> > >> Let's?suppose?that?we?have?4?layers: > >> 1)?boot > >> 2)?layerA?(parent?-?boot) > >> 3)?layerB?(parent-boot) > >> 4)?layerC?(parents?-?layerA,?layerB) > >> > >> Layers?A,B,C?were?created?using?defineModulesWithOneLoader?(...). > >> > >> And?we?have?two?modules?-?moduleX?and?moduleY.?ModuleX?uses?moduleY. > >> ModuleX?is?located?in?layerC. > >> > >> > Do?I?understand?correctly?that?moduleY?can?be?located?in?any?layer,?but?only > >> > in?ONE?layer??I?mean,?that?it?is?impossible?to?place?moduleY?in?any?TWO?layers > >> at?the?same?time?-?for?example?in?boot?layer?and?layerB. > >> > >> I am asking this because I read that it was possible but I tried > all variants and > >> always got ResolutionException: Module ModuleX reads more than > one module named > >> ModuleY. > > > > It's possible to have a module "X" n several module layers at the > same time. > > > > It's hard to diagnose things from the info in your mail. Can you > print the Configuration object for layer A, B and C and paste it > into a reply? There may be implied readability in the picture, or it > may be related to using a multi-parent Configuration, I can't tell. > Also when you say X uses Y then I assume you don't mean services, > instead you mean X requires Y, is that right? > > > > -Alan > From pavelturk2000 at gmail.com Fri Dec 15 21:47:06 2023 From: pavelturk2000 at gmail.com (PavelTurk) Date: Fri, 15 Dec 2023 23:47:06 +0200 Subject: How to find out what module provides concrete class? Message-ID: <799b9ac9-c3b5-0728-6c69-6e8dc5d247d2@gmail.com> Hello all. Please, consider the following code: ClassLoader cl = .... String className = "com.foo.Bar"; Module module = ??? So, we have class name in a String and it is necessary to get reference to module that has this class. The question - is it possible to find out: 1) without loading the class - Module module = cl.loadClass(className).getModule(); 2) without reading content of every module ModuleReference reference = ... reference.open().list().... I mean, is there any ready solution that I can use to find module by class name and without loading class? Best regards, Pavel From zjx001202 at gmail.com Sat Dec 16 06:53:33 2023 From: zjx001202 at gmail.com (Glavo) Date: Sat, 16 Dec 2023 14:53:33 +0800 Subject: How to find out what module provides concrete class? In-Reply-To: <799b9ac9-c3b5-0728-6c69-6e8dc5d247d2@gmail.com> References: <799b9ac9-c3b5-0728-6c69-6e8dc5d247d2@gmail.com> Message-ID: I guess you could get the package name from the class name and then iterate through the modules in the ModuleLayer to find which module the package is in. Glavo On Sat, Dec 16, 2023 at 5:47?AM PavelTurk wrote: > Hello all. > > Please, consider the following code: > > ClassLoader cl = .... > String className = "com.foo.Bar"; > Module module = ??? > > So, we have class name in a String and it is necessary to get reference to > module > that has this class. The question - is it possible to find out: > 1) without loading the class - > Module module = cl.loadClass(className).getModule(); > 2) without reading content of every module > ModuleReference reference = ... > reference.open().list().... > > I mean, is there any ready solution that I can use to find module by class > name and without loading class? > > Best regards, Pavel > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Alan.Bateman at oracle.com Sat Dec 16 08:08:14 2023 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Sat, 16 Dec 2023 08:08:14 +0000 Subject: How to find out what module provides concrete class? In-Reply-To: <799b9ac9-c3b5-0728-6c69-6e8dc5d247d2@gmail.com> References: <799b9ac9-c3b5-0728-6c69-6e8dc5d247d2@gmail.com> Message-ID: <3257b84b-7d34-451a-9ca8-c82fe76c4178@oracle.com> On 15/12/2023 21:47, PavelTurk wrote: > Hello all. > > Please, consider the following code: > > ClassLoader cl = .... > String className = "com.foo.Bar"; > Module module = ??? > > So, we have class name in a String and it is necessary to get > reference to module > that has this class. The question - is it possible to find out: > 1) without loading the class - > Module module = cl.loadClass(className).getModule(); > 2) without reading content of every module > ModuleReference reference = ... > reference.open().list().... > > I mean, is there any ready solution that I can use to find module by > class name and without loading class? Not in general. The class loader may know about com.sun.Bar but it may not be its defining loader. Even if you know that cl is (or will be) the defining class loader for a class named "com.sun.Bar", you don't know if the class is (or will be) in the unnamed module for cl or a named module that is mapped to cl. -Alan From Alan.Bateman at oracle.com Sat Dec 16 17:52:56 2023 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Sat, 16 Dec 2023 17:52:56 +0000 Subject: How many times one module can exist in layer graph In-Reply-To: References: <64d9be2a-ec37-4356-ae1f-56b43c885e22@oracle.com> Message-ID: On 15/12/2023 01:26, Alex Buckley wrote: > : > > Unfortunately, Guava is still not an explicit module > (https://github.com/google/guava/issues/2970). It is an automatic > module. This means it gets a "boost" in terms of the modules that it > reads. In fact, we think the implementation of module resolution is > giving it _too much_ of a boost, because Guava in layer B ends up > reading both Gson in layer B and Gson in layer A. Alan is investigating. Yes, this is about automatic modules in child configurations/layers. The computation of the readability graph needs to arrange for automatic modules to read modules in parent configurations, it's not taking into account the shadowing that arises when a module in the configuration under construction has the same name as a module in a parent configuration. No issue with explicit modules as their dependences are declared, the issue is specific to automatic modules. -Alan From pavelturk2000 at gmail.com Sat Dec 16 17:58:23 2023 From: pavelturk2000 at gmail.com (PavelTurk) Date: Sat, 16 Dec 2023 19:58:23 +0200 Subject: How many times one module can exist in layer graph In-Reply-To: References: <64d9be2a-ec37-4356-ae1f-56b43c885e22@oracle.com> Message-ID: So, do I understand it correctly - it is a bug? If so, could you provide a link to the issue or JDK-ID so I could track it? Best regards, Pavel On 12/16/23 7:52 PM, Alan Bateman wrote: > > Yes, this is about automatic modules in child configurations/layers. The computation of the readability graph needs to arrange for automatic modules to read modules in parent configurations, it's not taking into account the shadowing that arises when a module in the configuration under construction has the same name as a module in a parent configuration. No issue with explicit modules as their dependences are declared,?the?issue?is?specific?to?automatic?modules. From Alan.Bateman at oracle.com Mon Dec 18 16:13:14 2023 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Mon, 18 Dec 2023 16:13:14 +0000 Subject: How many times one module can exist in layer graph In-Reply-To: References: <64d9be2a-ec37-4356-ae1f-56b43c885e22@oracle.com> Message-ID: <89642c88-40d8-4797-ab4a-41b6fcfc8b4a@oracle.com> On 16/12/2023 17:58, PavelTurk wrote: > So, do I understand it correctly - it is a bug? If so, could you > provide a link to the issue or JDK-ID so I could track it? I've created JDK-8322302 [1] as a placeholder for now. -Alan [1] https://bugs.openjdk.org/browse/JDK-8322302 From pavelturk2000 at gmail.com Fri Dec 29 11:47:00 2023 From: pavelturk2000 at gmail.com (PavelTurk) Date: Fri, 29 Dec 2023 13:47:00 +0200 Subject: A couple of questions Message-ID: <7214b7d4-4002-1e0d-d7ee-f00eed90382f@gmail.com> Hello all. Could anyone help me with the following questions: 1. Let's suppose I have a reference to an unnamed module: module.getName() == null . But I need at least some information about it. How can I get file name of this module - jar/war etc? 2. Let's suppose I have the following layer graph: 1) boot 2) layerA (parent - boot) has moduleX 3) layerB (parent - boot) has moduleX 4) layerC (parents - layerA, layerB) has moduleY As I understand it is a possible situation. ModuleY requires moduleX that is present in two parent layers. The question - how can I find out from which layer moduleX will be used for moduleY? Best regards, Pavel