Why there are 2 methods which do not use the super method, where I can't see any difference? :

    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



Reply via email to