hg: penrose/penrose: 1. Update Penrose demos to support JSON format module info.

Paul Sandoz paul.sandoz at oracle.com
Wed Jul 4 10:45:23 PDT 2012


Hi,

On Jul 4, 2012, at 4:42 PM, David Bosschaert wrote:

> Hi Shi Jun,
> 
> On 4 July 2012 12:04, David Bosschaert <david.bosschaert at gmail.com> wrote:
>> On 4 July 2012 07:36, Shi Jun Zhang <zhangshj at linux.vnet.ibm.com> wrote:
>>> 2. Error message is not clear enough. I typed "jdk.desktip" by mistake in
>>> requires section in modulebrowser, and then I got an error said
>>> "modulebrowser cannot be solved" when installing the module into module
>>> library. It should tell "jdk.desktip cannot be solved" instead.
>> 
>> Thanks - I'll look into that.
> 
> Actually this is more of an issue for the Jigsaw resolver. It should
> report better why a module cannot be resolved, so let's say
> com.greetings.json has a dependency that isn't found, it simply
> reports this:
> 
> org.openjdk.jigsaw.ConfigurationException: com.greetings.json@=0.1:
> Cannot resolve
> 	at org.openjdk.jigsaw.Resolver.fail(Resolver.java:91)
> 	at org.openjdk.jigsaw.Resolver.run(Resolver.java:460)
> 	at org.openjdk.jigsaw.Configurator.configure(Configurator.java:144)
> 	at org.openjdk.jigsaw.Configurator.configure(Configurator.java:204)
> 	at org.openjdk.jigsaw.SimpleLibrary.configureWhileModuleDirectoryLocked(SimpleLibrary.java:1720)
> 	at org.openjdk.jigsaw.SimpleLibrary.installFromManifests(SimpleLibrary.java:1154)
> 	at org.openjdk.jigsaw.cli.Librarian$Install.go(Librarian.java:207)
> 
> If the resolver would give a better error message that would resolve
> your issue.

Yes, another TODO :-) Very important to make such errors as a clear and meaningful as possible.

In the interim if you set the JIGSAW_TRACE environment variable e.g.:

 export JIGSAW_TRACE=1000

you will see tracing output from the resolver.


> The resolver is independent from the JSON module metadata,
> because the module metadata is internally represented in the same way,
> regardless of whether it was read from a module-info.json or a
> module-info.class file.
> 
> With the module-info.java you get this warning earlier, during the
> javac process as it converts the .java file into a .class file. The
> .json file does not need to be compiled, but it would be good if the
> javac compiler could validate it in the future. BTW the error message
> from javac doesn't tell you why the resolution failed either right
> now...
> 

The resolver will also be used by javac, so i would expect an error when compiling such a module.

Was the JSON module declaration modified after compilation?

Paul.



More information about the penrose-dev mailing list