Just to make this concrete, here's a small program demonstrating the
problem. Compile and run it, first against 1.4.2, then against
1.5/5.0:
import java.sql.Timestamp;
import java.util.Date;
public class Foo {
public static void main(String[] args) {
Date d = new Date();
Timestamp ts = new Timestamp(d.getTime());
System.out.println(ts.compareTo(d));
}
}
Note that this a *binary compatibility problem*!! The overload
resolution is the same in 1.4.2 and 1.5.0; in either case, it's
compareTo(Date). With a 1.4.2 runtime, it dispatches to the version
defined in java.util.Date, with a 1.5.0 runtime it dispatches to the
version defined in java.sql.Timestamp, which promptly casts its
argument to Timestamp (and blows up). This really feels like a P2 bug
to me.