Fwd: Why can modules not be annotated?

Paul Benedict pbenedict at apache.org
Fri Dec 11 16:58:28 UTC 2015


Here's a different spin on things...

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

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
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.


---------- Forwarded message ----------
From: <mark.reinhold at oracle.com>
Date: Wed, Dec 9, 2015 at 7:25 PM
Subject: Re: Why can modules not be annotated?
To: peter.kriens at aqute.biz
Cc: jpms-spec-experts at openjdk.java.net

2015/10/12 9:56 -0700, peter.kriens at aqute.biz:
> I understand the trade offs.
> That said, I am a bit curious how we are going to handle the
> discussing these trade offs in the design? I had actually expected
> that more things were set in stone but in this discussion it seems
> there are still some open areas. Are we going to have phone
> conferences, a face to face?

As stated in the original JSR, this EG will work exclusively via e-mail,
on this list.

I will soon start gathering a list of open issues for us to discuss and
work through before publishing the EDR.

> Anyway, thanks for all the responses. It did clarify things for me.

Glad to hear it.

- Mark

More information about the jpms-spec-comments mailing list