This is the mail archive of the
mailing list for the Mauve project.
Re: Mauve vs 1.5
- From: Tom Tromey <tromey at redhat dot com>
- To: Mark Wielaard <mark at klomp dot org>
- Cc: classpath at gnu dot org, mauve-discuss at sourceware dot org
- Date: 25 Dec 2006 14:23:32 -0700
- Subject: Re: Mauve vs 1.5
- References: <email@example.com>
- Reply-to: tromey at redhat dot com
>>>>> "Mark" == Mark Wielaard <firstname.lastname@example.org> writes:
[ CharArrayWriter and Appendable ]
Mark> Now this is of course easily fixed by using -1.5 so the compiler knows
Mark> about covariant return types and makes all these tests that define
Mark> classes that extend some Writer class compile again.
Yes, let's do that...
Mark> But now we have another problem. Shown by anything that has implements a
Mark> retrofitted Comparable<T> interface like Integer:
Mark> 1. ERROR in gnu/testlet/java/lang/Integer/compareTo.java line 98:
Mark> harness.check(zero.compareTo(o) == 0);
Mark> The method compareTo(Integer) in the type Integer is not applicable for the arguments (Object)
In this code, 'o' is just 'zero' cast to an Object.
You could just change it to use compareTo(zero), but that doesn't test
the same thing...
You could change it to:
harness.check(((Comparable) zero).compareTo(o) == 0);
This will check using the raw Comparable and preserve the meaning of
the test, more or less.