PRE-PROPOSAL: Source and Encoding keyword
reinier at zwitserloot.com
Sun Mar 15 19:14:42 PDT 2009
Well, source language compatibility isn't the same thing as a library
java.core would refer to the runtime library.
source would refer to the JLS interpretation used to compile the file.
These are rather unrelated. The java.core dependency is something that
the JVM needs to sort out. The 'source' keyword isn't even in the
class file; the JVM wouldn't even know what it means.
Consider the differences between the -source and the -target options
for javac for another example of the difference.
It might be a nice idea to allow javac to peek at the module-info file
to look for a source compatibility level as well, but I can't add it
to a proposal without a rigid spec on jigsaw and the modules JSR.
It might be possible to dress up the 'source' keyword functionality as
a library dependency in the modules JSR syntax, but wouldn't that just
add more confusion?
On Mar 16, 2009, at 02:23, Mark Mahieu wrote:
> Alex Buckley's slides on the modules JSR (http://blogs.sun.com/abuckley/resource/Devoxx2008-ModularityInJava.pdf
> ) show examples of specifying a required module version, including
> things like "java.core @ 1.7". Presumably things like java.lang and
> javax.lang.model will sit somewhere in this versioned module system,
> so wouldn't that be a more suitable way to approach this?
> I mean, why add yet another place to specify the version?
> 2009/3/16 Reinier Zwitserloot <reinier at zwitserloot.com>
> As I've mentioned at least twice on coin-dev already, the JLS only
> needs to specify how the 'source' keyword sets the 'source' property
> of the CompilationUnit that contains the source keyword. As far as the
> JLS is concerned, this is a string value that has no further meaning.
> It's a bit like a comment in this sense. To be crystal clear: ** The
> JLS will NOT specify what is supposed to happen when you write "source
> 1.1;" in a JLSv3 view of the source file! **
More information about the coin-dev