There is a bug in StringBuffer.insert(int, String)

The following:

    if (offset < len)
      System.arraycopy(this.str, offset, this.str, 
                       offset+str.length(), str.length());

should be:

    if (offset < len)
      System.arraycopy(this.str, offset, this.str, 
                       offset+str.length(), len - offset);

Reply via email to