A user/developer of ours has pointed out that our test code currently
does not compile under Java 1.6 (we produce all of our builds for 1.5
currently). The root of the problem is that we are implementing an
interface from the standard Java libraries, ExecutorService, the
definition of which has changed slightly between Java 1.5 and 1.6.
There are actually several methods that are a problem in that
interface, but here is one example:
In Java 1.5 you have this method in the interface:
<T> List<Future<T>> invokeAll(Collection<Callable<T>> tasks)
but in Java 1.6 the same method is declared as follows:
<T> List<Future<T>> invokeAll(Collection<? extends Callable<T>> tasks)
The obvious difference being the type parameter for the 'tasks'
collection has changed from "Callable<T>" to "? extends Callable<T>".
So here's the problem, the compiler is telling me that the method that
I use to implement this interface has to match exactly, meaning that
the class that compiles fine under Java 1.5 flails under Java 1.6 and
vice versa.
Aside from branching the code for this one class, does anyone know of
a good way to address this?
For reference the file we are referring to is
http://trac.marketcetera.org/trac.fcgi/browser/platform/trunk/core/src/test/java/org/marketcetera/core/ImmediateExecutorService.javaAlso, I have attached a patch file for use with Java 1.6 compilers as
a temporary workaround.
Thanks.
graham
--
Marketcetera Trading Platform
download.run.trade.
www.marketcetera.org
_______________________________________________
m-etc-dev mailing list
[hidden email]
http://lists.marketcetera.org/cgi-bin/mailman/listinfo/m-etc-dev