--- old/src/share/classes/java/util/Collections.java 2012-03-01 11:26:16.000000000 -0800 +++ new/src/share/classes/java/util/Collections.java 2012-03-01 11:26:15.000000000 -0800 @@ -152,6 +152,9 @@ */ public static > void sort(List list) { Object[] a = list.toArray(); + if(a.length <= 1) { + return; + } Arrays.sort(a); ListIterator i = list.listIterator(); for (int j=0; j void sort(List list, Comparator c) { Object[] a = list.toArray(); + if(a.length <= 1) { + return; + } Arrays.sort(a, (Comparator)c); - ListIterator i = list.listIterator(); + ListIterator i = list.listIterator(); for (int j=0; j COMPARATOR = new Comparator() { + public int compare(Integer one, Integer two) { + return one - two; + } + }; + + public static void main(String[] args) throws Exception { + List empty = Collections.emptyList(); + Collections.sort(empty); + Collections.sort(empty,COMPARATOR); + + // 7065380 + List single = Collections.singletonList(0); + Collections.sort(single); + Collections.sort(single,COMPARATOR); + } +}