hg: jigsaw/jigsaw/jdk: Remove module annotation support
Alex Buckley
alex.buckley at oracle.com
Fri Jan 27 14:38:11 PST 2012
On 1/27/2012 2:29 PM, Jesse Glick wrote:
> This is bizarre. You cannot append random text to the end of regular
> Java source files.
>
> X.java:1: error: class, interface, or enum expected
> class X {} hello world!
> ^
> 1 error
In deference to the module system's requirement for extensible metadata,
javac chooses to allow extra text in a file when a CompilationUnit
contains a module declaration. You can guess how it stores such text in
a class file.
> There needs to be some convention or guideline for other tools to be
> able to cooperatively edit such metadata. Otherwise it is rather useless
> - you could not even tell for sure what kind of tool is doing the
> extending and add your own separate metadata! Annotations with an
> extension of 269 would offer fully validatable extensibility consistent
> with the rest of the Java language, but even something as simple as
> /([^:]+: .*\n)*/ key-value pairs (like JAR manifests) would be far
> better than this.
As ever, Jesse, we understand all this. Since the requirement for the
syntax of a module declaration (and therefore its extensibility) is
open, we have chosen to proceed down a particular path in the
implementation.
Alex
More information about the jigsaw-dev
mailing list