< prev index next >
src/java.base/share/classes/java/lang/AbstractStringBuilder.java
Print this page
@@ -23,12 +23,14 @@
* questions.
*/
package java.lang;
-import jdk.internal.math.FloatingDecimal;
+import jdk.internal.math.DoubleToDecimal;
+import jdk.internal.math.FloatToDecimal;
+import java.io.IOException;
import java.util.Arrays;
import java.util.Spliterator;
import java.util.stream.IntStream;
import java.util.stream.StreamSupport;
@@ -878,11 +880,15 @@
*
* @param f a {@code float}.
* @return a reference to this object.
*/
public AbstractStringBuilder append(float f) {
- FloatingDecimal.appendTo(f,this);
+ try {
+ FloatToDecimal.appendTo(f, this);
+ } catch (IOException ignored) {
+ assert false;
+ }
return this;
}
/**
* Appends the string representation of the {@code double}
@@ -895,11 +901,15 @@
*
* @param d a {@code double}.
* @return a reference to this object.
*/
public AbstractStringBuilder append(double d) {
- FloatingDecimal.appendTo(d,this);
+ try {
+ DoubleToDecimal.appendTo(d, this);
+ } catch (IOException ignored) {
+ assert false;
+ }
return this;
}
/**
* Removes the characters in a substring of this sequence.
< prev index next >