I've had a partial patch for this issue in my sandbox for a while. Attaching it here so that it won't be lost. The patch replaces four Vectors with ArrayLists. More investegation is needed in order to find out whether these changes are safe. FWIW, derbyall and the JUnit tests ran cleanly on Solaris 10 and Sun Java SE 5.0 with this patch.
removeActivation() contains some code which is not as easily expressed with ArrayList as with Vector, since ArrayList doesn't have an equivalent to Vector.capacity().
int capacity = acts.capacity();
if (capacity > 20 && (capacity > 2 * acts.size()))
This optimization might save space in some cases, but it doesn't seem like a very important optimization (I believe it is even less important now that
DERBY-418 is fixed), so I just commented it out in the patch for now. If one really wants this optimization, it should be fairly easy to implement it by keeping track of the largest observed value of acts.size() in addActivation() and use that value instead of acts.capacity() in removeActivation().
But first we need to find out whether it is safe to remove the synchronization...