classpath-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[cp-patches] RE: Collections.binarySearch and poorly written comparators


From: Jeroen Frijters
Subject: [cp-patches] RE: Collections.binarySearch and poorly written comparators
Date: Sat, 24 Dec 2005 13:04:00 +0100

Tom Tromey wrote:
> >>>>> "Jim" == Jim Murphy <address@hidden> writes:
> 
> Jim> The bad comparator implementation assumes that o1 is a Foo and o2
> Jim> is a Bar.  This "works" when running on the Sum JRE
> Jim> implementation of Ccollections.binarySearch but fails with the
> Jim> CLASSPATH's implementation because the types are transposed.
> 
> Yeah.  We actually hit this in Eclipse once.  In that case we were
> able to fix it upstream.
> 
> Jim> If a goal of CLASSPATH is to be broadly useful does 
> being "bug for bug"
> Jim> compatible matter to you guys?  Would you consider this a bug?
> 
> There's no question that there is a bug in the library you're using
> :-)
> 
> I'm ambivalent about fixing this in Classpath.  There was a similar
> case recently where in the end I think we decided not to make a
> decision... I guess you could force the issue by writing a patch for
> review.  Then somebody would actually have to take a stand.

Seeing as we've already run into this twice, I've written a patch and
corresponding Mauve test and I'm going to commit it unless someone
complains with a valid argument.

I wrote a blog entry about my philosophy regarding these issues:
http://weblog.ikvm.net/default.aspx?date=2005-12-24

Regards,
Jeroen

Attachment: Collections.java.patch
Description: Collections.java.patch

Attachment: binarySearch.java.patch
Description: binarySearch.java.patch


reply via email to

[Prev in Thread] Current Thread [Next in Thread]