On ecj and @Override annotations for interface methods
Joseph D. Darcy
Joe.Darcy at Sun.COM
Thu Sep 18 07:21:49 PDT 2008
Mark Wielaard wrote:
> On Thu, 2008-09-18 at 13:41 +0200, Mark Wielaard wrote:
>> On Thu, 2008-09-18 at 23:37 +1200, C. K. Jester-Young wrote:
>>> On Thu, Sep 18, 2008 at 01:33:27PM +0200, Mark Wielaard wrote:
>>>> There is no -source 1.6 option, there were no language changes between
>>>> 1.5 and 1.6, only target changes. (Although -source 1.5 will trigger
>>>> -target 1.5, which is why it makes a difference compared to not giving
>>>> any -source option.)
>>> There is, for the ecj that comes with Ubuntu 8.04 ("Eclipse Java
>>> Compiler v_774_R33x, 3.3.1"). It makes a difference between whether
>>> @Override annotations are accepted for interface methods; in fact,
>>> that's why I started this thread in the first place. :-)
>> O, that is super confusing, since openjdk javac explicitly says -source
>> 1.6 is not a valid option. hmmm.
> OK, I checked, and it seems openjdk6 javac, actually does accept -source
> 1.6, this will trigger -target 1.6 though (which I don't think is a good
> thing for bootstrapping against other free VMs). javac documentation
> however explicitly says:
> -source release
> Specifies the version of source code accepted. The following
> values for release are allowed:
> The compiler does not support assertions, generics, or
> other language features introduced after JDK 1.3.
> The compiler accepts code containing assertions, which were
> introduced in JDK 1.4.
> The compiler accepts code containing generics and other
> language features introduced in JDK 5. This is the default.
> 5 Synonym for 1.5
> Note: No language changes were introduced in JDK 6, so the values
> 1.6 and 6 are not valid.
Where are you seeing this documented? The information is not correct
and other sources give the correct information:
> Also you cannot combine -source 1.6 and -target 1.5:
> javac: source release 1.6 requires target release 1.6
> I don't know a good way out of this mess. Maybe for icedtea1.7 we should
> just require a compiler and runtime that supports both -source and
> -target 1.6, but keep icedtea6 on 1.5 to ease bootstrapping with
> existing (older) free platforms.
> This however doesn't help with our problem that there apparently isn't
> any public documentation on all this (neither the source language
> changes, not the target byte code changes). Luckily we do now have the
> sources though.
Compared to 1.5 the only "language change" in 1.6 is to allow @Override
on methods from interfaces:
In javac, 1.6 triggers rejecting files with encoding errors.
More information about the distro-pkg-dev