Index: java/lang/Boolean.java
===================================================================
RCS file: /cvs/classpath/java/lang/Boolean.java,v
retrieving revision 1.16
diff -u -r1.16 Boolean.java
--- java/lang/Boolean.java 2001/07/17 23:06:09 1.16
+++ java/lang/Boolean.java 2001/11/10 16:49:56
@@ -60,7 +60,7 @@
* The primitive type boolean
is represented by this
* Class
object.
*/
- public static final Class TYPE = VMClassLoader.getPrimitiveClass("boolean");
+ public static final Class TYPE = VMClassLoader.getPrimitiveClass('Z');
/**
* The immutable value of this Boolean.
Index: java/lang/Byte.java
===================================================================
RCS file: /cvs/classpath/java/lang/Byte.java,v
retrieving revision 1.17
diff -u -r1.17 Byte.java
--- java/lang/Byte.java 2001/07/23 20:01:44 1.17
+++ java/lang/Byte.java 2001/11/10 16:49:56
@@ -57,7 +57,7 @@
* The primitive type byte
is represented by this
* Class
object.
*/
- public static final Class TYPE = VMClassLoader.getPrimitiveClass("byte");
+ public static final Class TYPE = VMClassLoader.getPrimitiveClass('B');
/**
* The immutable value of this Byte.
Index: java/lang/Character.java
===================================================================
RCS file: /cvs/classpath/java/lang/Character.java,v
retrieving revision 1.16
diff -u -r1.16 Character.java
--- java/lang/Character.java 2001/09/05 19:30:55 1.16
+++ java/lang/Character.java 2001/11/10 16:49:56
@@ -460,7 +460,7 @@
/**
* Class object representing the primitive char data type.
*/
- public static final Class TYPE = VMClassLoader.getPrimitiveClass("char");
+ public static final Class TYPE = VMClassLoader.getPrimitiveClass('C');
/**
* Cn = Other, Not Assigned (Normative)
Index: java/lang/Double.java
===================================================================
RCS file: /cvs/classpath/java/lang/Double.java,v
retrieving revision 1.21
diff -u -r1.21 Double.java
--- java/lang/Double.java 2001/10/20 01:08:15 1.21
+++ java/lang/Double.java 2001/11/10 16:49:56
@@ -80,7 +80,7 @@
* The primitive type double
is represented by this
* Class
object.
*/
- public static final Class TYPE = VMClassLoader.getPrimitiveClass ("double");
+ public static final Class TYPE = VMClassLoader.getPrimitiveClass('D');
/**
* The immutable value of this Double.
Index: java/lang/Float.java
===================================================================
RCS file: /cvs/classpath/java/lang/Float.java,v
retrieving revision 1.20
diff -u -r1.20 Float.java
--- java/lang/Float.java 2001/10/20 01:08:15 1.20
+++ java/lang/Float.java 2001/11/10 16:49:57
@@ -79,7 +79,7 @@
* The primitive type float
is represented by this
* Class
object.
*/
- public static final Class TYPE = VMClassLoader.getPrimitiveClass ("float");
+ public static final Class TYPE = VMClassLoader.getPrimitiveClass('F');
/**
* The immutable value of this Float.
Index: java/lang/Integer.java
===================================================================
RCS file: /cvs/classpath/java/lang/Integer.java,v
retrieving revision 1.20
diff -u -r1.20 Integer.java
--- java/lang/Integer.java 2001/07/30 17:41:09 1.20
+++ java/lang/Integer.java 2001/11/10 16:49:57
@@ -58,7 +58,7 @@
* The primitive type int
is represented by this
* Class
object.
*/
- public static final Class TYPE = VMClassLoader.getPrimitiveClass ("int");
+ public static final Class TYPE = VMClassLoader.getPrimitiveClass ('I');
/**
* The immutable value of this Integer.
Index: java/lang/Long.java
===================================================================
RCS file: /cvs/classpath/java/lang/Long.java,v
retrieving revision 1.11
diff -u -r1.11 Long.java
--- java/lang/Long.java 2001/07/23 20:01:44 1.11
+++ java/lang/Long.java 2001/11/10 16:49:57
@@ -60,7 +60,7 @@
* The primitive type long
is represented by this
* Class
object.
*/
- public static final Class TYPE = VMClassLoader.getPrimitiveClass ("long");
+ public static final Class TYPE = VMClassLoader.getPrimitiveClass ('J');
/**
* The immutable value of this Long.
Index: java/lang/Short.java
===================================================================
RCS file: /cvs/classpath/java/lang/Short.java,v
retrieving revision 1.10
diff -u -r1.10 Short.java
--- java/lang/Short.java 2001/07/23 20:01:44 1.10
+++ java/lang/Short.java 2001/11/10 16:49:57
@@ -56,7 +56,7 @@
* The primitive type short
is represented by this
* Class
object.
*/
- public static final Class TYPE = VMClassLoader.getPrimitiveClass("short");
+ public static final Class TYPE = VMClassLoader.getPrimitiveClass('S');
/**
* The immutable value of this Short.
Index: java/lang/Void.java
===================================================================
RCS file: /cvs/classpath/java/lang/Void.java,v
retrieving revision 1.11
diff -u -r1.11 Void.java
--- java/lang/Void.java 2001/09/30 23:00:33 1.11
+++ java/lang/Void.java 2001/11/10 16:49:57
@@ -47,7 +47,7 @@
* The return type void
is represented by this
* Class
object.
*/
- public static final Class TYPE = VMClassLoader.getPrimitiveClass("void");
+ public static final Class TYPE = VMClassLoader.getPrimitiveClass('V');
/**
* Don't allow Void objects to be made.
Index: vm/reference/java/lang/VMClassLoader.java
===================================================================
RCS file: /cvs/classpath/vm/reference/java/lang/VMClassLoader.java,v
retrieving revision 1.7
diff -u -r1.7 VMClassLoader.java
--- vm/reference/java/lang/VMClassLoader.java 1999/12/12 17:42:58 1.7
+++ vm/reference/java/lang/VMClassLoader.java 2001/11/10 16:49:58
@@ -58,6 +58,42 @@
* @param type name of the primitive type; i.e. "int", "byte", etc.
* @return a "bogus" class representing the primitive type.
*/
- final static native Class getPrimitiveClass(String type);
+ final static Class getPrimitiveClass(char type)
+ {
+ String t;
+ switch (type) {
+ case 'Z':
+ t = "boolean";
+ break;
+ case 'B':
+ t = "byte";
+ break;
+ case 'C':
+ t = "char";
+ break;
+ case 'D':
+ t = "double";
+ break;
+ case 'F':
+ t = "float";
+ break;
+ case 'I':
+ t = "int";
+ break;
+ case 'J':
+ t = "long";
+ break;
+ case 'S':
+ t = "short";
+ break;
+ case 'V':
+ t = "void";
+ break;
+ default:
+ throw new NoClassDefFoundError("Invalid type specifier: " + type);
+ }
+ return getPrimitiveClass(t);
+ }
+ final static native Class getPrimitiveClass(String type);
}