1.1 --- a/emul/src/main/java/java/lang/String.java Tue Oct 16 11:55:56 2012 +0200
1.2 +++ b/emul/src/main/java/java/lang/String.java Sun Nov 18 08:51:58 2012 +0100
1.3 @@ -641,14 +641,6 @@
1.4 this.offset = result.offset;
1.5 }
1.6
1.7 -
1.8 - // Package private constructor which shares value array for speed.
1.9 - String(int offset, int count, char value[]) {
1.10 - this.value = value;
1.11 - this.offset = offset;
1.12 - this.count = count;
1.13 - }
1.14 -
1.15 /**
1.16 * Returns the length of this string.
1.17 * The length is equal to the number of <a href="Character.html#unicode">Unicode
1.18 @@ -1966,7 +1958,7 @@
1.19 throw new StringIndexOutOfBoundsException(endIndex - beginIndex);
1.20 }
1.21 return ((beginIndex == 0) && (endIndex == count)) ? this :
1.22 - new String(offset + beginIndex, endIndex - beginIndex, value);
1.23 + new String(value, offset + beginIndex, endIndex - beginIndex);
1.24 }
1.25
1.26 /**
1.27 @@ -2029,7 +2021,7 @@
1.28 char buf[] = new char[count + otherLen];
1.29 getChars(0, count, buf, 0);
1.30 str.getChars(0, otherLen, buf, count);
1.31 - return new String(0, count + otherLen, buf);
1.32 + return new String(buf, 0, count + otherLen);
1.33 }
1.34
1.35 /**
1.36 @@ -2083,7 +2075,7 @@
1.37 buf[i] = (c == oldChar) ? newChar : c;
1.38 i++;
1.39 }
1.40 - return new String(0, len, buf);
1.41 + return new String(buf, 0, len);
1.42 }
1.43 }
1.44 return this;
1.45 @@ -2951,7 +2943,7 @@
1.46 */
1.47 public static String valueOf(char c) {
1.48 char data[] = {c};
1.49 - return new String(0, 1, data);
1.50 + return new String(data, 0, 1);
1.51 }
1.52
1.53 /**