Replace Collections.sort() with direct sort call

Replace existing `Collections.sort(...)` calls with `.sort(...)`
directly on the collection instance.

See gh-9781
This commit is contained in:
Emanuel Campolo
2017-07-18 11:51:31 -03:00
committed by Phillip Webb
parent 04fdec6f8b
commit 4a189bdee7
15 changed files with 16 additions and 20 deletions

View File

@@ -234,7 +234,7 @@ public abstract class MainClassFinder {
static <T> T doWithMainClasses(JarFile jarFile, String classesLocation,
MainClassCallback<T> callback) throws IOException {
List<JarEntry> classEntries = getClassEntries(jarFile, classesLocation);
Collections.sort(classEntries, new ClassEntryComparator());
classEntries.sort(new ClassEntryComparator());
for (JarEntry entry : classEntries) {
try (InputStream inputStream = new BufferedInputStream(
jarFile.getInputStream(entry))) {