diff -ur kaffe/libraries/javalib/java/lang/Byte.java patched-kaffe/libraries/javalib/java/lang/Byte.java
--- kaffe/libraries/javalib/java/lang/Byte.java	Thu Jul  8 20:05:24 1999
+++ patched-kaffe/libraries/javalib/java/lang/Byte.java	Wed Mar 20 14:22:19 2002
@@ -93,8 +93,11 @@
 	return (new Byte(parseByte(s, radix)));
 }
 
-public int compareTo(Object o) {
-	return (int)value - (int)((Byte)o).value;
+public int compareTo(Byte b) {
+	return (int)value - (int)b.value;
 }
 
+public int compareTo(Object o) {
+	return compareTo((Byte) o);
+}
 }
diff -ur kaffe/libraries/javalib/java/lang/Character.java patched-kaffe/libraries/javalib/java/lang/Character.java
--- kaffe/libraries/javalib/java/lang/Character.java	Sat Sep 18 01:09:52 1999
+++ patched-kaffe/libraries/javalib/java/lang/Character.java	Wed Mar 20 14:22:36 2002
@@ -84,9 +84,14 @@
     return (String.valueOf(value));
   }
 
+  public int compareTo(Character c)
+  {
+    return (int)value - (int)c.value;
+  }
+
   public int compareTo(Object o)
   {
-    return (int)value - (int)((Character)o).value;
+    return compareTo((Character)o);
   }
 
   /**
diff -ur kaffe/libraries/javalib/java/lang/Double.java patched-kaffe/libraries/javalib/java/lang/Double.java
--- kaffe/libraries/javalib/java/lang/Double.java	Mon Dec  3 13:11:41 2001
+++ patched-kaffe/libraries/javalib/java/lang/Double.java	Wed Mar 20 14:04:10 2002
@@ -59,11 +59,15 @@
     return value;
   }
 
-  public int compareTo(Object that) {
+  public int compareTo(Double that) {
     final long bits1 = doubleToLongBits(this.value);
-    final long bits2 = doubleToLongBits(((Double)that).value);
+    final long bits2 = doubleToLongBits(that.value);
 
     return (bits1 < bits2) ? -1 : (bits1 == bits2) ? 0 : 1;
+  }
+
+  public int compareTo(Object that) {
+    return compareTo((Double) that);
   }
 
   public static String toString(double value) {
diff -ur kaffe/libraries/javalib/java/lang/Float.java patched-kaffe/libraries/javalib/java/lang/Float.java
--- kaffe/libraries/javalib/java/lang/Float.java	Mon Dec  3 13:11:41 2001
+++ patched-kaffe/libraries/javalib/java/lang/Float.java	Wed Mar 20 14:06:05 2002
@@ -52,11 +52,15 @@
       && floatToIntBits(value) == floatToIntBits(((Float)that).value));
   }
 
-  public int compareTo(Object that) {
+  public int compareTo(Float that) {
     final int bits1 = floatToIntBits(this.value);
-    final int bits2 = floatToIntBits(((Float)that).value);
+    final int bits2 = floatToIntBits(that.value);
 
     return (bits1 < bits2) ? -1 : (bits1 == bits2) ? 0 : 1;
+  }
+
+  public int compareTo(Object that) {
+    return compareTo((Float) that);
   }
 
   public int hashCode() {
diff -ur kaffe/libraries/javalib/java/lang/Integer.java patched-kaffe/libraries/javalib/java/lang/Integer.java
--- kaffe/libraries/javalib/java/lang/Integer.java	Sat Jul 24 02:56:26 1999
+++ patched-kaffe/libraries/javalib/java/lang/Integer.java	Wed Mar 20 14:19:38 2002
@@ -73,11 +73,15 @@
 		(((Integer)obj).value == this.value);
 }
 
-public int compareTo(Object o) {
+public int compareTo(Integer i) {
 	final int int1 = this.value;
-	final int int2 = ((Integer)o).value;
+	final int int2 = i.value;
 
 	return (int1 == int2) ? 0 : (int1 < int2) ? -1 : 1;
+}
+
+public int compareTo(Object o) {
+	return compareTo((Integer) o);
 }
 
 public float floatValue() {
diff -ur kaffe/libraries/javalib/java/lang/Long.java patched-kaffe/libraries/javalib/java/lang/Long.java
--- kaffe/libraries/javalib/java/lang/Long.java	Mon Mar 18 02:13:14 2002
+++ patched-kaffe/libraries/javalib/java/lang/Long.java	Wed Mar 20 14:21:00 2002
@@ -38,11 +38,15 @@
 		(((Long)obj).value == this.value);
 }
 
-public int compareTo(Object o) {
+public int compareTo(Long l) {
 	final long long1 = this.value;
-	final long long2 = ((Long)o).value;
+	final long long2 = l.value;
 
 	return (long1 == long2) ? 0 : (long1 < long2) ? -1 : 1;
+}
+
+public int compareTo(Object o) {
+	return compareTo((Long) o);
 }
 
 public float floatValue() {
diff -ur kaffe/libraries/javalib/java/lang/Short.java patched-kaffe/libraries/javalib/java/lang/Short.java
--- kaffe/libraries/javalib/java/lang/Short.java	Thu Jul  8 20:05:26 1999
+++ patched-kaffe/libraries/javalib/java/lang/Short.java	Wed Mar 20 14:22:08 2002
@@ -49,7 +49,11 @@
 }
 
 public int compareTo(Object o) {
-	return (int)value - (int)((Short)o).value;
+	return compareTo((Short) o);
+}
+
+public int compareTo(Short s) {
+	return (int)value - (int)s.value;
 }
 
 public float floatValue()
