A method I've used in the past to switch between backport-util and java5
is to create two sets of subclasses.  One set of subclasses inherits
from backport-util, the other from java5.  Each set of subclasses exists
in the same package, but the code is kept in distinct source
directories.  The rest of the code in the project is written to use
these subclasses.  Then I use profiles in the maven pom to select the
best set of subclasses based on the jvm used to build or a property.

A quick search of MINA code shows that there are only 14 classes that
are actually used in backport-util

$ find . -name '*.java' -exec fgrep edu\.emory {} \; | sort | uniq
import edu.emory.mathcs.backport.java.util.concurrent.BlockingQueue;
import edu.emory.mathcs.backport.java.util.concurrent.ConcurrentHashMap;
import
edu.emory.mathcs.backport.java.util.concurrent.CopyOnWriteArrayList;
import edu.emory.mathcs.backport.java.util.concurrent.Executor;
import edu.emory.mathcs.backport.java.util.concurrent.Executors;
import
edu.emory.mathcs.backport.java.util.concurrent.LinkedBlockingQueue;
import
edu.emory.mathcs.backport.java.util.concurrent.RejectedExecutionHandler;
import edu.emory.mathcs.backport.java.util.concurrent.SynchronousQueue;
import edu.emory.mathcs.backport.java.util.concurrent.ThreadFactory;
import
edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor;
import edu.emory.mathcs.backport.java.util.concurrent.TimeUnit;
import
edu.emory.mathcs.backport.java.util.concurrent.atomic.AtomicInteger;
import
edu.emory.mathcs.backport.java.util.concurrent.locks.ReadWriteLock;
import
edu.emory.mathcs.backport.java.util.concurrent.locks.ReentrantReadWriteL
ock;

-----Original Message-----
From: Trustin Lee [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, October 31, 2006 3:52 AM
To: [email protected]; [EMAIL PROTECTED]
Subject: Re: mina 1.0 and java5

On 10/31/06, Julien Vermillard <[EMAIL PROTECTED]> wrote:
>
> Why not simply provide a kind of ant script for fix the sources for
> 1.5 ?


Good idea; A script that forks instantly, deploys the jar, and wipe the
forked source code would be a cleaner option.

Trustin
--
what we call human nature is actually human habit
--
http://gleamynode.net/
--
PGP key fingerprints:
* E167 E6AF E73A CBCE EE41  4A29 544D DE48 FE95 4E7E
* B693 628E 6047 4F8F CFA4  455E 1C62 A7DC 0255 ECA6

Reply via email to