Details
Description
Enclosed is an implementation of Future.object
It relies on java.util.concurrent in JDK-1.5
Q: Should I "downgrade" the code so it uses the standalone concurrent library, allowing this to run on pre-JDK-1.5?
Activity
Aslak Hellesøy
made changes -
Field | Original Value | New Value |
---|---|---|
Attachment | Future.java [ 12188 ] |
Aslak Hellesøy
made changes -
Attachment | FutureInvoker.java [ 12189 ] |
Aslak Hellesøy
made changes -
Attachment | FutureTest.java [ 12190 ] |
Jörg Schaible
made changes -
Component/s | Toys [ 11560 ] | |
Environment |
Paul Hammant
made changes -
Status | Open [ 1 ] | Closed [ 6 ] |
Assignee | Paul Hammant [ paul ] | |
Resolution | Fixed [ 1 ] |
Jörg Schaible
made changes -
Status | Closed [ 6 ] | Reopened [ 4 ] |
Resolution | Fixed [ 1 ] |
Jörg Schaible
made changes -
Fix Version/s | 1.0 [ 16343 ] |
Jörg Schaible
made changes - 12/May/15 12:24 AM
Resolution | Fixed [ 1 ] | |
Status | Reopened [ 4 ] | Closed [ 6 ] |
If we use the non-1.5 package names then ProxyToys remains compatible with 1.3 through 1.5. Even when we add <Generics> it will still be binary compatible back down to 1.3, so I would prefer to use the old Doug Lea package names and make the package an optional dependency.
The smart thing would be to wrap the three classes we use: Callable, Executors and Executor, inside similarly-named classes in proxy.toys.future, and have these statically attempt to load firstly the java.util.concurrent and then (if that fails) the edu.whatever classes in their static initialisers, and delegate off to whichever they find (or fail in <clinit> if neither is found, with a NoClassDefFoundError).
That way we have an optional dependency on the Doug Lea stuff: you have to both load the FutureXxx classes and not have 1.5.