You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@aries.apache.org by Jacek Laskowski <ja...@japila.pl> on 2011/07/13 13:20:52 UTC

Re: svn commit: r1145930 - in /aries/trunk/util/src/main/java/org/apache/aries/util: filesystem/impl/ internal/

On Wed, Jul 13, 2011 at 11:31 AM,  <ma...@apache.org> 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

Re: svn commit: r1145930 - in /aries/trunk/util/src/main/java/org/apache/aries/util: filesystem/impl/ internal/

Posted by Jacek Laskowski <ja...@japila.pl>.
On Wed, Jul 13, 2011 at 1:31 PM, Valentin Mahrwald
<vm...@googlemail.com> wrote:

> 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 :(

Hi Valentin,

That's clear now. I appreciate how detailed it's been. Thanks.

Jacek

-- 
Jacek Laskowski
Java EE, functional languages and IBM WebSphere - http://blog.japila.pl
Warszawa JUG conference = Confitura (formerly Javarsovia) :: http://confitura.pl

Re: svn commit: r1145930 - in /aries/trunk/util/src/main/java/org/apache/aries/util: filesystem/impl/ internal/

Posted by Valentin Mahrwald <vm...@googlemail.com>.
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,  <ma...@apache.org> 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