diff --git a/classpath/java-lang.cpp b/classpath/java-lang.cpp index 3cd963eee1..6f680f12e7 100644 --- a/classpath/java-lang.cpp +++ b/classpath/java-lang.cpp @@ -71,8 +71,11 @@ Java_java_lang_System_doMapLibraryName(JNIEnv* e, jclass, jstring name) } extern "C" JNIEXPORT jint JNICALL -Java_java_lang_Double_fillBufferWithDouble(JNIEnv *e, jclass me, jdouble val, +Java_java_lang_Double_fillBufferWithDouble(JNIEnv *e, jclass, jdouble val, jbyteArray buffer, jint bufferSize) { - if (e or me or val or buffer or bufferSize) return 0; - return 0; + jboolean isCopy; + jbyte* buf = e->GetByteArrayElements(buffer, &isCopy); + jint count = snprintf(reinterpret_cast(buf), bufferSize, "%g", val); + e->ReleaseByteArrayElements(buffer, buf, 0); + return count; } diff --git a/classpath/java/lang/Float.java b/classpath/java/lang/Float.java index b563a69bf4..88274aa4e9 100644 --- a/classpath/java/lang/Float.java +++ b/classpath/java/lang/Float.java @@ -26,7 +26,7 @@ public final class Float extends Number { } public static String toString(float v) { - return "Float.toString: todo"; + return Double.toString(v); } public byte byteValue() {