From 73114a79fcd83574a119858cffebffd1df19e363 Mon Sep 17 00:00:00 2001 From: Mahmoud Ben Hassine Date: Tue, 4 Jul 2023 18:54:44 +0200 Subject: [PATCH] Replace Collections.sort(list, comparator) with list.sort(comparator) --- .../batch/core/listener/OrderedComposite.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/listener/OrderedComposite.java b/spring-batch-core/src/main/java/org/springframework/batch/core/listener/OrderedComposite.java index 5307ae387..84a679313 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/listener/OrderedComposite.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/listener/OrderedComposite.java @@ -1,5 +1,5 @@ /* - * Copyright 2006-2007 the original author or authors. + * Copyright 2006-2023 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -28,6 +28,7 @@ import org.springframework.core.annotation.Order; /** * @author Dave Syer + * @author Mahmoud Ben Hassine * */ class OrderedComposite { @@ -70,7 +71,7 @@ class OrderedComposite { else if (!unordered.contains(item)) { unordered.add(item); } - Collections.sort(ordered, comparator); + ordered.sort(comparator); list.clear(); list.addAll(ordered); list.addAll(unordered);