emul/src/main/java/java/lang/AbstractStringBuilder.java
branchemul
changeset 72 06bd18f34608
parent 61 4b334950499d
child 94 19497b4312bb
     1.1 --- a/emul/src/main/java/java/lang/AbstractStringBuilder.java	Sat Sep 29 08:13:32 2012 +0200
     1.2 +++ b/emul/src/main/java/java/lang/AbstractStringBuilder.java	Sun Sep 30 17:10:32 2012 -0700
     1.3 @@ -350,7 +350,7 @@
     1.4              throw new StringIndexOutOfBoundsException(srcEnd);
     1.5          if (srcBegin > srcEnd)
     1.6              throw new StringIndexOutOfBoundsException("srcBegin > srcEnd");
     1.7 -        System.arraycopy(value, srcBegin, dst, dstBegin, srcEnd - srcBegin);
     1.8 +        String.arraycopy(value, srcBegin, dst, dstBegin, srcEnd - srcBegin);
     1.9      }
    1.10  
    1.11      /**
    1.12 @@ -500,7 +500,7 @@
    1.13      public AbstractStringBuilder append(char[] str) {
    1.14          int len = str.length;
    1.15          ensureCapacityInternal(count + len);
    1.16 -        System.arraycopy(str, 0, value, count, len);
    1.17 +        String.arraycopy(str, 0, value, count, len);
    1.18          count += len;
    1.19          return this;
    1.20      }
    1.21 @@ -530,7 +530,7 @@
    1.22      public AbstractStringBuilder append(char str[], int offset, int len) {
    1.23          if (len > 0)                // let arraycopy report AIOOBE for len < 0
    1.24              ensureCapacityInternal(count + len);
    1.25 -        System.arraycopy(str, offset, value, count, len);
    1.26 +        String.arraycopy(str, offset, value, count, len);
    1.27          count += len;
    1.28          return this;
    1.29      }
    1.30 @@ -693,7 +693,7 @@
    1.31              throw new StringIndexOutOfBoundsException();
    1.32          int len = end - start;
    1.33          if (len > 0) {
    1.34 -            System.arraycopy(value, start+len, value, start, count-end);
    1.35 +            String.arraycopy(value, start+len, value, start, count-end);
    1.36              count -= len;
    1.37          }
    1.38          return this;
    1.39 @@ -755,7 +755,7 @@
    1.40      public AbstractStringBuilder deleteCharAt(int index) {
    1.41          if ((index < 0) || (index >= count))
    1.42              throw new StringIndexOutOfBoundsException(index);
    1.43 -        System.arraycopy(value, index+1, value, index, count-index-1);
    1.44 +        String.arraycopy(value, index+1, value, index, count-index-1);
    1.45          count--;
    1.46          return this;
    1.47      }
    1.48 @@ -793,7 +793,7 @@
    1.49          int newCount = count + len - (end - start);
    1.50          ensureCapacityInternal(newCount);
    1.51  
    1.52 -        System.arraycopy(value, end, value, start + len, count - end);
    1.53 +        String.arraycopy(value, end, value, start + len, count - end);
    1.54          str.getChars(value, start);
    1.55          count = newCount;
    1.56          return this;
    1.57 @@ -899,8 +899,8 @@
    1.58                  "offset " + offset + ", len " + len + ", str.length "
    1.59                  + str.length);
    1.60          ensureCapacityInternal(count + len);
    1.61 -        System.arraycopy(value, index, value, index + len, count - index);
    1.62 -        System.arraycopy(str, offset, value, index, len);
    1.63 +        String.arraycopy(value, index, value, index + len, count - index);
    1.64 +        String.arraycopy(str, offset, value, index, len);
    1.65          count += len;
    1.66          return this;
    1.67      }
    1.68 @@ -966,7 +966,7 @@
    1.69              str = "null";
    1.70          int len = str.length();
    1.71          ensureCapacityInternal(count + len);
    1.72 -        System.arraycopy(value, offset, value, offset + len, count - offset);
    1.73 +        String.arraycopy(value, offset, value, offset + len, count - offset);
    1.74          str.getChars(value, offset);
    1.75          count += len;
    1.76          return this;
    1.77 @@ -1001,8 +1001,8 @@
    1.78              throw new StringIndexOutOfBoundsException(offset);
    1.79          int len = str.length;
    1.80          ensureCapacityInternal(count + len);
    1.81 -        System.arraycopy(value, offset, value, offset + len, count - offset);
    1.82 -        System.arraycopy(str, 0, value, offset, len);
    1.83 +        String.arraycopy(value, offset, value, offset + len, count - offset);
    1.84 +        String.arraycopy(str, 0, value, offset, len);
    1.85          count += len;
    1.86          return this;
    1.87      }
    1.88 @@ -1092,7 +1092,7 @@
    1.89                  + s.length());
    1.90          int len = end - start;
    1.91          ensureCapacityInternal(count + len);
    1.92 -        System.arraycopy(value, dstOffset, value, dstOffset + len,
    1.93 +        String.arraycopy(value, dstOffset, value, dstOffset + len,
    1.94                           count - dstOffset);
    1.95          for (int i=start; i<end; i++)
    1.96              value[dstOffset++] = s.charAt(i);
    1.97 @@ -1144,7 +1144,7 @@
    1.98       */
    1.99      public AbstractStringBuilder insert(int offset, char c) {
   1.100          ensureCapacityInternal(count + 1);
   1.101 -        System.arraycopy(value, offset, value, offset + 1, count - offset);
   1.102 +        String.arraycopy(value, offset, value, offset + 1, count - offset);
   1.103          value[offset] = c;
   1.104          count += 1;
   1.105          return this;