Since Java 5, Java has introduced the java.util.concurrent API , which supports ReentrantReadWriteLock. But Castor has not used the java.util.concurrent API to improve the performance (Castor uses some code from EDU.oswego.cs.dl.util.concurrent library ). As far as I know , the EDU.oswego.cs.dl.util.concurrent is not developed and improved any more, and Java's java.util.concurrent package will include improved, more efficient, standardized versions of the main components in EDU.oswego.cs.dl.util.concurrent.
The Castor should be compiled on JDK 1.5 (or higher), because the Castor use the Generics. We should convert the Castor to use java.util.concurrent API (don't worry about the compatibility with JDK 1.4), and benefit from the java.util.concurrent package's improvement.
I have refactored the code in Castor, and prepare a patch for these (see attachment). I have run the 'mvn test' and it succeeded.