/[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.27.2.3 by gnu_andrew, Sat Jan 15 17:01:53 2005 UTC revision 1.27.2.4 by gnu_andrew, Sun Jan 16 15:15:12 2005 UTC
# Line 286  public final class StringBuffer Line 286  public final class StringBuffer
286    {    {
287      if (srcOffset < 0 || srcEnd > count || srcEnd < srcOffset)      if (srcOffset < 0 || srcEnd > count || srcEnd < srcOffset)
288        throw new StringIndexOutOfBoundsException();        throw new StringIndexOutOfBoundsException();
289      System.arraycopy(value, srcOffset, dst, dstOffset, srcEnd - srcOffset);      VMSystem.arraycopy(value, srcOffset, dst, dstOffset, srcEnd - srcOffset);
290    }    }
291    
292    /**    /**
# Line 357  public final class StringBuffer Line 357  public final class StringBuffer
357        {        {
358          int len = stringBuffer.count;          int len = stringBuffer.count;
359          ensureCapacity_unsynchronized(count + len);          ensureCapacity_unsynchronized(count + len);
360          System.arraycopy(stringBuffer.value, 0, value, count, len);          VMSystem.arraycopy(stringBuffer.value, 0, value, count, len);
361          count += len;          count += len;
362        }        }
363      return this;      return this;
# Line 397  public final class StringBuffer Line 397  public final class StringBuffer
397      if (offset < 0 || count < 0 || offset > data.length - count)      if (offset < 0 || count < 0 || offset > data.length - count)
398        throw new StringIndexOutOfBoundsException();        throw new StringIndexOutOfBoundsException();
399      ensureCapacity_unsynchronized(this.count + count);      ensureCapacity_unsynchronized(this.count + count);
400      System.arraycopy(data, offset, value, this.count, count);      VMSystem.arraycopy(data, offset, value, this.count, count);
401      this.count += count;      this.count += count;
402      return this;      return this;
403    }    }
# Line 543  public final class StringBuffer Line 543  public final class StringBuffer
543      // This will unshare if required.      // This will unshare if required.
544      ensureCapacity_unsynchronized(count);      ensureCapacity_unsynchronized(count);
545      if (count - end != 0)      if (count - end != 0)
546        System.arraycopy(value, end, value, start, count - end);        VMSystem.arraycopy(value, end, value, start, count - end);
547      count -= end - start;      count -= end - start;
548      return this;      return this;
549    }    }
# Line 586  public final class StringBuffer Line 586  public final class StringBuffer
586      ensureCapacity_unsynchronized(count + delta);      ensureCapacity_unsynchronized(count + delta);
587    
588      if (delta != 0 && end < count)      if (delta != 0 && end < count)
589        System.arraycopy(value, end, value, end + delta, count - end);        VMSystem.arraycopy(value, end, value, end + delta, count - end);
590    
591      str.getChars(0, len, value, start);      str.getChars(0, len, value, start);
592      count += delta;      count += delta;
# Line 673  public final class StringBuffer Line 673  public final class StringBuffer
673          || str_offset < 0 || str_offset > str.length - len)          || str_offset < 0 || str_offset > str.length - len)
674        throw new StringIndexOutOfBoundsException();        throw new StringIndexOutOfBoundsException();
675      ensureCapacity_unsynchronized(count + len);      ensureCapacity_unsynchronized(count + len);
676      System.arraycopy(value, offset, value, offset + len, count - offset);      VMSystem.arraycopy(value, offset, value, offset + len, count - offset);
677      System.arraycopy(str, str_offset, value, offset, len);      VMSystem.arraycopy(str, str_offset, value, offset, len);
678      count += len;      count += len;
679      return this;      return this;
680    }    }
# Line 713  public final class StringBuffer Line 713  public final class StringBuffer
713        str = "null";        str = "null";
714      int len = str.count;      int len = str.count;
715      ensureCapacity_unsynchronized(count + len);      ensureCapacity_unsynchronized(count + len);
716      System.arraycopy(value, offset, value, offset + len, count - offset);      VMSystem.arraycopy(value, offset, value, offset + len, count - offset);
717      str.getChars(0, len, value, offset);      str.getChars(0, len, value, offset);
718      count += len;      count += len;
719      return this;      return this;
# Line 764  public final class StringBuffer Line 764  public final class StringBuffer
764      if (offset < 0 || offset > count)      if (offset < 0 || offset > count)
765        throw new StringIndexOutOfBoundsException(offset);        throw new StringIndexOutOfBoundsException(offset);
766      ensureCapacity_unsynchronized(count + 1);      ensureCapacity_unsynchronized(count + 1);
767      System.arraycopy(value, offset, value, offset + 1, count - offset);      VMSystem.arraycopy(value, offset, value, offset + 1, count - offset);
768      value[offset] = ch;      value[offset] = ch;
769      count++;      count++;
770      return this;      return this;
# Line 960  public final class StringBuffer Line 960  public final class StringBuffer
960                     : value.length);                     : value.length);
961          minimumCapacity = (minimumCapacity < max ? max : minimumCapacity);          minimumCapacity = (minimumCapacity < max ? max : minimumCapacity);
962          char[] nb = new char[minimumCapacity];          char[] nb = new char[minimumCapacity];
963          System.arraycopy(value, 0, nb, 0, count);          VMSystem.arraycopy(value, 0, nb, 0, count);
964          value = nb;          value = nb;
965          shared = false;          shared = false;
966        }        }

Legend:
Removed from v.1.27.2.3  
changed lines
  Added in v.1.27.2.4

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