Questions about jigsaw API
Alan Bateman
Alan.Bateman at oracle.com
Tue Jan 24 07:39:43 PST 2012
On 24/01/2012 13:37, Mike Ershov wrote:
> Hello,
>
> I'm adapting sigtest tool ( sigtest.java.net ) to jigsaw and have some
> questions about jigsaw API:
>
> 1) I need to read class bytes for any particular class and all its
> dependencies. In other words for module com.acme.mod at 3.1 I have to
> analyze com.acme.mod at 3.1's classes, their superclasses from other
> com.acme.* modules recursively and their platform superclasses including
> java.lang.Object. Maybe I missed something but I can't find easy way to
> do it. So I resolve all dependencies manually. This is my the main
> question. I very appreciate any recommendations.
Does com.acme.mod at 3.1 have an entry point? -- just asking that as maybe
all you need to do is read its configuration and that will give you the
set of contexts and in turn the set of modules. Alternatively you can
run the resolver and generate the configuration (which may be what you
are doing now?).
>
> 2) org.openjdk.jigsaw.Library byte[] readClass(ModuleId mid,
> java.lang.String className) according to the javadoc "reads the class
> bytes of the given class within the given module, in this library or in
> a parent library." But actually it doesn't read a parent library. Please
> correct the description or, better, add this functionality.
This should work.
>
> 3) I expected that
> SimpleLibrary.openSystemLibrary().readClass(Platform.bootModule(),
> "java.lang.Object") returns Object's bytes. It returns null because
> Platform.bootModule() is "jdk.base at 8-ea" instead of "jdk.boot at 8-ea".
The jdk.boot/jdk.base issue will go away once the views/exports work is
pushed.
>
> 4) I noticed that public org.openjdk.jigsaw.LoaderPool has no public
> constructors. If there is no reasons for such design it's better to do
> it not public ( like LibraryPool ) or make them all public.
Can you explain what you are looking to do?
-Alan.
More information about the jigsaw-dev
mailing list