1.1 --- a/emul/src/main/java/java/lang/AbstractStringBuilder.java Sat Sep 29 06:47:05 2012 +0200
1.2 +++ b/emul/src/main/java/java/lang/AbstractStringBuilder.java Sat Sep 29 07:49:34 2012 +0200
1.3 @@ -25,9 +25,6 @@
1.4
1.5 package java.lang;
1.6
1.7 -import sun.misc.FloatingDecimal;
1.8 -import java.util.Arrays;
1.9 -
1.10 /**
1.11 * A mutable sequence of characters.
1.12 * <p>
1.13 @@ -127,7 +124,7 @@
1.14 throw new OutOfMemoryError();
1.15 newCapacity = Integer.MAX_VALUE;
1.16 }
1.17 - value = Arrays.copyOf(value, newCapacity);
1.18 + value = copyOf(value, newCapacity);
1.19 }
1.20
1.21 /**
1.22 @@ -139,7 +136,7 @@
1.23 */
1.24 public void trimToSize() {
1.25 if (count < value.length) {
1.26 - value = Arrays.copyOf(value, count);
1.27 + value = copyOf(value, count);
1.28 }
1.29 }
1.30
1.31 @@ -654,8 +651,7 @@
1.32 * @return a reference to this object.
1.33 */
1.34 public AbstractStringBuilder append(float f) {
1.35 - new FloatingDecimal(f).appendTo(this);
1.36 - return this;
1.37 + throw new UnsupportedOperationException();
1.38 }
1.39
1.40 /**
1.41 @@ -671,8 +667,7 @@
1.42 * @return a reference to this object.
1.43 */
1.44 public AbstractStringBuilder append(double d) {
1.45 - new FloatingDecimal(d).appendTo(this);
1.46 - return this;
1.47 + throw new UnsupportedOperationException();
1.48 }
1.49
1.50 /**
1.51 @@ -1404,4 +1399,10 @@
1.52 return value;
1.53 }
1.54
1.55 + private static char[] copyOf(char[] original, int newLength) {
1.56 + char[] copy = new char[newLength];
1.57 + System.arraycopy(original, 0, copy, 0,
1.58 + Math.min(original.length, newLength));
1.59 + return copy;
1.60 + }
1.61 }