public inbox for mauve-discuss@sourceware.org
 help / color / mirror / Atom feed
From: Tom Tromey <tromey@redhat.com>
To: Mark Wielaard <mark@klomp.org>
Cc: classpath@gnu.org, mauve-discuss@sourceware.org
Subject: Re: Mauve vs 1.5
Date: Mon, 25 Dec 2006 23:30:00 -0000	[thread overview]
Message-ID: <m3mz5b8yaz.fsf@localhost.localdomain> (raw)
In-Reply-To: <1167062788.2969.43.camel@localhost.localdomain>

>>>>> "Mark" == Mark Wielaard <mark@klomp.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>                            ^^^^^^^^^
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.

Tom

  reply	other threads:[~2006-12-25 23:30 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-25 16:06 Mark Wielaard
2006-12-25 23:30 ` Tom Tromey [this message]
2006-12-27 15:46   ` Mark Wielaard

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m3mz5b8yaz.fsf@localhost.localdomain \
    --to=tromey@redhat.com \
    --cc=classpath@gnu.org \
    --cc=mark@klomp.org \
    --cc=mauve-discuss@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).