hg: jigsaw/jigsaw/jdk: Remove module annotation support
Jesse Glick
jesse.glick at oracle.com
Fri Jan 27 14:29:26 PST 2012
On 01/27/2012 05:02 PM, Alex Buckley wrote:
> It doesn't mention it because it doesn't need to. The limit of the Java language is the CompilationUnit production. A compiler is free to parse text outside that
> production and store it in a ModuleData attribute.
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
>> how would such things be checked for syntax or
>> semantics? How would different tools avoid clobbering each other's
>> metadata?
>
> They won't be checked for syntax or semantics because they're not part of the Java language or module system. See
> http://openjdk.java.net/projects/jigsaw/doc/draft-java-module-system-requirements-12#extensible-module-declarations.
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.
More information about the jigsaw-dev
mailing list