Re: [cp-patches] java.util.Arrays fix

2007-01-19 Thread Tom Tromey
Marco pinged me about various patches of his, and in response I re-read this whole thread. I am going to check in this patch. I have three reasons for this, based on a few thought experiments. First, I tried to imagine under what conditions Sun could change their implementation. That is pretty

Re: [cp-patches] java.util.Arrays fix

2006-12-14 Thread Andrew Haley
Marco Trudel writes: > Andrew Haley wrote: > > No, I don't mean that. I mean that if we change this behaviour today, > > we can't guarantee that someone won't chnage it back tomorrow. > > Change it back in classpath or in a Sun JRE? In Classpath. > For the first point we have mauve. I s

Re: [cp-patches] java.util.Arrays fix

2006-12-14 Thread Marco Trudel
Andrew Haley wrote: Marco Trudel writes: > Andrew Haley wrote: > > Marco Trudel writes: > > > > Right, so if it isn't a bug it can't be a regression. > > True! But I made a bug in my patch, fixed in the attached one. > > > > >> So as I said, I don't mean to offend you, I just can't fo

Re: [cp-patches] java.util.Arrays fix

2006-12-14 Thread Andrew Haley
Marco Trudel writes: > Andrew Haley wrote: > > Marco Trudel writes: > > > > Right, so if it isn't a bug it can't be a regression. > > True! But I made a bug in my patch, fixed in the attached one. > > > > >> So as I said, I don't mean to offend you, I just can't follow > > > >> why we

Re: [cp-patches] java.util.Arrays fix

2006-12-14 Thread Marco Trudel
Andrew Haley wrote: Marco Trudel writes: > Casey Marshall wrote: > > On Dec 13, 2006, at 1:28 PM, Marco Trudel wrote: > > > >> David Daney wrote: > >>> Casey Marshall wrote: > In general I really urge against going out of our way to support > behavior like this. > >> > >>

Re: [cp-patches] java.util.Arrays fix

2006-12-14 Thread Andrew Haley
Marco Trudel writes: > Casey Marshall wrote: > > On Dec 13, 2006, at 1:28 PM, Marco Trudel wrote: > > > >> David Daney wrote: > >>> Casey Marshall wrote: > In general I really urge against going out of our way to support > behavior like this. > >> > >> Can you explain that fur

Re: [cp-patches] java.util.Arrays fix

2006-12-13 Thread Marco Trudel
Casey Marshall wrote: On Dec 13, 2006, at 1:28 PM, Marco Trudel wrote: David Daney wrote: Casey Marshall wrote: In general I really urge against going out of our way to support behavior like this. Can you explain that further? You're against changes that - keep the specification as correct

Re: [cp-patches] java.util.Arrays fix

2006-12-13 Thread Casey Marshall
On Dec 13, 2006, at 1:28 PM, Marco Trudel wrote: David Daney wrote: Casey Marshall wrote: In general I really urge against going out of our way to support behavior like this. Can you explain that further? You're against changes that - keep the specification as correct as they were before -

Re: [cp-patches] java.util.Arrays fix

2006-12-13 Thread Marco Trudel
David Daney wrote: Casey Marshall wrote: On Dec 13, 2006, at 12:21 PM, David Daney wrote: Casey Marshall wrote: On Dec 13, 2006, at 12:56 AM, Marco Trudel wrote: Hey guys java.util.Arrays.binarySearch(Object[] a, Object key, Comparator c) exchanges a[i] and key, this can lead to ClassC

Re: [cp-patches] java.util.Arrays fix

2006-12-13 Thread David Daney
Casey Marshall wrote: On Dec 13, 2006, at 12:21 PM, David Daney wrote: Casey Marshall wrote: On Dec 13, 2006, at 12:56 AM, Marco Trudel wrote: Hey guys java.util.Arrays.binarySearch(Object[] a, Object key, Comparator c) exchanges a[i] and key, this can lead to ClassCastExceptions as

Re: [cp-patches] java.util.Arrays fix

2006-12-13 Thread Casey Marshall
On Dec 13, 2006, at 12:21 PM, David Daney wrote: Casey Marshall wrote: On Dec 13, 2006, at 12:56 AM, Marco Trudel wrote: Hey guys java.util.Arrays.binarySearch(Object[] a, Object key, Comparator c) exchanges a[i] and key, this can lead to ClassCastExceptions as shown in ComparatorTest.j

Re: [cp-patches] java.util.Arrays fix

2006-12-13 Thread David Daney
Casey Marshall wrote: On Dec 13, 2006, at 12:56 AM, Marco Trudel wrote: Hey guys java.util.Arrays.binarySearch(Object[] a, Object key, Comparator c) exchanges a[i] and key, this can lead to ClassCastExceptions as shown in ComparatorTest.java. Arrays.patch fixes it. http://gcc.gnu.org/b

Re: [cp-patches] java.util.Arrays fix

2006-12-13 Thread Casey Marshall
On Dec 13, 2006, at 12:56 AM, Marco Trudel wrote: Hey guys java.util.Arrays.binarySearch(Object[] a, Object key, Comparator c) exchanges a[i] and key, this can lead to ClassCastExceptions as shown in ComparatorTest.java. Arrays.patch fixes it. http://gcc.gnu.org/bugzilla/show_bug.cgi?id

Re: [cp-patches] java.util.Arrays fix

2006-12-13 Thread Tom Tromey
Andrew> This is, of course, the delusion of Write Once, Run Anywhere. :-) FWIW this particular "reversed" comparison (or others in the same file in any case) has caught bugs in comparators in the field. I remember one in Eclipse for example. Unfortunately there's no way to have the compiler giv

Re: [cp-patches] java.util.Arrays fix

2006-12-13 Thread Andrew Haley
Marco Trudel writes: > Andrew Haley wrote: > > Marco Trudel writes: > > > Andrew Haley wrote: > > > > > > No. The point is that completely different objects might be passed > > which > > > have no relation with each other. A stupid example: > > > > > > Object[] o1 = { "22", "23",

Re: [cp-patches] java.util.Arrays fix

2006-12-13 Thread Marco Trudel
Andrew Haley wrote: Marco Trudel writes: > Andrew Haley wrote: > > Marco Trudel writes: > > > Andrew Haley wrote: > > > > Marco Trudel writes: > > > > > Andrew Haley wrote: > > > > > > Marco Trudel writes: > > > > > > > Hey guys > > > > > > > > > > > > > > java.util.Array

Re: [cp-patches] java.util.Arrays fix

2006-12-13 Thread Andrew Haley
Marco Trudel writes: > Andrew Haley wrote: > > Marco Trudel writes: > > > Andrew Haley wrote: > > > > Marco Trudel writes: > > > > > Andrew Haley wrote: > > > > > > Marco Trudel writes: > > > > > > > Hey guys > > > > > > > > > > > > > > java.util.Arrays.binarySearch(Object[

Re: [cp-patches] java.util.Arrays fix

2006-12-13 Thread Marco Trudel
Andrew Haley wrote: Marco Trudel writes: > Andrew Haley wrote: > > Marco Trudel writes: > > > Andrew Haley wrote: > > > > Marco Trudel writes: > > > > > Hey guys > > > > > > > > > > java.util.Arrays.binarySearch(Object[] a, Object key, Comparator c) > > > > > exchanges a[i] an

Re: [cp-patches] java.util.Arrays fix

2006-12-13 Thread Andrew Haley
Marco Trudel writes: > Andrew Haley wrote: > > Marco Trudel writes: > > > Andrew Haley wrote: > > > > Marco Trudel writes: > > > > > Hey guys > > > > > > > > > > java.util.Arrays.binarySearch(Object[] a, Object key, Comparator > > c) > > > > > exchanges a[i] and key, this can

Re: [cp-patches] java.util.Arrays fix

2006-12-13 Thread Marco Trudel
Andrew Haley wrote: Marco Trudel writes: > Andrew Haley wrote: > > Marco Trudel writes: > > > Hey guys > > > > > > java.util.Arrays.binarySearch(Object[] a, Object key, Comparator c) > > > exchanges a[i] and key, this can lead to ClassCastExceptions as shown in > > > ComparatorTest

Re: [cp-patches] java.util.Arrays fix

2006-12-13 Thread Andrew Haley
Marco Trudel writes: > Andrew Haley wrote: > > Marco Trudel writes: > > > Hey guys > > > > > > java.util.Arrays.binarySearch(Object[] a, Object key, Comparator c) > > > exchanges a[i] and key, this can lead to ClassCastExceptions as shown > > in > > > ComparatorTest.java. Arrays.pa

Re: [cp-patches] java.util.Arrays fix

2006-12-13 Thread Marco Trudel
Andrew Haley wrote: Marco Trudel writes: > Hey guys > > java.util.Arrays.binarySearch(Object[] a, Object key, Comparator c) > exchanges a[i] and key, this can lead to ClassCastExceptions as shown in > ComparatorTest.java. Arrays.patch fixes it. > > > Changelog suggestion: > > 2006

Re: [cp-patches] java.util.Arrays fix

2006-12-13 Thread Andrew Haley
Marco Trudel writes: > Hey guys > > java.util.Arrays.binarySearch(Object[] a, Object key, Comparator c) > exchanges a[i] and key, this can lead to ClassCastExceptions as shown in > ComparatorTest.java. Arrays.patch fixes it. > > > Changelog suggestion: > > 2006-12-13 Marco Trudel

[cp-patches] java.util.Arrays fix

2006-12-13 Thread Marco Trudel
Hey guys java.util.Arrays.binarySearch(Object[] a, Object key, Comparator c) exchanges a[i] and key, this can lead to ClassCastExceptions as shown in ComparatorTest.java. Arrays.patch fixes it. Changelog suggestion: 2006-12-13 Marco Trudel <[EMAIL PROTECTED]> * classpath/java/util/Array