public synchronized char charAt(int index)
public synchronized void setCharAt(int index, char ch)
Wouldn't ensureCapacity better coded as follows? :
public void ensureCapacity(int minimumCapacity) {
if (minimumCapacity > value.length) synchronized {
ensureCapacity(minimumCapacity);
}
}
This would save the synchronization if there is nothing to do.
-Ulf
