Index: /luni/src/main/java/java/util/Date.java =================================================================== --- /luni/src/main/java/java/util/Date.java (revision 397752) +++ /luni/src/main/java/java/util/Date.java (working copy) @@ -33,7 +33,7 @@ * @see SimpleTimeZone * @see TimeZone */ -public class Date implements Serializable, Cloneable, Comparable { +public class Date implements Serializable, Cloneable, Comparable { private static final long serialVersionUID = 7523967970034938905L; @@ -181,22 +181,6 @@ } /** - * Compare the receiver to the specified Object to determine the relative - * ordering. - * - * @param object - * an Object - * @return an int < 0 if this Date is less than the specified Date, 0 if - * they are equal, and > 0 if this Date is greater - * - * @exception ClassCastException - * when object is not a Date - */ - public int compareTo(Object object) { - return compareTo((Date) object); - } - - /** * Compare the receiver to the specified Date to determine the relative * ordering. * Index: /luni/src/test/java/tests/api/java/util/DateTest.java =================================================================== --- /luni/src/test/java/tests/api/java/util/DateTest.java (revision 397752) +++ /luni/src/test/java/tests/api/java/util/DateTest.java (working copy) @@ -147,34 +147,6 @@ } /** - * @tests java.util.Date#compareTo(java.lang.Object) - */ - public void test_compareToLjava_lang_Object() { - // Test for method int java.util.Date.compareTo(java.lang.Object) - final int someNumber = 10000; - Date d1 = new Date(someNumber); - Date d2 = new Date(someNumber); - Date d3 = new Date(someNumber + 1); - Date d4 = new Date(someNumber - 1); - Integer i = new Integer(0); - assertEquals("Comparing a date to itself did not answer zero", 0, d1 - .compareTo((Object) d1)); - assertEquals("Comparing equal dates did not answer zero", 0, d1 - .compareTo((Object) d2)); - assertEquals("date1.compareTo(date2), where date1 > date2, did not result in 1", - 1, d1.compareTo((Object) d4)); - assertEquals("date1.compareTo(date2), where date1 < date2, did not result in -1", - -1, d1.compareTo((Object) d3)); - try { - d1.compareTo(i); - } catch (ClassCastException e) { - return; - } - fail( - "Comparing a date to a non-date did not throw ClassCastException"); - } - - /** * @tests java.util.Date#compareTo(java.util.Date) */ public void test_compareToLjava_util_Date() {