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 th

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

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 di

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 boot_layer.defineModulesWithOn

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 src/ja

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 objec

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 (https://bugs.openjdk.java.net/browse/JDK-8192980)

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

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 t

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.

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: http://cr.openjd

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:    http://cr.openjdk.java.net/~alanb/8191867

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 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_TRANSITIVE or ACC_STATIC_PHASE modifiers. This

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 packag

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 se

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 wit

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. Execution

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 hos

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 inte

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 by

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 modu

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: 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: 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 META-INF/se

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 pa

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 manually.

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 differen

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: https://devcreativity.wordpress.com/2017/12/29/semantic-versions-in-java-9-modules-a

Re: reasons to add readability edges when creating layer

2018-01-02 Thread Alan Bateman
On 31/12/2017 16:06, Michał Zegan wrote: : Is that planned to be added? Or even needed? I'm not aware of any proposals to add this in the short term. I wanted to compare jpms api to jboss-modules and seems to me that jboss-modules does not have the dependency modification capability at all at

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

2018-01-02 Thread Alan Bateman
On 02/01/2018 17:07, Tom De Wolf wrote: : What I don't understand is the reasoning why the module.getDescription().version() then returns a version for an automatic module like sprint.core? it is not an explicit module on which javac can do its magic, so where is that version information sto

Re: RFR: JDK-8194141: Remove JDK9Wrappers

2018-01-04 Thread Alan Bateman
On 03/01/2018 22:42, Jonathan Gibbons wrote: Updated webrev, reverting unnecessary change to generated-configure.sh http://cr.openjdk.java.net/~jjg/8194141/webrev.01/ This cleanup looks good to me. -Alan

Re: Not all modules are listed in Javadoc Requires section

2018-01-04 Thread Alan Bateman
On 04/01/2018 12:08, Zheka Kozlov wrote: I noticed that for some modules some dependencies are missing in the Javadoc Requires section. For example, `java.desktop` depends on `java.prefs`, `java.datatransfer`, `java.xml` but https://docs.oracle.com/javase/9/docs/api/java. desktop-summary.html sa

Re: Qualified exports/opens and services

2018-01-04 Thread Alan Bateman
On 04/01/2018 14:25, David Lloyd wrote: : Hi Nicolai, You may want to refer to the thread here: http://mail.openjdk.java.net/pipermail/jigsaw-dev//2017-November/013315.html Essentially a module may delegate a private Lookup to itself, or a module may do so on behalf of another module. To use y

Re: jar --print-module-descriptor

2018-01-04 Thread Alan Bateman
On 04/01/2018 23:03, mandy chung wrote: I created https://bugs.openjdk.java.net/browse/JDK-8194653 to fix the docs bug.   The docs was missed to be updated when this jar option was renamed to --describe-module. Here's the correct link. As Mandy says, this is an issue with the Oracle docs, the

Re: JDK created with jlink?

2018-01-06 Thread Alan Bateman
On 06/01/2018 15:40, Nicolai Parlog wrote: Hi, I'm pretty sure I've read that jlink is used internally to create the canonical JRE/JDK runtime images. Did I get that right? Yes it does. You can look through Images.gmk [1] to see the options that it uses (if you are interested). -Alan [1

Re: Where do modules go in jlink images?

2018-01-07 Thread Alan Bateman
On 07/01/2018 12:57, Nicolai Parlog wrote: Hi! Another question about jlink (guess what chapter I'm working on ;) ). I've tried to find out where jlink puts the content of the jmods folder, but hit a wall. I created a full runtime image with jlink and diffed the file trees (including disk usa

Re: Update a runtime image

2018-01-10 Thread Alan Bateman
On 10/01/2018 10:32, Gunnar Morling wrote: Hi Thomas, What I've found helpful is the ability to amend or override the set of modules contained in a modular runtime image via --module-path and --upgrade-module-path. If you use (Docker) containers to deploy your app, this can be employed nicely t

Re: Update a runtime image

2018-01-10 Thread Alan Bateman
On 10/01/2018 17:39, Gunnar Morling wrote: : What exactly do you mean by "broken app module"? It was my understanding that by applying that exclusion pattern, no trace whatsoever of the app module would end up in the resulting runtime image. If I run /bin/java --list-modules it's not shown in

Re: How does one handle a java method which returns a non-public sub-type via reflection?

2018-01-15 Thread Alan Bateman
On 15/01/2018 18:27, jeffrey kutcher wrote: I've worked with Java since 1995. This example represents an issue that was never an issue up until Java9. Even then, I had no idea it was my code that was the issue since my code never directly referenced illegal classes. I code to write once, run a

Re: Reflection: how does one access a protected member in a superclass reflectively?

2018-01-16 Thread Alan Bateman
On 15/01/2018 20:56, Rony G. Flatscher wrote: : So the question is, how can I reflectively access "mtest1.Class01A" static protected field "myClassName" from "mtest3.Class03a" in Java 9? The scenario in your mail is complicated but if I read it correctly then I would expect this code in mtes

Re: Reflection: how does one access a protected member in a superclass reflectively?

2018-01-16 Thread Alan Bateman
On 16/01/2018 13:50, Rony G. Flatscher wrote: The excercise here is as follows: * there are classes in "mod_A" which get extended in "mod_B" and once more extended in "mod_C". * Hence "mod_B" requires "mod_A", and "mod_C" requires "mod_B", where "mod_B" exports to "mod_C" only * Th

Re: Reflection: how does one access a protected member in a superclass reflectively?

2018-01-17 Thread Alan Bateman
On 17/01/2018 12:18, Rony G. Flatscher wrote: : The reflection logic in the bridge is (simplified) as follows: * use the object's 'o' class and look up its declared methods or fields, analyze further, if member is 'public', otherwise o iterate over all of its superclasses looking u

Re: Reflection: how does one access a protected member in a superclass reflectively?

2018-01-17 Thread Alan Bateman
On 17/01/2018 18:53, Rony G. Flatscher wrote: : Not with Java 9 javac, the following Java program: public class TestUse {     public static void main (String args[]) {     mtest3.Class03A o=new mtest3.Class03A();     System.out.println("o: "+o+", myClassName: "+o.m

Re: Reflection: how does one access a protected member in a superclass reflectively?

2018-01-18 Thread Alan Bateman
On 17/01/2018 18:53, Rony G. Flatscher wrote: : Would you have concrete suggestions for this use-case, i.e. a framework that is not part of a module, but having a need to access public types from exported packages and get reflective access to objects supertype's protected members? I think it

Re: [10] RFR JDK-8194229: tools/jmod/JmodTest.jtr fails when no privilege to create sym link on windows

2018-01-18 Thread Alan Bateman
On 18/01/2018 19:35, mandy chung wrote: This is a simple test-only fix. IOException may be thrown when a symlink is failed to create on windows. The test should handle such case in addition to UOE. Webrev at: http://cr.openjdk.java.net/~mchung/jdk10/webrevs/8194229/webrev.00/ Looks okay to me

Re: Unsafe and JPMS

2018-01-19 Thread Alan Bateman
Moving this thread to jigsaw-dev as that is where this topic has been discussed ad nauseam. On 19/01/2018 01:28, Jeremy Manson wrote: Hey folks, I know this has come up before, but I wanted to revive the question. As we play more and more with JPMS and Java 9, we're finding more and more plac

Re: Reflection: how does one access a protected member in a superclass reflectively?

2018-01-19 Thread Alan Bateman
On 18/01/2018 15:07, Rony G. Flatscher wrote: An attachment in the email has been found to contain executable code and has been removed. File removed : java9modules.zip, zip,cmd Dear Alan: tried to come up with a "cleane

Re: Unsafe and JPMS

2018-01-19 Thread Alan Bateman
On 19/01/2018 18:31, Jeremy Manson wrote: : 1) testStaticsDiscovery(com.google.common.profile.HeapInspectorTest)java.lang.reflect.InaccessibleObjectException: Unable to make field final jdk.internal.loader.URLClassPath jdk.internal.loader.ClassLoaders$AppClassLoader.ucp accessible: module ja

Re: Unsafe and JPMS

2018-01-20 Thread Alan Bateman
On 20/01/2018 00:07, Jeremy Manson wrote: : The other place I saw that this came up is the cglib code generation library, which now uses Unsafe to access ClassLoader.defineClass (for any ClassLoader).  This is useful for generating classes for dependency injection / mocking / that kind of thi

Re: Reflection: how does one access a protected member in a superclass reflectively?

2018-01-22 Thread Alan Bateman
On 22/01/2018 09:58, Peter Levart wrote: : The 2nd problem is not trivial as you want to access a protected member on behalf of some other sub-class of the member's declaring class which is not cooperating (voluntarily handing you an instance of its Lookup object). This currently requires the

Re: Reflection: how can one access public fields (members) in a superclass ?

2018-01-24 Thread Alan Bateman
On 23/01/2018 14:52, Rony G. Flatscher wrote: Given three modules (sources at the end) where * "mod_A" exports its package "mtest1", to everyone * "mod_B" requires "mod_A" and exports its package "mtest2" to "mod_C" * "mod_C" requires "mod_B" and exports its package "mtest3" to everyone

Re: p example (Re: Reflection: how can one access public fields (members) in a superclass ?

2018-01-24 Thread Alan Bateman
On 24/01/2018 15:42, Rony G. Flatscher wrote: OK, now add to this the following class that uses p.C2 objects to access e.g. m() via it: G:\xfer\java9modules\03-20180124-AlanBatmanP\p>type UseC2.java public class UseC2 {     public static void main (String args[]) {   

Re: [11] RFR JDK-8196310: jlink --suggest-providers fails with missing resource if --output specified

2018-01-30 Thread Alan Bateman
On 31/01/2018 00:31, mandy chung wrote: (resend with fixed formatting) Webrev: http://cr.openjdk.java.net/~mchung/jdk11/webrevs/8196310/webrev.00/ Improve the error message when invalid argument is specified to --suggest-providers option. $ jlink --add-modules java.base --suggest-providers

Re: OpenJDK 10 and Oracle JDK10 doesn't have the same default modules

2018-02-04 Thread Alan Bateman
On 04/02/2018 11:30, Remi Forax wrote: Hi all, it seems that the OpenJDK 10 and OracleJDK 10 doest not declare the same set of default modules, so java --add-modules ALL-DEFAULT do not behave the same way :( With Oracle JDK 10 b42, module java.scripting is part of the default modules https://tr

Re: OpenJDK 10 and Oracle JDK10 doesn't have the same default modules

2018-02-04 Thread Alan Bateman
On 04/02/2018 12:45, Christian Stein wrote: : It's an automatic module. And it does run "as-is" on Oracle JDK, using ALL-MODULE-PATH. Here is the actual command: java --module-path   bin/bach/target/classes/test:bin/bach/modules --add-modules   ALL-MODULE-PATH --module   org.junit.platform.c

Re: OpenJDK 10 and Oracle JDK10 doesn't have the same default modules

2018-02-04 Thread Alan Bateman
On 04/02/2018 14:58, Christian Stein wrote: : It's module ' jdk.deploy' in Oracle JDK: [...] jdk.deploy requires java.scripting jrt:/java.scripting [...] https://travis-ci.org/sormuras/beautiful_logger/jobs/337219688#L660 OpenJDK does not ... deploy that one: https://travis-ci.or

Re: Module resource as seekable byte channel?

2018-02-04 Thread Alan Bateman
On 04/02/2018 13:31, Mark Raynsford wrote: Hello. I'm working on a problem that would seem to require accessing a (large) resource included inside a module in random manner. More specifically, I have some large audio resources inside a module and need to be able to get something analogous to a S

Re: ClassLoader.getResources(String)

2018-02-07 Thread Alan Bateman
On 07/02/2018 14:23, Stephen Colebourne wrote: I've been trying to use ClassLoader.getResources(String). The entire application is in one named module, this includes the code that invokes the ClassLoader method and the resource that it is trying to find. Can you summarize what you are trying to d

Re: ClassLoader.getResources(String)

2018-02-07 Thread Alan Bateman
On 07/02/2018 16:56, Stephen Colebourne wrote: : I was using maven to create a jar-with-dependencies file, so I could use jlink. With all the code in one jar file, there shouldn't be any access barriers to worry about. ClassLoader.getResources(String) worked just fine until Java 9. The two APIs

Re: RFR JDK-8170114 jimage extract to not an empty directory overwrites content of the directory

2018-02-09 Thread Alan Bateman
On 09/02/2018 15:23, Michal Vala wrote: Hi, sending fix for jimage bug JDK-8170114[1]. I'm not sure whether this is correct list. If it is not, please direct me somewhere else. I don't have an openjdk account, so webrev is on my fedora public space. I will need a sponsor for this. webrev:

Re: RFR JDK-8170114 jimage extract to not an empty directory overwrites content of the directory

2018-02-10 Thread Alan Bateman
On 10/02/2018 00:04, mandy chung wrote: On 2/9/18 7:23 AM, Michal Vala wrote: Patch validates output directory before any jimage extracting happen. I've moved validation to extra private method as it is few lines of code. I've also added proper error message for case when output path is no

Re: Loading resource bundles across module boundaries

2018-02-11 Thread Alan Bateman
On 11/02/2018 15:31, Nicolai Parlog wrote: : I interpreted this to mean that, without registering services, named modules can only load bundles from themselves. But in my experiments I could also load resource bundles from other modules as long as the package containing them was open. Did I ma

Re: IllegalAccessException trying to load a ResourceBundle in 9u181

2018-02-13 Thread Alan Bateman
On 13/02/2018 13:03, Vitaly Davidovich wrote: : So I tried calling getBundle(..., Object.class.getModule()), and that worked - great. Interestingly, I didn't have to add-opens (or add-export for that matter). Is that expected? It works because the sun.security.util.AuthResources resource bun

Re: IllegalAccessException trying to load a ResourceBundle in 9u181

2018-02-13 Thread Alan Bateman
On 13/02/2018 14:05, Vitaly Davidovich wrote: Right, thanks Alan.  While we're on the subject, when do you expect java.base to be fully encapsulated? TBD.

Re: JDK-8170120 jimage IOException solution?

2018-02-16 Thread Alan Bateman
On 16/02/2018 13:03, Michal Vala wrote: Hi, I'm working on JDK-8170120[1]. I have 2 working solutions, but I'm not happy with neither one. That IOException is thrown from jdk.internal.jimage.BasicImageReader, which is in java.base module. Jimage is implemented in jdk.jlink module (jdk.tools

Re: JDK-8170120 jimage IOException solution?

2018-02-16 Thread Alan Bateman
On 16/02/2018 13:35, Michal Vala wrote: : Sure I can do that. However, all output messages are defined at jimage.properties (jdk.jlink module) file and this won't be possible for this case. I can't tell whether IOExcaption is caused by wrong jimage file or something else so all I can do is re

Re: JDK-8170120 jimage IOException solution?

2018-02-16 Thread Alan Bateman
On 16/02/2018 14:39, Michal Vala wrote: : That sounds reasonable. Here's the webrev: http://cr.openjdk.java.net/~shade/8170120/webrev.01/ It fixes JImageVerifyTest so I've removed it from ProblemList. note: JImageExtractTest still failing on not-empty-dir(JDK-8170114) and JImageListTest fa

Re: JDK-8170120 jimage IOException solution?

2018-02-19 Thread Alan Bateman
On 19/02/2018 12:09, Michal Vala wrote: Yes, true. Attached. This looks good except the "does not exist" case which needs this change: -    throw TASK_HELPER.newBadArgs("err.not.a.jimage", file.getName()); +    throw TASK_HELPER.newBadArgs("err.not.a.jimage", file);

Re: RFR 8194922: jlink --exclude-resources should never exclude module-info.class

2018-02-19 Thread Alan Bateman
On 19/02/2018 16:12, Sundararajan Athijegannathan wrote: Please review. Webrev: http://cr.openjdk.java.net/~sundar/8194922/webrev.00/ Bug: https://bugs.openjdk.java.net/browse/JDK-8194922 I assume it should be testing the resource name with equals rather than endsWith. I also wonder if jlink sh

Re: RFR - JImageListTest test fix

2018-02-19 Thread Alan Bateman
On 19/02/2018 14:51, Michal Vala wrote: Hi, sending patch fixing JImageListTest failing tests. It was in ProblemList and this fix greens the test case, so the patch also removes it from the list. It will probably need new bug id and I will need a sponsor for this. Fix itself is simple. There

Re: RFR JDK-8170114 jimage extract to not an empty directory overwrites content of the directory

2018-02-19 Thread Alan Bateman
On 19/02/2018 14:02, Michal Vala wrote: Hi, On 02/09/2018 04:23 PM, Michal Vala wrote: Hi, sending fix for jimage bug JDK-8170114[1]. as this was resolved with current behavior is correct[1], I've updated test case according to this behavior. Patch attached. This also greens JImageExtrac

Re: RFR 8194922: jlink --exclude-resources should never exclude module-info.class

2018-02-20 Thread Alan Bateman
On 20/02/2018 08:08, Sundararajan Athijegannathan wrote: Updated: http://cr.openjdk.java.net/~sundar/8194922/webrev.01/ * replaced endsWith with equals on $MODULE/module-info.class * jlink shows warning when module-info.class is not included (but implied to be excluded by --exclude-resources p

Re: RFR - JImageListTest test fix

2018-02-20 Thread Alan Bateman
On 19/02/2018 14:51, Michal Vala wrote: Hi, sending patch fixing JImageListTest failing tests. It was in ProblemList and this fix greens the test case, so the patch also removes it from the list. These tests are failing on Windows now. Nothing to do with your changes, it seems the original

Re: RFR 8194922: jlink --exclude-resources should never exclude module-info.class

2018-02-20 Thread Alan Bateman
On 20/02/2018 09:50, Sundararajan Athijegannathan wrote: Throwing exception now -> http://cr.openjdk.java.net/~sundar/8194922/webrev.02/ This looks good to me. -Alan

Re: JDK-8198405 - JImageExtractTest.java & JImageListTest.java failed in Windows

2018-02-21 Thread Alan Bateman
On 21/02/2018 12:23, Michal Vala wrote: Hi, I'm trying to investigate failure of JImageExtractTest on Windows. Failing method is testExtractToReadOnlyDir, issue is simple. It is trying to extract jimage to read-only directory and it must fail. AFAIK it is not possible to create read-only direc

Re: Finding module-info.class without loading a jar

2018-02-23 Thread Alan Bateman
On 23/02/2018 19:18, Mark Raynsford wrote: Hello. I'm analyzing the contents of jar files and basically need to answer the question "is this jar file modularized?". To do this, I search for a module-info.class file in the root of the jar file (and parse it with ASM), or I look for an Automatic-M

Re: [JDK 11] Problem list tools/jimage/JImageExtractTest.java for macosx-all

2018-02-28 Thread Alan Bateman
On 28/02/2018 08:53, Amy Lu wrote: Please review the patch to problem list tools/jimage/JImageExtractTest.java for macosx-all. This test fails frequently (observed at Mac) and should be problem listed before JDK-8198819 fixed. bug: https://bugs.openjdk.java.net/browse/JDK-8198820 webrev: h

Re: suggested document enhancement

2018-03-02 Thread Alan Bateman
On 02/03/2018 09:22, Bernard Amade wrote: Hello all since my job is to write java tutorials I have to confess I am lost on some topics about the module system. Here is a first concern: - I used to teach to deploy resources in an additional jar at deploy time - so if a code requesting a resource

Re: Main class in jar

2018-03-05 Thread Alan Bateman
On 05/03/2018 09:54, Bernard Amade wrote: Hello all the doc in https://docs.oracle.com/javase/9/docs/specs/jar/jar.html lists for Main-Class entry in jars: "attribute defined for stand-alone applications: This attribute is used by stand-alone applications that are bundled into executable jar fil

Re: Main class in jar

2018-03-05 Thread Alan Bateman
On 05/03/2018 10:43, Bernard Amade wrote: thanks for your help just curious about this internal information: --- "ModuleMainClass" attribute. Note that this is a class file attribute, not an attribute that you put in the main manifest of a JAR fi

Re: Main class in jar

2018-03-05 Thread Alan Bateman
On 05/03/2018 13:58, Gregg Wonderly wrote: Will java -jar note that the argument is a module and help the user understand how to invoke it, or will it just complain about a missing main-class: attribute? From a practical perspective, why does it matter and demand a different command line? Wh

Re: java.beans package in java.desktop module

2018-03-06 Thread Alan Bateman
On 06/03/2018 13:52, Guillaume Smet wrote: Hi, (Previously sent via an unsubscribed email address, sorry about that) The java.beans package is part of the java.desktop module which is a bit unfortunate as the package contains quite a few classes useful to manipulate beans and dragging all the d

Re: ClassLoader.getResources(String)

2018-03-07 Thread Alan Bateman
On 07/03/2018 12:11, Stephen Colebourne wrote: Following up on this, it does feel like the use case is now simply not possible. I have a similar problem with ClassLoader.getResources(String) in threeten-extra. https://github.com/ThreeTen/threetenbp-extra/blob/master/src/main/java/org/threeten/

Re: ClassLoader.getResources(String)

2018-03-07 Thread Alan Bateman
On 07/03/2018 15:14, Stephen Colebourne wrote: : Configuration and code are two very different things. Asking projects and end users to write code for something that should be config is a huge no-no. My view is that JPMS has made using configuration files, especially for libraries, a lot harder.

Re: why is modularity changing the rules of inheritance?

2018-03-13 Thread Alan Bateman
On 13/03/2018 09:23, Bernard Amade wrote: now if in module B you just create a Service by inheriting from this class: - the className is correct (an instance of the class has been created for the service) - you can't invoke newInstance from that very class!(if the class is not opened or expor

Re: RFR 8193033 remove terminally deprecated sun.misc.Unsafe.defineClass

2018-03-15 Thread Alan Bateman
On 15/03/2018 17:06, Paul Sandoz wrote: Hi, Please review this patch to remove sun.misc.Unsafe.defineClass in 11. There has been much outreach, by Alan and the Jigsaw team, about its public replacement MethodHandles.Lookup.defineClass. CSR is here: https://bugs.openjdk.java.net/browse/JDK

Re: Accessing internals in Java 11

2018-03-25 Thread Alan Bateman
On 25/03/2018 08:32, Nicolai Parlog wrote: Hi! On Java 9 and 10, the JPMS is forgiving when it comes to illegal access of JDK internals and jdk.unsupported offers classes like Unsafe or Signal. The same is true for 11-b5. Are there any plans to change this, i.e. will Java 11 become stricter b

Re: The baby and the bathwater

2018-03-27 Thread Alan Bateman
On 27/03/2018 08:15, Cédric Champeau wrote: Dual testing is a minimum. In practice, it depends on the kind of tests. Typically, before JDK 9 for unit tests you never needed a jar to execute unit tests. Maven happens to built it, but in practice a class directory + resources is enough This hasn't

Re: The baby and the bathwater

2018-03-27 Thread Alan Bateman
On 27/03/2018 10:04, Remi Forax wrote: : with the limitation that you can not patch a module-info so if you have testing-only dependencies like JUnit and you want to run them in module-mode, you have to generate a jar. The --add-reads option is used to augment the module to read junit or othe

Re: Deprecated attribute in module-info.class?

2018-03-29 Thread Alan Bateman
On 29/03/2018 15:36, Stephan Herrmann wrote: I'm looking at jdk.xml.bind/module-info.class from JDK 9.0.4. I do find a RuntimeVisibleAnnotation attribute representing   @java.lang.Deprecated(since="9", forRemoval=true) but I don't find a Deprecated attribute. Is this intended? JVMS 4.7.15 neith

Re: Avoiding sun.misc.Unsafe and embracing modules in Java libraries: missing links

2018-04-09 Thread Alan Bateman
On 01/04/2018 22:02, Rafael Winterhalter wrote: : 1. Java agents cannot define auxiliary classes. : The reason for using Unsafe is that many instrumentations need to define auxiliary classes to aid an instrumentation similar to javac which sometimes needs to define anonymous classes or even syn

Re: Avoiding sun.misc.Unsafe and embracing modules in Java libraries: missing links

2018-04-10 Thread Alan Bateman
On 09/04/2018 20:48, Rafael Winterhalter wrote: Hei Alan, maybe I am doing it wrong but this is my example. I created a module with two interfaces bar.Bar and qux.Qux that both define a default method String foo() { return "foo"; }. The module exports bar and exports and opens qux. From anoth

Re: Avoiding sun.misc.Unsafe and embracing modules in Java libraries: missing links

2018-04-11 Thread Alan Bateman
On 10/04/2018 12:15, Rafael Winterhalter wrote: Thanks for the reference. As for the proxy API, I think that this should be reworked anyways as the lookup on each call would be rather expensive. In the mean-time, I think you should be able to make progress with findSpecial for the common case

Re: Avoiding sun.misc.Unsafe and embracing modules in Java libraries: missing links

2018-04-12 Thread Alan Bateman
On 11/04/2018 21:07, Rafael Winterhalter wrote: I do not think that this is possible. If the module containing the interface does not open a package, I cannot change the privileges of the main module such that I can resolve a method handle for invoking the special invocation. I just tried thi

Re: RFR: 8187490: HotSpotRuntimeMBean should be moved to Graal management module

2018-04-12 Thread Alan Bateman
On 12/04/2018 19:24, Doug Simon wrote: Please review this change that removes the existing Graal service provider for hooking into the Platform MBean Server and makes jdk.internal.vm.compiler.management an upgradeable module. Please refer to https://bugs.openjdk.java.net/browse/JDK-8187490?fo

Re: Provides clauses in binary module descriptor but not in source

2018-04-13 Thread Alan Bateman
On 13/04/2018 13:16, Doug Simon wrote: I just noticed that in the jdk.internal.vm.compiler module descriptor source there is a `uses` clause for CompilerConfigurationFactory[1] but no `provides` clause for the CoreCompilerConfigurationFactory provider[2] which is in the same module. However, `

Re: RFR: 8201794: [Graal] fix regressions from JDK-8187490

2018-04-18 Thread Alan Bateman
On 18/04/2018 12:00, Doug Simon wrote: I've updated the webrev with a fix for another regression caused by JDK-8187490: --- old/test/jdk/jdk/modules/etc/UpgradeableModules.java2018-04-18 12:57:32.0 +0200 +++ new/test/jdk/jdk/modules/etc/UpgradeableModules.java2018-04-18

Re: RFR: 8202583: Remove experimental ClassForNamePlugin

2018-05-07 Thread Alan Bateman
On 07/05/2018 14:23, Claes Redestad wrote: Hi, the --class-for-name jlink plugin was added as an experiment to test and evolve the jlink plugin infrastructure. The actual effect of enabling this plugin on standard images is very limited (only a handful of Class.forName:s are replaced) and tur

  1   2   3   4   5   6   7   8   9   10   >