Skip to content

Commit 73114a7

Browse files
committed
Replace Collections.sort(list, comparator) with list.sort(comparator)
1 parent 5a6fff0 commit 73114a7

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

spring-batch-core/src/main/java/org/springframework/batch/core/listener/OrderedComposite.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2006-2007 the original author or authors.
2+
* Copyright 2006-2023 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -28,6 +28,7 @@
2828

2929
/**
3030
* @author Dave Syer
31+
* @author Mahmoud Ben Hassine
3132
*
3233
*/
3334
class OrderedComposite<S> {
@@ -70,7 +71,7 @@ else if (AnnotationUtils.isAnnotationDeclaredLocally(Order.class, item.getClass(
7071
else if (!unordered.contains(item)) {
7172
unordered.add(item);
7273
}
73-
Collections.sort(ordered, comparator);
74+
ordered.sort(comparator);
7475
list.clear();
7576
list.addAll(ordered);
7677
list.addAll(unordered);

0 commit comments

Comments
 (0)