mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 15:24:43 +02:00
8272863: Replace usages of Collections.sort with List.sort call in public java modules
Reviewed-by: serb, dfuchs, naoto
This commit is contained in:
parent
fe7d70886c
commit
d732c3091f
10 changed files with 19 additions and 27 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2005, 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -27,7 +27,6 @@ package java.net;
|
|||
|
||||
import java.util.Map;
|
||||
import java.util.List;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.io.IOException;
|
||||
import sun.util.logging.PlatformLogger;
|
||||
|
@ -407,7 +406,7 @@ public class CookieManager extends CookieHandler
|
|||
* path are distinguished by creation time (older first). Method made PP to enable testing.
|
||||
*/
|
||||
static List<String> sortByPathAndAge(List<HttpCookie> cookies) {
|
||||
Collections.sort(cookies, new CookieComparator());
|
||||
cookies.sort(new CookieComparator());
|
||||
|
||||
List<String> cookieHeader = new java.util.ArrayList<>();
|
||||
for (HttpCookie cookie : cookies) {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2012, 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -75,7 +75,6 @@ import java.time.temporal.TemporalField;
|
|||
import java.util.AbstractMap.SimpleImmutableEntry;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
|
@ -553,12 +552,12 @@ class DateTimeTextProvider {
|
|||
}
|
||||
}
|
||||
List<Entry<String, Long>> list = new ArrayList<>(reverse.values());
|
||||
Collections.sort(list, COMPARATOR);
|
||||
list.sort(COMPARATOR);
|
||||
map.put(vtmEntry.getKey(), list);
|
||||
allList.addAll(list);
|
||||
map.put(null, allList);
|
||||
}
|
||||
Collections.sort(allList, COMPARATOR);
|
||||
allList.sort(COMPARATOR);
|
||||
this.parsable = map;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 1995, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1995, 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -198,7 +198,7 @@ public class FileURLConnection extends URLConnection {
|
|||
throw new FileNotFoundException(filename);
|
||||
}
|
||||
|
||||
Collections.sort(files, Collator.getInstance());
|
||||
files.sort(Collator.getInstance());
|
||||
|
||||
for (int i = 0 ; i < files.size() ; i++) {
|
||||
String fileName = files.get(i);
|
||||
|
|
|
@ -239,7 +239,7 @@ class PKIX {
|
|||
if (stores == null) {
|
||||
// reorder CertStores so that local CertStores are tried first
|
||||
stores = new ArrayList<>(params.getCertStores());
|
||||
Collections.sort(stores, new CertStoreComparator());
|
||||
stores.sort(new CertStoreComparator());
|
||||
}
|
||||
return stores;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue