diff options
author | Michael Koch <konqueror@gmx.de> | 2005-04-16 09:19:53 +0000 |
---|---|---|
committer | Michael Koch <konqueror@gmx.de> | 2005-04-16 09:19:53 +0000 |
commit | 24a0a06dd7f5d813bc029023aec049de53d9f45b (patch) | |
tree | bfc174380ac1fb845fa372cc68f56a98d3dec038 /java | |
parent | fac6a094be0f8e14dcc947d1eb81abcea19d9c92 (diff) | |
download | classpath-24a0a06dd7f5d813bc029023aec049de53d9f45b.tar.gz |
2005-04-16 Michael Koch <konqueror@gmx.de>
* include/java_lang_Double.h,
include/java_lang_Object.h,
native/jni/java-lang/java_lang_Double.c,
native/jni/java-lang/java_lang_Object.c: Removed.
* include/java_lang_VMDouble.h: Regenerated.
* java/lang/Double.java
(static): Removed.
(toString): Call native method from VMDouble.
(parseDouble): Make non-native and call native method from VMDouble.
(toString): Removed.
* java/lang/Float.java
(toString): Call native method from VMDouble.
* java/lang/Object.java
(getClass): Refactored to call the native in java.lang.VMObject.
* include/Makefile.am: Don't generate java_lang_Double.h and
java_lang_Object.h.
* native/jni/java-lang/Makefile.am: Removed java_lang_Double.c and
java_lang_Object.c.
* native/jni/java-lang/java_lang_VMDouble.c
(initIDs): New method.
(toString): Likewise.
(parseDouble): Likewise.
* vm/reference/java/lang/VMDouble.java
(initIDs): Likewise.
(toString): Likewise.
(parseDouble): Likewise.
* vm/reference/java/lang/VMObject.java
(getClass): Likewise.
Diffstat (limited to 'java')
-rw-r--r-- | java/lang/Double.java | 35 | ||||
-rw-r--r-- | java/lang/Float.java | 2 | ||||
-rw-r--r-- | java/lang/Object.java | 7 |
3 files changed, 11 insertions, 33 deletions
diff --git a/java/lang/Double.java b/java/lang/Double.java index 2b819becf..5ea09e4f9 100644 --- a/java/lang/Double.java +++ b/java/lang/Double.java @@ -103,18 +103,6 @@ public final class Double extends Number implements Comparable private final double value; /** - * Load native routines necessary for this class. - */ - static - { - if (Configuration.INIT_LOAD_LIBRARY) - { - System.loadLibrary("javalang"); - initIDs(); - } - } - - /** * Create a <code>Double</code> from the primitive <code>double</code> * specified. * @@ -176,7 +164,7 @@ public final class Double extends Number implements Comparable */ public static String toString(double d) { - return toString(d, false); + return VMDouble.toString(d, false); } /** @@ -243,7 +231,10 @@ public final class Double extends Number implements Comparable * @see #NEGATIVE_INFINITY * @since 1.2 */ - public static native double parseDouble(String str); + public static double parseDouble(String str) + { + return VMDouble.parseDouble(str); + } /** * Return <code>true</code> if the <code>double</code> has the same @@ -527,20 +518,4 @@ public final class Double extends Number implements Comparable return x > y ? 1 : -1; } - - /** - * Helper method to convert to string. - * - * @param d the double to convert - * @param isFloat true if the conversion is requested by Float (results in - * fewer digits) - */ - // Package visible for use by Float. - static native String toString(double d, boolean isFloat); - - /** - * Initialize JNI cache. This method is called only by the - * static initializer when using JNI. - */ - private static native void initIDs(); } diff --git a/java/lang/Float.java b/java/lang/Float.java index 29f9ac69e..82a1bdac1 100644 --- a/java/lang/Float.java +++ b/java/lang/Float.java @@ -173,7 +173,7 @@ public final class Float extends Number implements Comparable */ public static String toString(float f) { - return Double.toString(f, true); + return VMDouble.toString(f, true); } /** diff --git a/java/lang/Object.java b/java/lang/Object.java index c86da08c2..4bd3f2258 100644 --- a/java/lang/Object.java +++ b/java/lang/Object.java @@ -1,5 +1,5 @@ /* java.lang.Object - The universal superclass in Java - Copyright (C) 1998, 1999, 2000, 2001, 2002, 2004 + Copyright (C) 1998, 1999, 2000, 2001, 2002, 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -326,7 +326,10 @@ public class Object * * @return the class of this Object */ - public final native Class getClass(); + public final Class getClass() + { + return VMObject.getClass(this); + } /** * Wakes up one of the {@link Thread}s that has called |