/[classpath]/classpath/java/lang/StringBuffer.java
ViewVC logotype

Diff of /classpath/java/lang/StringBuffer.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.28 by mkoch, Fri Oct 22 18:02:06 2004 UTC revision 1.29 by mark, Fri Dec 10 18:29:31 2004 UTC
# Line 263  public final class StringBuffer implemen Line 263  public final class StringBuffer implemen
263    {    {
264      if (srcOffset < 0 || srcEnd > count || srcEnd < srcOffset)      if (srcOffset < 0 || srcEnd > count || srcEnd < srcOffset)
265        throw new StringIndexOutOfBoundsException();        throw new StringIndexOutOfBoundsException();
266      System.arraycopy(value, srcOffset, dst, dstOffset, srcEnd - srcOffset);      VMSystem.arraycopy(value, srcOffset, dst, dstOffset, srcEnd - srcOffset);
267    }    }
268    
269    /**    /**
# Line 334  public final class StringBuffer implemen Line 334  public final class StringBuffer implemen
334        {        {
335          int len = stringBuffer.count;          int len = stringBuffer.count;
336          ensureCapacity_unsynchronized(count + len);          ensureCapacity_unsynchronized(count + len);
337          System.arraycopy(stringBuffer.value, 0, value, count, len);          VMSystem.arraycopy(stringBuffer.value, 0, value, count, len);
338          count += len;          count += len;
339        }        }
340      return this;      return this;
# Line 374  public final class StringBuffer implemen Line 374  public final class StringBuffer implemen
374      if (offset < 0 || count < 0 || offset > data.length - count)      if (offset < 0 || count < 0 || offset > data.length - count)
375        throw new StringIndexOutOfBoundsException();        throw new StringIndexOutOfBoundsException();
376      ensureCapacity_unsynchronized(this.count + count);      ensureCapacity_unsynchronized(this.count + count);
377      System.arraycopy(data, offset, value, this.count, count);      VMSystem.arraycopy(data, offset, value, this.count, count);
378      this.count += count;      this.count += count;
379      return this;      return this;
380    }    }
# Line 483  public final class StringBuffer implemen Line 483  public final class StringBuffer implemen
483      // This will unshare if required.      // This will unshare if required.
484      ensureCapacity_unsynchronized(count);      ensureCapacity_unsynchronized(count);
485      if (count - end != 0)      if (count - end != 0)
486        System.arraycopy(value, end, value, start, count - end);        VMSystem.arraycopy(value, end, value, start, count - end);
487      count -= end - start;      count -= end - start;
488      return this;      return this;
489    }    }
# Line 526  public final class StringBuffer implemen Line 526  public final class StringBuffer implemen
526      ensureCapacity_unsynchronized(count + delta);      ensureCapacity_unsynchronized(count + delta);
527    
528      if (delta != 0 && end < count)      if (delta != 0 && end < count)
529        System.arraycopy(value, end, value, end + delta, count - end);        VMSystem.arraycopy(value, end, value, end + delta, count - end);
530    
531      str.getChars(0, len, value, start);      str.getChars(0, len, value, start);
532      count += delta;      count += delta;
# Line 613  public final class StringBuffer implemen Line 613  public final class StringBuffer implemen
613          || str_offset < 0 || str_offset > str.length - len)          || str_offset < 0 || str_offset > str.length - len)
614        throw new StringIndexOutOfBoundsException();        throw new StringIndexOutOfBoundsException();
615      ensureCapacity_unsynchronized(count + len);      ensureCapacity_unsynchronized(count + len);
616      System.arraycopy(value, offset, value, offset + len, count - offset);      VMSystem.arraycopy(value, offset, value, offset + len, count - offset);
617      System.arraycopy(str, str_offset, value, offset, len);      VMSystem.arraycopy(str, str_offset, value, offset, len);
618      count += len;      count += len;
619      return this;      return this;
620    }    }
# Line 653  public final class StringBuffer implemen Line 653  public final class StringBuffer implemen
653        str = "null";        str = "null";
654      int len = str.count;      int len = str.count;
655      ensureCapacity_unsynchronized(count + len);      ensureCapacity_unsynchronized(count + len);
656      System.arraycopy(value, offset, value, offset + len, count - offset);      VMSystem.arraycopy(value, offset, value, offset + len, count - offset);
657      str.getChars(0, len, value, offset);      str.getChars(0, len, value, offset);
658      count += len;      count += len;
659      return this;      return this;
# Line 704  public final class StringBuffer implemen Line 704  public final class StringBuffer implemen
704      if (offset < 0 || offset > count)      if (offset < 0 || offset > count)
705        throw new StringIndexOutOfBoundsException(offset);        throw new StringIndexOutOfBoundsException(offset);
706      ensureCapacity_unsynchronized(count + 1);      ensureCapacity_unsynchronized(count + 1);
707      System.arraycopy(value, offset, value, offset + 1, count - offset);      VMSystem.arraycopy(value, offset, value, offset + 1, count - offset);
708      value[offset] = ch;      value[offset] = ch;
709      count++;      count++;
710      return this;      return this;
# Line 900  public final class StringBuffer implemen Line 900  public final class StringBuffer implemen
900                     : value.length);                     : value.length);
901          minimumCapacity = (minimumCapacity < max ? max : minimumCapacity);          minimumCapacity = (minimumCapacity < max ? max : minimumCapacity);
902          char[] nb = new char[minimumCapacity];          char[] nb = new char[minimumCapacity];
903          System.arraycopy(value, 0, nb, 0, count);          VMSystem.arraycopy(value, 0, nb, 0, count);
904          value = nb;          value = nb;
905          shared = false;          shared = false;
906        }        }

Legend:
Removed from v.1.28  
changed lines
  Added in v.1.29

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26