Unnamed module .. singular or plural?

mark.reinhold at oracle.com mark.reinhold at oracle.com
Wed Jul 13 18:22:41 UTC 2016


2016/7/13 9:53:04 -0700, pbenedict at apache.org:
> 1) I think 5.4 clearly contradicts 3.1 on the surface. I don't think it
> serves readers any good (it didn't me) to first assert there is just "one
> unnamed module" and then, if you keep on reading to the advanced topics,
> find out there's many unnamed modules. If you don't mind an editorial
> suggestion, it's better to state the fact up-front, and then note to the
> reader that 3.1 just deals with the case of one. Thanks.

This was an explicit rhetorical choice on my part.

There are many audiences for this document, which is meant to be an
overview rather than a specification.  Many non-experts will only read
the first few sections, and there are already so many new concepts in
flight that bringing in the notion of multiple unnamed modules could
just be too much.  I expect experts, by contrast, to read the entire
document, and then not be unduly shocked when they learn that I lied
earlier on.  So far, you're the first person to complain about this.

> 2) Can you please confirm the following? If ClassLoader A has type
> com.domain.X in its unnamed module, and ClassLoader B has type com.domain.X
> in its unnamed module, and B is a child of A, it's possible developers may
> still end up getting the wrong X class instance. This example alludes to
> the common EE problem commonly manifested as a ClassCastException (e.g.,
> type X can't be cast to type X). So using unnamed modules in an EE server,
> this situation still remains, right?

Yes.  To do anything else would be incompatible.

> 3) Somehow all the unnamed modules must collapse (in notion) to represent a
> virtual class path. Even if they are not "the class path" as specified on
> the command line, all these unnamed modules function as such. Every type in
> every the unnamed modules has all their types exported .... so they are
> just amended to "the class path"? Am I correct?

No.  There is no collapsing or unification of class paths.  The class
path on the command line, if specified, is searched by the application
class loader, but not by any other built-in loader.  Other loaders
could, theoretically, search that path too, but that's entirely up to
their authors.

- Mark


More information about the jigsaw-dev mailing list