bug-classpath
[Top][All Lists]
Advanced

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

[Bug classpath/31646] New: Array.sort() broken


From: jeroen at frijters dot net
Subject: [Bug classpath/31646] New: Array.sort() broken
Date: 21 Apr 2007 11:44:21 -0000

Arrays.sort() is broken as this code demonstrates:

class sort
{
  public static void main(String[] args)
  {
    int[] arr = new int[20];
    arr[0] = 0;
    arr[1] = 1;
    arr[2] = 2;
    arr[3] = 3;
    arr[4] = 4;
    arr[5] = 5;
    arr[6] = 6;
    arr[7] = 7;
    arr[8] = 8;
    arr[9] = 9;
    arr[10] = 9;
    arr[11] = 8;
    arr[12] = 7;
    arr[13] = 6;
    arr[14] = 5;
    arr[15] = 4;
    arr[16] = 3;
    arr[17] = 2;
    arr[18] = 1;
    arr[19] = 0;
    java.util.Arrays.sort(arr, 10, 20);
    for (int i = 10; i < 20; i++) System.out.print(arr[i] + ", ");
  }
}

Output:

0, 1, 2, 3, 4, 5, 5, 6, 7, 8,


-- 
           Summary: Array.sort() broken
           Product: classpath
           Version: unspecified
            Status: UNCONFIRMED
          Severity: major
          Priority: P3
         Component: classpath
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: jeroen at frijters dot net


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31646





reply via email to

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