geronimo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jarek Gawor" <jga...@gmail.com>
Subject Re: java.util.concurrent.ExecutorService changes between Java 5 and 6
Date Mon, 24 Nov 2008 21:13:53 GMT
I've been looking at how to build the concurrent module with Java 5
and 6 and I think I have a solution. When building with Java 6, a
patch will be applied to the source code (a copy of it actually)
before it is compiled. On Java 5, nothing extra is done. This solution
is s bit of a hack but seems to work and I can't think of anything
better. Also, I decided I don't want to make this module build only on
Java 6 because that will prevent other modules that want to work on
Java 5 from using the concurrency API.

Supporting one Java version for Geronimo would make this a lot easier
but given we want to support both Java versions some solution is
necessary...

Jarek

On Wed, Nov 19, 2008 at 11:29 PM, Jarek Gawor <jgawor@gmail.com> wrote:
> The java.util.concurrent.ExecutorService interface was slightly
> changed between Java 5 and Java 6: Here's an example:
>
> Java 5: invokeAll(Collection<Callable<T>> tasks)
>
> Java 6: invokeAll(Collection<? extends Callable<T>> tasks)
>
> Here's more info on the change:
> http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6267833
>
> This change causes problems in the concurrent module. The code in the
> concurrent module extends and implements the Java 5 ExecutorService
> interface. However, since the interface was changed in Java 6, the
> concurrent module will not build on Java 6. The compiler complains
> that these changed methods are not implemented. And you can't define
> both style of these methods in the same class because they have the
> same erasure. Given our recent discussion on supporting Java 5 and 6,
> I think I will need to make the concurrent module Java 5 or Java 6
> specific. That is, for example, the module would be built on Java 6
> but not built on Java 5.
>
> I was wondering if somebody had a better idea how to deal with this
> and/or how to support both Java versions.
>
> Thanks,
> Jarek
>

Mime
View raw message