This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Patch: FYI: PR 31646
- From: Tom Tromey <tromey at redhat dot com>
- To: GCJ-patches <java-patches at gcc dot gnu dot org>
- Date: 23 Apr 2007 09:56:06 -0600
- Subject: Patch: FYI: PR 31646
- Reply-to: tromey at redhat dot com
I'm checking this in on the trunk and the RH 4.1 branch.
This fixes an ugly bug in Arrays.qsort.
Tom
Index: ChangeLog
from Jeroen Frijters <jeroen@frijters.net>
PR classpath/31646:
* java/util/Arrays.java (qsort): Corrected initial median calculation.
Index: java/util/Arrays.java
===================================================================
--- java/util/Arrays.java (revision 123959)
+++ java/util/Arrays.java (working copy)
@@ -1040,7 +1040,7 @@
}
// Determine a good median element.
- int mid = count / 2;
+ int mid = from + count / 2;
int lo = from;
int hi = from + count - 1;
@@ -1204,7 +1204,7 @@
}
// Determine a good median element.
- int mid = count / 2;
+ int mid = from + count / 2;
int lo = from;
int hi = from + count - 1;
@@ -1368,7 +1368,7 @@
}
// Determine a good median element.
- int mid = count / 2;
+ int mid = from + count / 2;
int lo = from;
int hi = from + count - 1;
@@ -1544,7 +1544,7 @@
}
// Determine a good median element.
- int mid = count / 2;
+ int mid = from + count / 2;
int lo = from;
int hi = from + count - 1;
@@ -1720,7 +1720,7 @@
}
// Determine a good median element.
- int mid = count / 2;
+ int mid = from + count / 2;
int lo = from;
int hi = from + count - 1;
@@ -1890,7 +1890,7 @@
}
// Determine a good median element.
- int mid = count / 2;
+ int mid = from + count / 2;
int lo = from;
int hi = from + count - 1;
@@ -2060,7 +2060,7 @@
}
// Determine a good median element.
- int mid = count / 2;
+ int mid = from + count / 2;
int lo = from;
int hi = from + count - 1;