Fwd: Why can modules not be annotated?
mark.reinhold at oracle.com
mark.reinhold at oracle.com
Mon Feb 22 19:34:17 UTC 2016
2015/12/11 8:58 -0800, Paul Benedict <pbenedict at apache.org>:
> Since we've already seen the creep towards generating the Module Descriptor
> at build time, I think the area of tooling should not be neglected. Given
> that Oracle wants one file to express the module declaration, that doesn't
> mean Oracle can't help the tooling community by providing some standard
> annotations.
>
> In particular:
>
> *) Create @javax.tools.Export annotation that is @Target(PACKAGE) and
> @Retention(SOURCE) to avoid competing frameworks from providing their own.
> This is going to happen if Oracle doesn't. Notice I am recommending it be
> placed in "javax.tools" to indicate tooling support, and, it's discarded by
> the compiler. The latter will prevent any confusion about it existing in
> the binary.
>
> *) Allow annotations on the module to express the custom attributes that
> you've spec-ed out.
>
> I advocate this as a happy medium. There are three wins in this proposal:
> 1) The module declaration is fully self-expressible in one file (as-is
> today)
> 2) Tools have a standard way of generating the exports list from packages
> 3) Tools have a standard way of customizing the module declaration at the
> source level
>
> I would like the EG to consider my proposal for the sake of tooling and
> automatic code generation.
Can you please clarify exactly what it is that you propose?
Do you want standard annotations in module-info.class files to repeat
the information presently encoded in attributes in such files? Or do
you want annotations to replace those attributes? Or something else?
- Mark
More information about the jpms-spec-comments
mailing list