You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by "Hyrum K. Wright" <hy...@mail.utexas.edu> on 2010/02/26 02:49:54 UTC

Update required Java version to 5.0?

Just going through the svnj source, and I started wondering why we're not using generics in our own java packages.  Generics were introduced in Java 5.0, but turns out that we only require 1.3 in our own source.  Given that 5.0 was introduced in 2004, isn't it about time we relax our requirements and update our code to use the new features of 5.0?  The change to our package namespace presents a good opportunity to do so.

-Hyrum

Re: Update required Java version to 5.0?

Posted by Branko Čibej <br...@xbc.nu>.
Hyrum K. Wright wrote:
> Just going through the svnj source, and I started wondering why we're not using generics in our own java packages.  Generics were introduced in Java 5.0, but turns out that we only require 1.3 in our own source.  Given that 5.0 was introduced in 2004, isn't it about time we relax our requirements and update our code to use the new features of 5.0?  The change to our package namespace presents a good opportunity to do so.
>   

Generics in Java are just glorified syntactic sugar, but they /do/ help
the compiler to produce marginally better error messages ... so as far
as I'm concerned, let's do that.

-- Brane

Re: Update required Java version to 5.0?

Posted by Blair Zajac <bl...@orcaware.com>.
Hyrum K. Wright wrote:
> Just going through the svnj source, and I started wondering why we're not using generics in our own java packages.  Generics were introduced in Java 5.0, but turns out that we only require 1.3 in our own source.  Given that 5.0 was introduced in 2004, isn't it about time we relax our requirements and update our code to use the new features of 5.0?  The change to our package namespace presents a good opportunity to do so.

+1.  Seeing casts through the code is just ugly and it makes it easier for 
clients to use the library so they don't have to use casts.

Also, 1.4 has been end-of-life by Oracle(Sun) so most people should be on 1.5.

Blair

Re: Update required Java version to 5.0?

Posted by "Hyrum K. Wright" <hy...@mail.utexas.edu>.
On Feb 25, 2010, at 10:22 PM, Mark Phippard wrote:

> On Thu, Feb 25, 2010 at 6:49 PM, Hyrum K. Wright
> <hy...@mail.utexas.edu> wrote:
>> Just going through the svnj source, and I started wondering why we're not using generics in our own java packages.  Generics were introduced in Java 5.0, but turns out that we only require 1.3 in our own source.  Given that 5.0 was introduced in 2004, isn't it about time we relax our requirements and update our code to use the new features of 5.0?  The change to our package namespace presents a good opportunity to do so.
>> 
> 
> I am pretty ambivalent on it.  It would be a convenient time to do it,
> but at the same time off the top of my head I do not see where our
> code is going to benefit much from it.  I do not recall us using a lot
> of Collections in our code and the API signatures do not return them,
> so why change from arrays to generics?  It is also going to be more
> invasive for our users that have to convert their code even more.
> 
> I think the thing that would swing me in favor of this would be seeing
> the actual improvements it could make to our code base.  I am just not
> really seeing that.

We do have a number of APIs which throw around Maps and Lists, so, if anything, this allows us properly parameterize those.  The reason to doing it now is that with the package rename, we can change an API like foo(Map m) to foo(Map<String,String> m) without having to change the name (since the erasures are the same, we couldn't just override the first with the second).

I'll look into this shortly.

-Hyrum

Re: Update required Java version to 5.0?

Posted by Mark Phippard <ma...@gmail.com>.
On Thu, Feb 25, 2010 at 6:49 PM, Hyrum K. Wright
<hy...@mail.utexas.edu> wrote:
> Just going through the svnj source, and I started wondering why we're not using generics in our own java packages.  Generics were introduced in Java 5.0, but turns out that we only require 1.3 in our own source.  Given that 5.0 was introduced in 2004, isn't it about time we relax our requirements and update our code to use the new features of 5.0?  The change to our package namespace presents a good opportunity to do so.
>

I am pretty ambivalent on it.  It would be a convenient time to do it,
but at the same time off the top of my head I do not see where our
code is going to benefit much from it.  I do not recall us using a lot
of Collections in our code and the API signatures do not return them,
so why change from arrays to generics?  It is also going to be more
invasive for our users that have to convert their code even more.

I think the thing that would swing me in favor of this would be seeing
the actual improvements it could make to our code base.  I am just not
really seeing that.

-- 
Thanks

Mark Phippard
http://markphip.blogspot.com/