Re: Versioning in the java platform module system - proof of concept

2018-01-02 Thread Alan Bateman
On 01/01/2018 18:14, Tom De Wolf wrote: I am working out a proof of concept to use the module version property and the version of a ‘requires’in a useful manner. Details and a link to github can be found on:

Re: Update a runtime image

2017-12-31 Thread Alan Bateman
On 31/12/2017 15:42, Thomas Brand wrote: Hello, I have a question related to jlink. In a scenario where a runnable image created with jlink is installed, and it should be updated, what are good strategies for doing this? I think if an update will introduce new dependencies this will be

Re: reasons to add readability edges when creating layer

2017-12-31 Thread Alan Bateman
On 31/12/2017 01:22, Michał Zegan wrote: Hi. Wondering about one thing: What is the example use for addReads method of ModuleLayer.Controller? Code generation or new reflection (java.lang.invoke) would be reasons to use addReads. Reflection does not require adding readability edges

Re: Missing module discovery functionality in Jigsaw/JPMS API?

2017-12-28 Thread Alan Bateman
On 24/12/2017 23:31, Luke Hutchison wrote: I am the author of Fast Classpath Scanner . I am trying to extend this library to work with JDK 9, and I'm running into a lot of apparent shortcomings of the JPMS API. If you are scanning the class

Re: Module system and services directory in META-INF

2017-12-27 Thread Alan Bateman
On 27/12/2017 06:27, David Holmes wrote: https://docs.oracle.com/javase/9/docs/specs/jar/jar.html but the Service provider section is gone. Also the document seems mis-formatted. Yes, there was a problem with the markdown. It's been fixed in JDK 10 docs. -Alan

Re: Module system and services directory in META-INF

2017-12-27 Thread Alan Bateman
On 27/12/2017 12:22, Cédric Champeau wrote: : 1. is the spec saying somewhere that no-one should ever use `META-INF/services` for something else than a service for `ServiceLoader`? If not, then ModuleFinder should probably be patched to recognize that sometimes it's not the case. The

Re: ReflectionFactory is not sufficient to support custom serialization libraries

2017-12-19 Thread Alan Bateman
On 19/12/2017 19:06, David Lloyd wrote: : It looks like they are using Unsafe for accessing fields, unless I've missed something (I'm looking at sun.corba.Bridge). That's right, this hasn't changed. The issue is that legacy serialization is fundamentally incompatible with strong encapsulation.

Re: ReflectionFactory is not sufficient to support custom serialization libraries

2017-12-19 Thread Alan Bateman
On 19/12/2017 18:45, David Lloyd wrote: The ReflectionFactory class which was introduced for the purposes of supporting custom serialization libraries is not sufficient to the task by itself, despite what was implied by [1]. Have you looked at how IIOP uses it? -Alan

Re: Resolution exception when service interface gets exposed via --add-exports

2017-12-13 Thread Alan Bateman
On 12/12/2017 20:42, Gunnar Morling wrote: Finally got to write about my explorations of the jlink plug-in API: http://in.relation.to/2017/12/12/exploring-jlink-plugin-api-in-java-9/. I found the API good to work with overall, implementing my use case (adding an annotation index for given

Re: ModuleDescriptor#toString(Set<>, String) may produce unexpected results.

2017-12-12 Thread Alan Bateman
On 12/12/2017 07:20, Andrej Golovnin wrote: Hi all, the ModuleDescriptor#toString(Set<>, String) method uses String#toLowerCase() in the line 2607 without specifying a locale. And this may lead to unexpected results when you start the JVM for example with the Turkish locale. This can be fixed

Re: Proposal for New Functionality: Allow module-info merging in GenModuleInfoSource.java

2017-12-11 Thread Alan Bateman
On 06/12/2017 18:51, mandy chung wrote: Moving this to jigsaw-dev On 12/6/17 8:38 AM, Adam Farley8 wrote: Hi All, Currently, GenModuleInfoSource.java does not allow you to merge extra module-info files into the primary module-info file (for a given module) at build time. This tool

Re: Permissions in default.policy and --patch-module

2017-12-11 Thread Alan Bateman
On 11/12/2017 07:50, Weijun Wang wrote: I was just trying to run a jtreg test on a new Windows VirtualBox VM. A small code change is needed but I don't want to do a full build (it also does not have enough memory). I just copied an existing image, and the modified class was compiled on the

Re: Permissions in default.policy and --patch-module

2017-12-10 Thread Alan Bateman
On 11/12/2017 01:12, Weijun Wang wrote: I modified a class inside the jdk.crypto.cryptoki module, compiled it with "javac -d /tmp", and then ran a small program with java --patch-module jdk.crypto.cryptoki=/tmp -Djava.security.manager MyProg and it fails with TEST RESULT: Failed.

Re: 8191867: Module attribute in 54.0+ class file cannot contains a requires java.base with ACC_TRANSITIVE or ACC_STATIC_PHASE

2017-12-07 Thread Alan Bateman
On 06/12/2017 17:17, mandy chung wrote: or it can print "java.base includes " + mods? I've adjusted the exception text so that it reads:    "The requires entry for java.base has ACC_TRANSITIVE set" and updated the webrev in place. If you agree then I'll get this into jdk/jdk10 to meet up

Re: Minor performance improvement to java.lang.ModuleLayer.findModule(String name)

2017-12-07 Thread Alan Bateman
On 07/12/2017 10:00, Andrej Golovnin wrote: Hi all, when we try to find a module which is not in the current layer, then we access the map 'nameToModule' in the parent layers two times in the lines 849-850: The change looks okay (I'm pretty sure it was just an oversight as this code changed

Re: Definitive list of modules that go into bootstrap class loader?

2017-12-07 Thread Alan Bateman
On 06/12/2017 22:55, Scott Stark wrote: Is there a definitive list of modules that go into bootstrap class loader? If not, is there a way to derive this? Just looking at the ModuleLayer.boot().modules() output does not provide this as I see modules like java.sql in this set that contains

Re: 8191867: Module attribute in 54.0+ class file cannot contains a requires java.base with ACC_TRANSITIVE or ACC_STATIC_PHASE

2017-12-06 Thread Alan Bateman
On 06/12/2017 17:00, Paul Sandoz wrote: On 6 Dec 2017, at 07:42, Alan Bateman <alan.bate...@oracle.com> wrote: The draft JVMS for Java SE 10 forbids an entry in the requires table of a Module attribute in a 54.0 or newer class file to require java.base with the ACC_TRAN

8191867: Module attribute in 54.0+ class file cannot contains a requires java.base with ACC_TRANSITIVE or ACC_STATIC_PHASE

2017-12-06 Thread Alan Bateman
The draft JVMS for Java SE 10 forbids an entry in the requires table of a Module attribute in a 54.0 or newer class file to require java.base with the ACC_TRANSITIVE or ACC_STATIC_PHASE modifiers. This needs an update to the module-info.class parser:   

Re: Review Request JDK-8192945: Need stable sort for MODULES entry in the release file

2017-12-06 Thread Alan Bateman
On 05/12/2017 22:19, mandy chung wrote: The MODULES list in the `release` file is topologically sorted. For a given module graph, the patch traverses the graph in a stable order during the topological sort that will produce the same result for the same module graph. Webrev at:

Re: RFR 8185130: jlink should throw error if target image and current JDK versions don't match

2017-12-05 Thread Alan Bateman
On 05/12/2017 14:42, Sundararajan Athijegannathan wrote: Updated to check minor version as well -> http://cr.openjdk.java.net/~sundar/8185130/webrev.01/index.html I think this looks okay. I assume the java9.home in the test is for manual test. -Alan.

8182742: ClassLoader.getResourceXXX throws NPE when ClassLoader created by defineModulesWithXXX

2017-12-05 Thread Alan Bateman
I need a Reviewer for a trivial change to the class loaders that support the ModuleLayer defineModulesWithXXXLoader methods. These methods create one or many class loaders to load classes/resources from the modules in the layer. The parent of these class loaders is specified to these method

Re: RFR 8185130: jlink should throw error if target image and current JDK versions don't match

2017-12-05 Thread Alan Bateman
On 05/12/2017 13:34, Sundararajan Athijegannathan wrote: Please review. Bug: https://bugs.openjdk.java.net/browse/JDK-8185130 Webrev: http://cr.openjdk.java.net/~sundar/8185130/webrev.00/index.html The check in newModuleFinder needs to check the minor version too (changing to interim soon). It

8186736: Spec clarifications for IllegalArgumentException throwing - ModuleLayer.defineX methods

2017-12-05 Thread Alan Bateman
The description for the IllegalArgumentException thrown by the ModuleLayer.defineModulesXXX methods isn't very clear. Attached is the proposed patch to improve the wording, there are no implementation changes. Mandy has already reviewed the CSR

Re: 8192973: Adding "Resolution" to javadoc search index

2017-12-05 Thread Alan Bateman
On 04/12/2017 19:24, Jonathan Gibbons wrote: Is "resolution" too broad a term?  Should the indexed term be more specific, like "module resolution"? -- Jon "Module Resolution" is better and avoids it showing up after a list of types with "Resolution" in the name, thanks. If there are no

8192973: Adding "Resolution" to javadoc search index

2017-12-04 Thread Alan Bateman
I'd like to add a search term to the javadoc search to make it easy to find the Resolution spec. Attached is the proposed patch. In terms we will need to do the same for service binding. -Alan $ hg diff src/java.base/share/classes/java/lang/module/package-info.java diff -r 0b42613e35bf

Re: Whitelisting modules in layers

2017-12-02 Thread Alan Bateman
On 01/12/2017 18:47, Mark Raynsford wrote: : I've played around with the ModuleFinder API a little, and came up with the following: https://github.com/io7m/moduledemo-20171201/blob/master/src/main/java/com/io7m/moduledemo/WhitelistModuleDemo.java However, the

Re: Scanning Modules(take 2)?

2017-11-29 Thread Alan Bateman
On 29/11/2017 09:33, Greg Wilkins wrote: : So perhaps it would be a good idea for the library to provide some semantics to assist frameworks to get this right? Ideally there would be an API to allow frameworks to query the JVM about what classes (which may not be loaded and may even be for a

Re: Adding module causes classloading issues

2017-11-29 Thread Alan Bateman
On 28/11/2017 22:11, Michael Hall wrote: On Nov 28, 2017, at 4:48 AM, Alan Bateman <alan.bate...@oracle.com <mailto:alan.bate...@oracle.com>> wrote: javax.rmi.PortableRemoteObject It does include PortableRemoteObject. and this probably has references to classes in o

Re: Adding module causes classloading issues

2017-11-28 Thread Alan Bateman
On 28/11/2017 09:14, Michael Hall wrote: It’s a little alarming jdeps might report false dependencies? I would rather spare you the full output. How about… jdeps halfpipe.jar | grep corba halfpipe.jar -> java.corba org.cmdline-> javax.rmi

Re: Adding module causes classloading issues

2017-11-28 Thread Alan Bateman
On 28/11/2017 02:00, Alex Buckley wrote: Thank you, for investigating how your app relates to CORBA, JTA, and Attach. I hope http://openjdk.java.net/jeps/8189188 was informative at least. Alan will probably be along shortly with some points I missed. One point that I didn't see mentioned in

Re: Resolution exception when service interface gets exposed via --add-exports

2017-11-21 Thread Alan Bateman
On 21/11/2017 09:29, Remi Forax wrote: Hi Alan, I use jlink plugins for 2 things, - code generation, i.e. find patterns in the bytecode and optimize them because at link time you are in a closed world, so something that was dynamic is not anymore. - just bytecode crawling to find specific

Re: Resolution exception when service interface gets exposed via --add-exports

2017-11-21 Thread Alan Bateman
On 20/11/2017 21:56, Gunnar Morling wrote: I see, thanks for the clarification. It's a pity, though, I hoped to employ that approach for providing a custom jlink plug-in (implementation of jdk.tools.jlink.plugin.Plugin). So it seems that's not possible until jdk.jlink exports j.t.j.plugin?

Re: Resolution exception when service interface gets exposed via --add-exports

2017-11-20 Thread Alan Bateman
On 20/11/2017 21:04, Gunnar Morling wrote: Hi, I'm having one module which defines a service interface but does not export that interface's package. In another module I wish to create an implementation of that service, which should be possible via --add-exports. I can successfully compile that

Re: Incorrect casing in output of jar --describe-module

2017-11-19 Thread Alan Bateman
On 19/11/2017 13:44, Gunnar Morling wrote: : I reckon this is an issue within the "jar" tool, as the entries in the constant pool of the compiled module-info.class file look alright. I see this with JDK 9.0.1 as well as 10 b32. Is this a known issue? Yes, this in a bug in both the `jar` and

Re: Patterns for libraries to access private state of user modules

2017-11-14 Thread Alan Bateman
On 14/11/2017 17:07, Gunnar Morling wrote: : JAXB is one example doing this already and it would be good to exercise it with other libraries to ensure that it is feasible. Is this happening in the JAXB reference implementation? Would you perhaps have any pointers to specifics so I

Re: RFR 8177471: jlink should use the version from java.base.jmod to find modules

2017-11-13 Thread Alan Bateman
On 13/11/2017 16:36, Sundararajan Athijegannathan wrote: Thanks for the review. Updated as per suggestions: http://cr.openjdk.java.net/~sundar/8177471/webrev.01/index.html I think this looks fine. -Alan

Re: RFR 8177471: jlink should use the version from java.base.jmod to find modules

2017-11-13 Thread Alan Bateman
On 13/11/2017 08:02, Sundararajan Athijegannathan wrote: Please review. Bug: https://bugs.openjdk.java.net/browse/JDK-8177471 Webrev: http://cr.openjdk.java.net/~sundar/8177471/webrev.00/index.html Thanks to Mandy for initial (internal) round of review and suggesting me simplifications on my

Re: How to compile test code in a modular project?

2017-11-09 Thread Alan Bateman
On 08/11/2017 21:03, Till Brychcy wrote: A common source structure (e.g. used by maven and gradle) is that tests are in separate source directory with separate output directory and are in the same packages as the code that is being tested, so the tests can access code elements that have

Re: Combining -classpath and module-info?

2017-11-07 Thread Alan Bateman
On 07/11/2017 18:56, Stephan Herrmann wrote: I recently noticed that compilers start to ignore -classpath as soon as module-info (.java or .class) is found during the compile. (Incidentally, javac and Eclipse compiler agree in this). Using a trivial test class this works: $ javac -classpath

Re: OS X commandline tools

2017-10-28 Thread Alan Bateman
On 28/10/2017 15:12, Michael Hall wrote: I think I may of raised this as an issue sometime earlier. I filed a bug report through bug report.java We will review your report and have assigned it an internal review ID : 9051382 . But as I recall earlier it was indicated that this involved files

Re: RFR 8189777: jlink --module-path default value and automatic addition of $JAVA_HOME/jmods if java.base is missing

2017-10-25 Thread Alan Bateman
On 25/10/2017 14:43, Sundararajan Athijegannathan wrote: Second constructor is used by packager (internal) api. I could move getDefaultModulePath to JlinkTask.. Ugh, we need to get packager moved away from using this. -Alan.

Re: RFR 8189777: jlink --module-path default value and automatic addition of $JAVA_HOME/jmods if java.base is missing

2017-10-25 Thread Alan Bateman
On 25/10/2017 11:23, Sundararajan Athijegannathan wrote: Updated: http://cr.openjdk.java.net/~sundar/8189777/webrev.03/ This looks better. A few comments/questions: Does the JlinkConfiguration constructor that takes the ModuleFinder still need the module path? I assume it shouldn't be needed

Re: Retrieving the bytes of platform classes

2017-10-23 Thread Alan Bateman
On 23/10/2017 18:48, Mark Raynsford wrote: : In the olden days, we'd probably have gone rummaging in rt.jar, but that was obviously a hack and wasn't future-proof. My tool is only designed to work with JDK 9 and up. Note that I'm *not* asking to get from loaded Class instances to bytes: I'm

Re: RFR 8189777: jlink --module-path default value and automatic addition of $JAVA_HOME/jmods if java.base is missing

2017-10-23 Thread Alan Bateman
On 23/10/2017 11:37, Sundararajan Athijegannathan wrote: Updated for getDefaultModulePath. moduleFinder uses three instance fields - modulepaths, limitmods and modules. We may have to pass all to the static method... Yes, if you want to avoid operating on a partly initialized

Re: RFR 8189777: jlink --module-path default value and automatic addition of $JAVA_HOME/jmods if java.base is missing

2017-10-23 Thread Alan Bateman
On 23/10/2017 06:37, Sundararajan Athijegannathan wrote: Please review. Bug: https://bugs.openjdk.java.net/browse/JDK-8189777 Webrev: http://cr.openjdk.java.net/~sundar/8189777/webrev.00/ This patch is very welcome as it makes jlink easier to use without any impact to the cross building case.

Re: RFR 8189671: jlink should clearly report error when an automatic module is used

2017-10-20 Thread Alan Bateman
On 20/10/2017 09:03, Sundararajan Athijegannathan wrote: Updated: http://cr.openjdk.java.net/~sundar/8189671/webrev.03/ Looks good. -Alan

Re: RFR 8189671: jlink should clearly report error when an automatic module is used

2017-10-20 Thread Alan Bateman
On 20/10/2017 04:53, Sundararajan Athijegannathan wrote: Hi, Updated to include location (when available) and formatting: http://cr.openjdk.java.net/~sundar/8189671/webrev.02/ This looks right now. As jlink only supports packaged modules on the file system then each module should have a

Re: RFR 8189671: jlink should clearly report error when an automatic module is used as root

2017-10-19 Thread Alan Bateman
On 19/10/2017 15:04, Sundararajan Athijegannathan wrote: Please review. Bug: https://bugs.openjdk.java.net/browse/JDK-8189671 Webrev: http://cr.openjdk.java.net/~sundar/8189671/webrev.00/ Why do you want to treat the root modules differently?  Shouldn't it look at all modules in the

Re: 8186738: (sl) ServiceLoader::stream doesn't update cache

2017-10-13 Thread Alan Bateman
On 12/10/2017 23:54, mandy chung wrote: : test/jdk/java/util/ServiceLoader/security/test/p/Tests.java 184 assertTrue(e.getCause() instanceof Error); I think it's more precise to check e.getCause().getClass() == Error.class. You are right, that test should be improved, more so if each of cases

Re: issue deriving automatic module name

2017-10-04 Thread Alan Bateman
On 03/10/2017 17:44, Paul Bakker wrote: Hi, I ran into an issue testing some migration scenarios. When using jboss-transaction-api_1.2_spec-1.0.1.Final.jar as an automatic module, startup fails with: Caused by: java.lang.IllegalArgumentException: jboss.transaction.api.1.2.spec: Invalid

Re: ServiceLoader and ModuleLayer

2017-09-26 Thread Alan Bateman
On 26/09/2017 20:37, Sander Mak wrote: I'm currently running into an issue that behaves unexpected as far as I can see. Let's say there are two service types, A and B. The module `main` in the boot layer has a uses constraint on A. Module `main` instantiates a new ModuleLayer with the

Re: module-info file location

2017-09-22 Thread Alan Bateman
On 22/09/2017 08:41, Karl Heinz Marbaise wrote: Hi, I have seen an example of a multi version jar file which contained the mudule-info.class at the following location: META-INF/versions/9/module-info.class based on the information I have I would have assumed that this is only allowed having

Re: java.lang.annotation.Generated

2017-09-20 Thread Alan Bateman
On 20/09/2017 13:58, Stephen Colebourne wrote: Ouch. Thats an unpleasant result. It should have gone in `java.lang.annotation`. Stephen That was the original suggestion but that package is more for annotations types that are used as meta annotations (@Native should have gone elsewhere but we

Re: java.lang.annotation.Generated

2017-09-20 Thread Alan Bateman
On 20/09/2017 13:43, Stephen Colebourne wrote: As per this email: http://mail.openjdk.java.net/pipermail/jigsaw-dev/2017-February/011365.html the idea was to add a new annotation `java.lang.annotation.Generated` to replace the old problematic one. Is it my imagination, or did this get

Re: Scanning multi version jars?

2017-09-19 Thread Alan Bateman
On 19/09/2017 05:37, Greg Wilkins wrote: : Which raises an interesting point with the multi versioned jar I have used as an example, which contains: - org/example/Foo.class - org/example/Foo$Bar.class - META-INF/versions/9/org/example/Foo.class What does the classloader do

Re: Scanning multi version jars?

2017-09-17 Thread Alan Bateman
On 15/09/2017 22:58, Greg Wilkins wrote: : * I think the stream needs to handle inner classes and only include them if their matching outerclass is available at the same version.  So for example a base Foo$Bar.class will only be included if the stream includes a base Foo.class,

Re: "exports" directive does not open module's resources for dependent modules

2017-09-15 Thread Alan Bateman
On 15/09/2017 13:14, Alexander Udalov wrote: It looks like exporting a package from a (non-open) module with an "exports" directive is not enough to ensure that Module.getResourceAsStream on that module would load resources from the module. Surprisingly, adding an "opens" directive for the same

Re: Scanning modules?

2017-09-15 Thread Alan Bateman
On 15/09/2017 08:40, Greg Wilkins wrote: Alan & Christian, thanks for that - I totally missed ResolvedModule.open().list() So now a supplementary question... are ModuleReaders MR aware?  Ie if the jar of the module is MR, will the resolved module only contain classes that are appropriate for

Re: Scanning multi version jars?

2017-09-15 Thread Alan Bateman
On 15/09/2017 03:09, Greg Wilkins wrote: Alan, thanks for correcting me on the API of JarFile - I can see it kind of works, but in a very bizarre way (it gives different content for entries obtained via the enumerator vs the getJarEntry API, even though both entries report the same name). 

Re: Scanning modules?

2017-09-15 Thread Alan Bateman
On 15/09/2017 05:01, Greg Wilkins wrote: All, another question on scanning, but more jigsaw related than my other question. App containers have to scan jars deployed in EARs, WARs etc. for annotations, fragments, resources etc. However, many containers also offer features to be able to

Re: Scanning multi version jars?

2017-09-14 Thread Alan Bateman
On 14/09/2017 10:58, Weijun Wang wrote: : I know an MR jar allows you to shadow a class file with a release-specific one, but what if the new release has removed an old class? It will not appear in the release-specific directory but still exists in the root. Should we describe this in the

Re: Scanning multi version jars?

2017-09-14 Thread Alan Bateman
On 13/09/2017 23:12, Greg Wilkins wrote: I hope this is the right group for this question. please redirect me if not. Probably core-libs-dev as this isn't anything to do with modules but in any case ... The Jetty project is trying to implement annotation scanning for multi version jars

Re: ServiceLoader usage in automatic module fails

2017-09-11 Thread Alan Bateman
On 11/09/2017 12:26, Christian Stein wrote: On Mon, Sep 11, 2017 at 1:17 PM, Alan Bateman <alan.bate...@oracle.com> wrote: [...] Also can you run with `--add-modules demo` as I assume the scenario you is that "demo" is not resolved (because no modules `requires demo` and no

Re: ServiceLoader usage in automatic module fails

2017-09-11 Thread Alan Bateman
On 11/09/2017 11:52, Alan Bateman wrote: : Which JAR file contains the service provider? You mentioned "restoring the class-path and provide a META-INF/services". Does this mean you removed the services configuration file when you had the JAR file on the module path as an automa

Re: ServiceLoader usage in automatic module fails

2017-09-11 Thread Alan Bateman
On 11/09/2017 11:03, Christian Stein wrote: Hi jigsaw team, I discovered an issue with the ServiceLoader trying to load services on the module-path, when the actual ServiceLoader.load() call resides in an automatic module. I compiled a small demo at [1] and it's console output is visible at

Re: [Question] Accessibility of each modules

2017-09-05 Thread Alan Bateman
On 05/09/2017 14:08, KUBOTA Yuji wrote: My following example program shows that automatic module can't read exported package by explicit module. $ /jdk-9/bin/jar -d --file mlibs/org.astro.jar org.astro jar:file:///jigsaw-sample/mlibs/org.astro.jar/!module-info.class exports org.astro

Re: Jigsaw and containers

2017-09-01 Thread Alan Bateman
On 31/08/2017 22:05, Daniel Latrémolière wrote: Hi Rémi, Alan I use already jlink to keep only useful (for me) parts of JRE/JDK, and avoid most big thinks (like Java UI, CORBA, RMI, etc). Modular JAR are officially for migration [1] and are not used by modules from OpenJDK, even when they are

Re: Jigsaw and containers

2017-08-31 Thread Alan Bateman
On 31/08/2017 19:47, Daniel Latrémolière wrote: Are you using `jlink` to create a run-time image for each application? (just trying to establish if you are actually running into an issue or not). With jlink per application, all will be working without problems, but each application will have

Re: Jigsaw and containers

2017-08-31 Thread Alan Bateman
On 31/08/2017 18:58, Daniel Latrémolière wrote: I have a problem to understand new layout of files in JRE/JDK images for the containers use-cases. Containers (Docker, Flatpak) have a notion of single inheritance, where an union FS merge the images of the container with parent containers.

Re: Proper term for non-automatic modules

2017-08-29 Thread Alan Bateman
On 29/08/2017 06:52, Nicolai Parlog wrote: Hi! While describing the difference between automatic and non-automatic modules I often need a term do describe the modules that are not automatic (as I did twice just now). As far as I know there is no such term. There are a few related ones but

Re: Review Request: JDK-8186145: tools/launcher/modules/validate/ValidateModulesTest.java fails when launched with -XX:+EnableJVMCI

2017-08-24 Thread Alan Bateman
On 24/08/2017 19:05, mandy chung wrote: java --validate-modules requires only java.base to do the validation and hence the current implementation creates a minimum boot layer with java.base only.  It fails when running with -XX:+EnableJVMCI when VM attempts to load JVMCI class which is not in

Re: trySetAccessible​

2017-08-22 Thread Alan Bateman
On 16/08/2017 02:09, Russell Gold wrote: : but: method.getDeclaringClass().getModule().isOpen("java.io", callingClass.getModule()) -> true // which seems to say that it IS open to that particular unnamed module ?! As Mandy points out, isOpen(String) is used to test if a

Re: Jigsaw related questions emerged during Java 9 Jigsaw Hack Day

2017-08-22 Thread Alan Bateman
On 14/08/2017 09:35, Oleg Tsal-Tsalko wrote: 2. Why compilation doesn’t fail in case several modules with same name put on module-path, but it only fails in runtime on startup ( https://github.com/AdoptOpenJDK/jdk9-jigsaw/tree/master/session-1-jigsaw-intro/08_ModulesExportConflict

Re: Allow ModuleInfoExtender to be used externally

2017-08-22 Thread Alan Bateman
On 10/08/2017 08:29, Oliver Siegmar wrote: On 8/9/17 7:35 PM, mandy chung wrote: ModuleInfoExtender is JDK internal API and not planned to be exported/opened. New version of ASM supports module-info.class. You can probably try out ASM 6 alpha version for now. Thank you for clarifying. So,

Re: 8185853: Generate readability graph at link time and other startup improvements

2017-08-06 Thread Alan Bateman
On 06/08/2017 01:37, mandy chung wrote: It is good to see more optimization be done at link time that improves the startup. jdk/internal/loader/ClassLoaders.java 79 if (cp.length() == 0) cp = null; Our launcher and hotspot VM always set "java.class.path" system property and so it'll be

8185853: Generate readability graph at link time and other startup improvements

2017-08-04 Thread Alan Bateman
This is a patch for jdk10/jdk10 to claw back some of the regression to startup performance in JDK 9 for very short lived applications. The bulk of the changes are to the "system modules" jlink plugin and the related code in the module system initialization. Specifically, the plugin now

Re: Provide access to data offset in WritableRaster in Java 9

2017-07-13 Thread Alan Bateman
The 2d-dev or awt-dev mailing lists may be a better place to bring this up. -Alan On 13/07/2017 17:21, Peter A wrote: Apologies since this probably not the correct list, but I was referenced here from another Java list. Background: The high level API in a BufferedImage is very very very slow.

Re: trySetAccessible​

2017-07-11 Thread Alan Bateman
On 11/07/2017 10:16, Uwe Schindler wrote: : Sorry, I mixed up the parameters. So basically the "correct" code to check if something like java.lang.String is open to Groovy would be: Module groovyModule = CachedClass.class.getModule(); // org.codehaus.groovy.reflection.CachedClass; Class clazz

Re: trySetAccessible​

2017-07-10 Thread Alan Bateman
On 10/07/2017 16:31, Uwe Schindler wrote: Hi Alan, we understand all this. But what you say is also not true. I started a second approach to fix the issue by using canAccess() and also checking the module stuff. For that I executed the following code on the Groovy unnamed module: import

Re: trySetAccessible​

2017-07-10 Thread Alan Bateman
On 10/07/2017 10:44, Jochen Theodorou wrote: : Example: module A: class Foo { protected void foo(){} } Groovy program: class X extends Foo { def bar() {return {foo()}} } if Foo is in an exported package, then it is legal for X to call foo, even though it is protected. But bar() does

Re: trySetAccessible​

2017-07-10 Thread Alan Bateman
On 10/07/2017 10:59, Cédric Champeau wrote: This is not really practical. Basically it means that for every Gradle build script on earth, we would either choose to make them fail on JDK 9, or be bloated with warnings, that are actually handled. My mail was just explaining why it returns

Re: trySetAccessible​

2017-07-10 Thread Alan Bateman
On 10/07/2017 09:43, Uwe Schindler wrote: Hi Alan, I was trying to fix Groovy to use trySetAccessible() instead of setAccessible() and this did not change any warnings at all: The code can be found here: https://github.com/apache/groovy/compare/master...uschindler:java9/trySetAccessible It

Re: trySetAccessible​

2017-07-10 Thread Alan Bateman
On 10/07/2017 09:49, Cédric Champeau wrote: I second Uwe's comment here: I was surprised as well, I expected the semantics of `trySetAccessible` to be: "let me know if I can do this, respecting the semantics of modules, and if not, return false" For the example, trySetAccessible succeeds

Re: trySetAccessible​

2017-07-10 Thread Alan Bateman
On 10/07/2017 03:28, Stephen Felts wrote: : com.sun.xml.bind.v2.runtime.reflect.opt.Injector com.sun.xml.ws.model.Injector From what I can tell, these two aren't using tryAccessible. Instead they seem to use setAccessible to attempt to get at a non-public ClassLoader.defineClass method. It

Re: trySetAccessible​

2017-07-10 Thread Alan Bateman
On 10/07/2017 00:16, Jochen Theodorou wrote: Hi all, since the JVM now prints warnings if you call setAccssible there was the advise to move to trySetAccessible​ to prvent these warnings. The motivation for trySetAccessible is to avoid using exceptions for control flow. I don't recall any

Re: Module in JDK image as platform module or loaded by application class loader?

2017-07-06 Thread Alan Bateman
On 06/07/2017 13:03, Langer, Christoph wrote: Hi there, for our JDK 9 image the jtreg test jdk/modules/etc/VerifyModuleDelegation has unveiled a problem. The issue is that we introduced a few modules that are defined as a platform module. One of these modules requires jdk.attach which is

Re: Use classes in unnamed module that are also contained in a JDK platform/runtime module

2017-07-04 Thread Alan Bateman
On 04/07/2017 08:02, Langer, Christoph wrote: Hi experts, probably this was already asked or discussed here but I don't find an exact answer for my type of issue, so I'm asking again. I have some piece of software that we ship as a jar file and which will hence run on a JDK 9 in the unnamed

Re: RFR 8182776/8183161/8183251: Miscellaneous API doc fixes

2017-07-03 Thread Alan Bateman
On 03/07/2017 19:27, Jonathan Gibbons wrote: Looks good to me. -- Jon Thumbs up from me too. -Alan

Re: Exporting a package with no Java sources

2017-07-03 Thread Alan Bateman
On 03/07/2017 12:57, Alexander Udalov wrote: : Thanks, a dummy class certainly workarounds the problem of javac reporting a compilation error here. However, I hope there's a better way because it'd be a bit strange to force users to create a dummy Java class in every exported package in pure X

Re: Spec confusion about open modules

2017-07-02 Thread Alan Bateman
On 02/07/2017 11:16, Cay Horstmann wrote: In §7.7, the JLS draft from 2017-06-26 states: An open module, with the open modifier ... grants access at run time to types in all its packages, as if all packages had been exported. ... Distinct from access at compile time and access at run time, the

Re: Cleanly starting apps on Java 9 and earlier

2017-07-01 Thread Alan Bateman
On 01/07/2017 13:15, Enrico Olivelli wrote: : Alan, Can you give some poonters to this page? Thank you There isn't a page to point at yet, mostly we are waiting for javaee.github.io to be updated to list stable Maven coordinates or download links for each of the standalone technologies.

Re: javap cannot read module-info.class

2017-07-01 Thread Alan Bateman
On 01/07/2017 16:08, Stephan Herrmann wrote: compile an arbitrary module-info.java and then: $ javap module-info.class Error: error while reading constant pool for /tmp/bin/module-info.class: unexpected tag at #5: 19 From tweaking the Eclipse compiler it seems that javap is expecting a

Re: Exporting a package with no Java sources

2017-07-01 Thread Alan Bateman
On 01/07/2017 10:09, Peter Levart wrote: Hi Alexander, Have you tried to put a package-info.java into the exported package? It might work. I don't think so, but a dummy class/interface will do (it doesn't have to be public). There is a lengthy discussion on this topic in JIRA from 2016 that

Re: Cleanly starting apps on Java 9 and earlier

2017-07-01 Thread Alan Bateman
On 01/07/2017 10:18, Mark Thomas wrote: Hi, Apache Tomcat needs to add the following options when running on Java 9: --add-modules=java.se.ee --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.rmi/sun.rmi.transport=ALL-UNNAMED The first is because it depends on

hg: jigsaw/jake/nashorn: 2 new changesets

2017-07-01 Thread alan . bateman
Changeset: b25986e36b28 Author:lana Date: 2017-06-29 17:26 + URL: http://hg.openjdk.java.net/jigsaw/jake/nashorn/rev/b25986e36b28 Added tag jdk-9+176 for changeset 3c6fbdf6e785 ! .hgtags Changeset: e93bc38cf3f3 Author:alanb Date: 2017-07-01 07:58 +0100 URL:

hg: jigsaw/jake/corba: 2 new changesets

2017-07-01 Thread alan . bateman
Changeset: 76cebcdca958 Author:lana Date: 2017-06-29 17:26 + URL: http://hg.openjdk.java.net/jigsaw/jake/corba/rev/76cebcdca958 Added tag jdk-9+176 for changeset 40fb9f229471 ! .hgtags Changeset: ace27af8942f Author:alanb Date: 2017-07-01 07:58 +0100 URL:

hg: jigsaw/jake/jaxp: 2 new changesets

2017-07-01 Thread alan . bateman
Changeset: 332ad9f92632 Author:lana Date: 2017-06-29 17:26 + URL: http://hg.openjdk.java.net/jigsaw/jake/jaxp/rev/332ad9f92632 Added tag jdk-9+176 for changeset 38cf34e23280 ! .hgtags Changeset: 712c8f06dd80 Author:alanb Date: 2017-07-01 07:58 +0100 URL:

hg: jigsaw/jake/hotspot: 3 new changesets

2017-07-01 Thread alan . bateman
Changeset: 2ab74e5dbdc2 Author:roland Date: 2017-06-23 09:33 +0200 URL: http://hg.openjdk.java.net/jigsaw/jake/hotspot/rev/2ab74e5dbdc2 8181742: Load that bypasses arraycopy has wrong memory state Summary: Set load memory edge to the memory state right before the arraycopy.

hg: jigsaw/jake/jdk: 4 new changesets

2017-07-01 Thread alan . bateman
Changeset: 2425838cfb5e Author:mullan Date: 2017-06-23 14:32 -0400 URL: http://hg.openjdk.java.net/jigsaw/jake/jdk/rev/2425838cfb5e 8182652: RuntimePermission("usePolicy") is not a Java SE permission Reviewed-by: mchung !

hg: jigsaw/jake/jaxws: 2 new changesets

2017-07-01 Thread alan . bateman
Changeset: 880541212285 Author:lana Date: 2017-06-29 17:26 + URL: http://hg.openjdk.java.net/jigsaw/jake/jaxws/rev/880541212285 Added tag jdk-9+176 for changeset ea819b6009d3 ! .hgtags Changeset: 7c7fed544711 Author:alanb Date: 2017-07-01 07:58 +0100 URL:

<    1   2   3   4   5   6   7   8   9   10   >