is ClassLoader.loadClass() supposed to work on module-info classes?
pbenedict at apache.org
Thu Dec 3 16:14:18 UTC 2015
Alex, thank you for your thoughtful responses. Some comments in return:
> Now we reach the disagreement. We don't think the module declaration will
> be as fluid as you do. Yes, frameworks and other tools will want to modify
> module declarations (usually by addition of dependencies or exports) but
> that's a handful of actors, all of whom are perfectly capable of using ASM.
> 99.99% of humans have no business modifying someone else's module
> declaration by hand, so there is no reason for it to be easy.
For various reasons, I've sometimes had to edit Manifest files. Either I
needed some human knowledge, it specified something wrong needing a fix, or
I wanted to add information. I want to understand your perspective better.
Would you prefer Manifests to be a compiled manifest-info.java if it was
"green field development" today? I don't find editing the Manifest to be
out of my business; I am curious why you think the same for modules.
> A module declaration configures code -- "exports" determines the
> accessibility of types.
Understood. I am still pondering that decision while information and
experience rolls in. David Llyod provided an alternative proposal that has
gone unchallenged as of yet. It's very well written and precise. I am not
sure if the non-Oracle EG members are waiting for a finished prototype
before discussing things at large, but I have open ears waiting for what
other experts think.
> Sure, you could configure accessibility with @Exported on public type
> declarations, and configure the build-time and run-time environment with a
> module.xml file. But if we're going to introduce the concept of a module to
> millions of Java developers, we see value in consolidating both kinds of
> configuration in one place -- a place that's fluid during development and
> not very fluid thereafter.
@Exported would directly tie a package and configuration together. That's a
plus. In fact, I prefer that for the reason I prefer annotations (i.e., the
1:1 code/configuration). However, I am assuming that an exported package is
forever exported -- no one can undo my export, right? If so, I prefer the
annotated solution; otherwise I prefer an external configuration (currently
the Module Descriptor).
Anyway, I'll continue reading the mailing list here to see how others opine.
More information about the jigsaw-dev