Stefan, you're looking at an older version of the code. If you apply Paul's suggestions from http://mail.openjdk.java.net/pipermail/core-libs-dev/2015-May/033640.html the code works as expected.
Thanks Moh >-----Original Message----- >From: core-libs-dev [mailto:core-libs-dev-boun...@openjdk.java.net] On Behalf >Of Stefan Zobel >Sent: Monday, May 25, 2015 11:23 AM >To: core-libs-dev@openjdk.java.net >Subject: DualPivotQuicksort webrev for JDK-8080945 > >Hi all, > > >Unless I'm doing something immensely stupid, the DualPivotQuicksort >proposal in http://cr.openjdk.java.net/~psandoz/tmp/gs/sort/webrev.2/ >doesn't work for me. > > >This little program > > >public static void main(String[] args) { >int[] a = new int[287]; > >for (int i = 0; i < a.length; i++) { >a[i] = -((i % 143) + 1); >} > >System.out.println(Arrays.toString(a)); > >DualPivotQuicksort.sort(a, 0, a.length - 1, null, 0, 0); >} > > > >sends the sort into an infinite loop. Something wrong with the test?? > > >Stefan