On 06/08/13 21:52, Martin Buchholz wrote:
On Sat, Jun 8, 2013 at 8:50 AM, Doug Lea <d...@cs.oswego.edu
<mailto:d...@cs.oswego.edu>> wrote:
Suppose you have two objects, x and y, both of the same
type (x.getClass() == y.getClass()) and both known
to be instanceof Comparable.
Can you compare them? That is, can you safely call
(Comparable)x).compareTo(y);
Probably others tried and gave up, because you cannot actually get a reliable
answer - you can only get YES NO DUNNO, because some of the generic type
information you need may have been erased.
Right, including the case where the class itself was declared with
raw types. I should have stated that the method spec should say
that a true return means YES, a false return means "not validated
under best effort".
-Doug