Hi Jacek,

Apologies that comment possibly was a bit cryptic.

@Override exists in Java 5. However, the usage of @Override on a method that 
implements a method of an interface rather than overwriting a method in a base 
class is a Java 6 addition. In Java 5 that usage of @Override is not allowed, 
which is why a jdk 1.5 compiler actually fails to compile util. A jdk 1.6 
compiler on the other, irrespective of whether 1.5 or 1.6 is specified as the 
source level, works with the interface overriding usage. For that reason util 
has not been a major problem since everyone uses a JDK 1.6 to compile Aries. In 
fact the project is built with essentially 'javac -source 1.5 -target 1.5' 
since it uses java5-parent.

The Eclipse compiler on the other hand objects to the @Override usage to 
implement interface methods. Hence, the problem that Ross flagged up that util 
does not compile in Eclipse when using m2eclipse. To get round that I have 
removed the instances where @Override is used in the Java 6 way. And with that 
it now actually does compile on jdk 1.5 (I specifically got one to test :).

Does this explanation make the reasons behind the change clearer? If there is 
way to make Maven use source level 1.6 and output 1.5 code that would be even 
better since all we really care for is getting 1.5 binaries but neither Ross 
nor me have found a way to do this so far :(

Regards,

Valentin

On 13 Jul 2011, at 12:20, Jacek Laskowski wrote:

> On Wed, Jul 13, 2011 at 11:31 AM,  <[email protected]> wrote:
>> Author: mahrwald
>> Date: Wed Jul 13 09:31:38 2011
>> New Revision: 1145930
>> 
>> URL: http://svn.apache.org/viewvc?rev=1145930&view=rev
>> Log:
>> ARIES-708: Remove interface @Override, now it even compiles with a Java 5 
>> compiler
> 
> Hi,
> 
> I don't understand why it had to be removed and the comment in
> particular? "It even compiles with a Java 5 compiler"? According to
> the javadoc of @Override it's available since 1.5. Why don't use
> -source 1.5 -target 1.5 for the util project and the others affected?
> Wouldn't it solve the issue?
> 
> Jacek
> 
> -- 
> Jacek Laskowski
> Java EE, functional languages and IBM WebSphere - http://blog.japila.pl
> Warszawa JUG conference = Confitura (formerly Javarsovia) :: 
> http://confitura.pl

Reply via email to