camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject [1/6] camel git commit: CAMEL-10562: camel-core - Switched to List#sort
Date Thu, 08 Dec 2016 08:42:51 GMT
Repository: camel
Updated Branches:
  refs/heads/camel-2.18.x 5b321b4df -> f55e08774
  refs/heads/master 7567488f8 -> 3c0b7d036


CAMEL-10562: camel-core - Switched to List#sort


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/81c22c7b
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/81c22c7b
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/81c22c7b

Branch: refs/heads/master
Commit: 81c22c7b4d0a81d3e66dd2552470bcb4ec9f8379
Parents: 08a1817
Author: Stefan Schulze <stefan.schulze3@gmail.com>
Authored: Wed Dec 7 22:43:15 2016 +0100
Committer: Claus Ibsen <davsclaus@apache.org>
Committed: Thu Dec 8 09:29:16 2016 +0100

----------------------------------------------------------------------
 .../org/apache/camel/builder/ExpressionBuilder.java     |  2 +-
 .../java/org/apache/camel/component/bean/BeanInfo.java  |  2 +-
 .../camel/component/file/GenericFileConsumer.java       |  4 ++--
 .../camel/impl/ComponentConfigurationSupport.java       |  2 +-
 .../java/org/apache/camel/impl/DefaultCamelContext.java |  2 +-
 .../apache/camel/impl/DefaultInflightRepository.java    |  4 ++--
 .../org/apache/camel/impl/DefaultShutdownStrategy.java  |  2 +-
 .../apache/camel/impl/MappedEndpointConfiguration.java  |  2 +-
 .../camel/management/mbean/ManagedCamelContext.java     |  2 +-
 .../org/apache/camel/management/mbean/ManagedRoute.java |  2 +-
 .../apache/camel/processor/CamelInternalProcessor.java  |  2 +-
 .../java/org/apache/camel/processor/SortProcessor.java  |  2 +-
 .../camel/processor/interceptor/DefaultChannel.java     |  2 +-
 .../org/apache/camel/support/DefaultTimeoutMap.java     |  2 +-
 .../src/main/java/org/apache/camel/util/URISupport.java |  2 +-
 .../java/org/apache/camel/util/UnitOfWorkHelper.java    |  6 +++---
 .../apache/camel/util/component/ApiMethodParser.java    |  2 +-
 .../apache/camel/component/bean/BeanConcurrentTest.java |  2 +-
 .../component/bean/BeanExpressionConcurrentTest.java    |  2 +-
 .../component/file/FileConsumerDirectoryFilterTest.java |  2 +-
 .../org/apache/camel/util/OrderedComparatorTest.java    | 12 ++++++------
 21 files changed, 30 insertions(+), 30 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/81c22c7b/camel-core/src/main/java/org/apache/camel/builder/ExpressionBuilder.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/builder/ExpressionBuilder.java b/camel-core/src/main/java/org/apache/camel/builder/ExpressionBuilder.java
index 47f1085..549e47c 100644
--- a/camel-core/src/main/java/org/apache/camel/builder/ExpressionBuilder.java
+++ b/camel-core/src/main/java/org/apache/camel/builder/ExpressionBuilder.java
@@ -1677,7 +1677,7 @@ public final class ExpressionBuilder {
         return new ExpressionAdapter() {
             public Object evaluate(Exchange exchange) {
                 List<?> list = expression.evaluate(exchange, List.class);
-                Collections.sort(list, comparator);
+                list.sort(comparator);
                 return list;
             }
 

http://git-wip-us.apache.org/repos/asf/camel/blob/81c22c7b/camel-core/src/main/java/org/apache/camel/component/bean/BeanInfo.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/component/bean/BeanInfo.java b/camel-core/src/main/java/org/apache/camel/component/bean/BeanInfo.java
index 1fc4404..943fa07 100644
--- a/camel-core/src/main/java/org/apache/camel/component/bean/BeanInfo.java
+++ b/camel-core/src/main/java/org/apache/camel/component/bean/BeanInfo.java
@@ -1206,7 +1206,7 @@ public class BeanInfo {
         }
 
         // sort the methods by name A..Z
-        Collections.sort(methods, new Comparator<MethodInfo>() {
+        methods.sort(new Comparator<MethodInfo>() {
             public int compare(MethodInfo o1, MethodInfo o2) {
                 return o1.getMethod().getName().compareTo(o2.getMethod().getName());
             }

http://git-wip-us.apache.org/repos/asf/camel/blob/81c22c7b/camel-core/src/main/java/org/apache/camel/component/file/GenericFileConsumer.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/component/file/GenericFileConsumer.java
b/camel-core/src/main/java/org/apache/camel/component/file/GenericFileConsumer.java
index e6c5f8e..9ee398c 100644
--- a/camel-core/src/main/java/org/apache/camel/component/file/GenericFileConsumer.java
+++ b/camel-core/src/main/java/org/apache/camel/component/file/GenericFileConsumer.java
@@ -141,7 +141,7 @@ public abstract class GenericFileConsumer<T> extends ScheduledBatchPollingConsum
 
         // sort files using file comparator if provided
         if (endpoint.getSorter() != null) {
-            Collections.sort(files, endpoint.getSorter());
+            files.sort(endpoint.getSorter());
         }
 
         // sort using build in sorters so we can use expressions
@@ -155,7 +155,7 @@ public abstract class GenericFileConsumer<T> extends ScheduledBatchPollingConsum
         }
         // sort files using exchange comparator if provided
         if (endpoint.getSortBy() != null) {
-            Collections.sort(exchanges, endpoint.getSortBy());
+            exchanges.sort(endpoint.getSortBy());
         }
         if (endpoint.isShuffle()) {
             Collections.shuffle(exchanges);

http://git-wip-us.apache.org/repos/asf/camel/blob/81c22c7b/camel-core/src/main/java/org/apache/camel/impl/ComponentConfigurationSupport.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/impl/ComponentConfigurationSupport.java
b/camel-core/src/main/java/org/apache/camel/impl/ComponentConfigurationSupport.java
index 8e34e42..701b1dc 100644
--- a/camel-core/src/main/java/org/apache/camel/impl/ComponentConfigurationSupport.java
+++ b/camel-core/src/main/java/org/apache/camel/impl/ComponentConfigurationSupport.java
@@ -123,7 +123,7 @@ public abstract class ComponentConfigurationSupport implements ComponentConfigur
                 queryParams.add(key + "=" + UnsafeUriCharactersEncoder.encode(value.toString()));
             }
         }
-        Collections.sort(queryParams);
+        queryParams.sort(null);
         StringBuilder builder = new StringBuilder();
         String base = getBaseUri();
         if (base != null) {

http://git-wip-us.apache.org/repos/asf/camel/blob/81c22c7b/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java b/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java
index 7c74bc1..3a16975 100644
--- a/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java
+++ b/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java
@@ -3564,7 +3564,7 @@ public class DefaultCamelContext extends ServiceSupport implements ModelCamelCon
         }
 
         // sort the startup listeners so they are started in the right order
-        Collections.sort(startupListeners, new OrderedComparator());
+        startupListeners.sort(new OrderedComparator());
         // now the consumers that was just started may also add new StartupListeners (such
as timer)
         // so we need to ensure they get started as well
         for (StartupListener startup : startupListeners) {

http://git-wip-us.apache.org/repos/asf/camel/blob/81c22c7b/camel-core/src/main/java/org/apache/camel/impl/DefaultInflightRepository.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/impl/DefaultInflightRepository.java
b/camel-core/src/main/java/org/apache/camel/impl/DefaultInflightRepository.java
index 4d0085a..01a2826 100644
--- a/camel-core/src/main/java/org/apache/camel/impl/DefaultInflightRepository.java
+++ b/camel-core/src/main/java/org/apache/camel/impl/DefaultInflightRepository.java
@@ -123,7 +123,7 @@ public class DefaultInflightRepository extends ServiceSupport implements
Infligh
         }
 
         if (sortByLongestDuration) {
-            Collections.sort(values, new Comparator<Exchange>() {
+            values.sort(new Comparator<Exchange>() {
                 @Override
                 public int compare(Exchange e1, Exchange e2) {
                     long d1 = getExchangeDuration(e1);
@@ -133,7 +133,7 @@ public class DefaultInflightRepository extends ServiceSupport implements
Infligh
             });
         } else {
             // else sort by exchange id
-            Collections.sort(values, new Comparator<Exchange>() {
+            values.sort(new Comparator<Exchange>() {
                 @Override
                 public int compare(Exchange e1, Exchange e2) {
                     return e1.getExchangeId().compareTo(e2.getExchangeId());

http://git-wip-us.apache.org/repos/asf/camel/blob/81c22c7b/camel-core/src/main/java/org/apache/camel/impl/DefaultShutdownStrategy.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/impl/DefaultShutdownStrategy.java b/camel-core/src/main/java/org/apache/camel/impl/DefaultShutdownStrategy.java
index 1222dff..11d378d 100644
--- a/camel-core/src/main/java/org/apache/camel/impl/DefaultShutdownStrategy.java
+++ b/camel-core/src/main/java/org/apache/camel/impl/DefaultShutdownStrategy.java
@@ -180,7 +180,7 @@ public class DefaultShutdownStrategy extends ServiceSupport implements
ShutdownS
 
         // at first sort according to route startup order
         List<RouteStartupOrder> routesOrdered = new ArrayList<RouteStartupOrder>(routes);
-        Collections.sort(routesOrdered, new Comparator<RouteStartupOrder>() {
+        routesOrdered.sort(new Comparator<RouteStartupOrder>() {
             public int compare(RouteStartupOrder o1, RouteStartupOrder o2) {
                 return o1.getStartupOrder() - o2.getStartupOrder();
             }

http://git-wip-us.apache.org/repos/asf/camel/blob/81c22c7b/camel-core/src/main/java/org/apache/camel/impl/MappedEndpointConfiguration.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/impl/MappedEndpointConfiguration.java
b/camel-core/src/main/java/org/apache/camel/impl/MappedEndpointConfiguration.java
index 6f5a621..b0147d2 100644
--- a/camel-core/src/main/java/org/apache/camel/impl/MappedEndpointConfiguration.java
+++ b/camel-core/src/main/java/org/apache/camel/impl/MappedEndpointConfiguration.java
@@ -129,7 +129,7 @@ public final class MappedEndpointConfiguration extends DefaultEndpointConfigurat
             }
         }
 
-        Collections.sort(queryParams);
+        queryParams.sort(null);
         String q = "";
         for (String entry : queryParams) {
             q += q.length() == 0 ? "" : "&";

http://git-wip-us.apache.org/repos/asf/camel/blob/81c22c7b/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedCamelContext.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedCamelContext.java
b/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedCamelContext.java
index 98be807..c4e7c4a 100644
--- a/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedCamelContext.java
+++ b/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedCamelContext.java
@@ -499,7 +499,7 @@ public class ManagedCamelContext extends ManagedPerformanceCounter implements
Ti
                     processors.add(processor);
                 }
             }
-            Collections.sort(processors, new OrderProcessorMBeans());
+            processors.sort(new OrderProcessorMBeans());
 
             // loop the routes, and append the processor stats if needed
             sb.append("  <routeStats>\n");

http://git-wip-us.apache.org/repos/asf/camel/blob/81c22c7b/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedRoute.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedRoute.java
b/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedRoute.java
index b0be985..ce18da6 100644
--- a/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedRoute.java
+++ b/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedRoute.java
@@ -366,7 +366,7 @@ public class ManagedRoute extends ManagedPerformanceCounter implements
TimerList
                         mps.add(processor);
                     }
                 }
-                Collections.sort(mps, new OrderProcessorMBeans());
+                mps.sort(new OrderProcessorMBeans());
 
                 // walk the processors in reverse order, and calculate the accumulated total
time
                 Map<String, Long> accumulatedTimes = new HashMap<String, Long>();

http://git-wip-us.apache.org/repos/asf/camel/blob/81c22c7b/camel-core/src/main/java/org/apache/camel/processor/CamelInternalProcessor.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/processor/CamelInternalProcessor.java
b/camel-core/src/main/java/org/apache/camel/processor/CamelInternalProcessor.java
index a9eed97..67ee6c6 100644
--- a/camel-core/src/main/java/org/apache/camel/processor/CamelInternalProcessor.java
+++ b/camel-core/src/main/java/org/apache/camel/processor/CamelInternalProcessor.java
@@ -104,7 +104,7 @@ public class CamelInternalProcessor extends DelegateAsyncProcessor {
     public void addAdvice(CamelInternalProcessorAdvice advice) {
         advices.add(advice);
         // ensure advices are sorted so they are in the order we want
-        Collections.sort(advices, new OrderedComparator());
+        advices.sort(new OrderedComparator());
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/camel/blob/81c22c7b/camel-core/src/main/java/org/apache/camel/processor/SortProcessor.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/processor/SortProcessor.java b/camel-core/src/main/java/org/apache/camel/processor/SortProcessor.java
index 38d0d78..5618d59 100644
--- a/camel-core/src/main/java/org/apache/camel/processor/SortProcessor.java
+++ b/camel-core/src/main/java/org/apache/camel/processor/SortProcessor.java
@@ -54,7 +54,7 @@ public class SortProcessor<T> extends ServiceSupport implements AsyncProcessor,
 
             @SuppressWarnings("unchecked")
             List<T> list = expression.evaluate(exchange, List.class);
-            Collections.sort(list, comparator);
+            list.sort(comparator);
 
             if (exchange.getPattern().isOutCapable()) {
                 Message out = exchange.getOut();

http://git-wip-us.apache.org/repos/asf/camel/blob/81c22c7b/camel-core/src/main/java/org/apache/camel/processor/interceptor/DefaultChannel.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/processor/interceptor/DefaultChannel.java
b/camel-core/src/main/java/org/apache/camel/processor/interceptor/DefaultChannel.java
index 4063296..e4d317d 100644
--- a/camel-core/src/main/java/org/apache/camel/processor/interceptor/DefaultChannel.java
+++ b/camel-core/src/main/java/org/apache/camel/processor/interceptor/DefaultChannel.java
@@ -260,7 +260,7 @@ public class DefaultChannel extends CamelInternalProcessor implements
ModelChann
         }
 
         // sort interceptors according to ordered
-        Collections.sort(interceptors, new OrderedComparator());
+        interceptors.sort(new OrderedComparator());
         // then reverse list so the first will be wrapped last, as it would then be first
being invoked
         Collections.reverse(interceptors);
         // wrap the output with the configured interceptors

http://git-wip-us.apache.org/repos/asf/camel/blob/81c22c7b/camel-core/src/main/java/org/apache/camel/support/DefaultTimeoutMap.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/support/DefaultTimeoutMap.java b/camel-core/src/main/java/org/apache/camel/support/DefaultTimeoutMap.java
index 29afe34..1e09952 100644
--- a/camel-core/src/main/java/org/apache/camel/support/DefaultTimeoutMap.java
+++ b/camel-core/src/main/java/org/apache/camel/support/DefaultTimeoutMap.java
@@ -211,7 +211,7 @@ public class DefaultTimeoutMap<K, V> extends ServiceSupport implements
TimeoutMa
             // if we found any expired then we need to sort, onEviction and remove
             if (!expired.isEmpty()) {
                 // sort according to the expired time so we got the first expired first
-                Collections.sort(expired, new Comparator<TimeoutMapEntry<K, V>>()
{
+                expired.sort(new Comparator<TimeoutMapEntry<K, V>>() {
                     public int compare(TimeoutMapEntry<K, V> a, TimeoutMapEntry<K,
V> b) {
                         long diff = a.getExpireTime() - b.getExpireTime();
                         if (diff == 0) {

http://git-wip-us.apache.org/repos/asf/camel/blob/81c22c7b/camel-core/src/main/java/org/apache/camel/util/URISupport.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/util/URISupport.java b/camel-core/src/main/java/org/apache/camel/util/URISupport.java
index 192b03b..1c30ff4 100644
--- a/camel-core/src/main/java/org/apache/camel/util/URISupport.java
+++ b/camel-core/src/main/java/org/apache/camel/util/URISupport.java
@@ -583,7 +583,7 @@ public final class URISupport {
         } else {
             // reorder parameters a..z
             List<String> keys = new ArrayList<String>(parameters.keySet());
-            Collections.sort(keys);
+            keys.sort(null);
 
             Map<String, Object> sorted = new LinkedHashMap<String, Object>(parameters.size());
             for (String key : keys) {

http://git-wip-us.apache.org/repos/asf/camel/blob/81c22c7b/camel-core/src/main/java/org/apache/camel/util/UnitOfWorkHelper.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/util/UnitOfWorkHelper.java b/camel-core/src/main/java/org/apache/camel/util/UnitOfWorkHelper.java
index 3893ff0..350d02e 100644
--- a/camel-core/src/main/java/org/apache/camel/util/UnitOfWorkHelper.java
+++ b/camel-core/src/main/java/org/apache/camel/util/UnitOfWorkHelper.java
@@ -91,7 +91,7 @@ public final class UnitOfWorkHelper {
             // reverse so we invoke it FILO style instead of FIFO
             Collections.reverse(copy);
             // and honor if any was ordered by sorting it accordingly
-            Collections.sort(copy, new OrderedComparator());
+            copy.sort(new OrderedComparator());
 
             // invoke synchronization callbacks
             for (Synchronization synchronization : copy) {
@@ -119,7 +119,7 @@ public final class UnitOfWorkHelper {
             // reverse so we invoke it FILO style instead of FIFO
             Collections.reverse(copy);
             // and honor if any was ordered by sorting it accordingly
-            Collections.sort(copy, new OrderedComparator());
+            copy.sort(new OrderedComparator());
 
             // invoke synchronization callbacks
             for (Synchronization synchronization : copy) {
@@ -144,7 +144,7 @@ public final class UnitOfWorkHelper {
             // reverse so we invoke it FILO style instead of FIFO
             Collections.reverse(copy);
             // and honor if any was ordered by sorting it accordingly
-            Collections.sort(copy, new OrderedComparator());
+            copy.sort(new OrderedComparator());
 
             // invoke synchronization callbacks
             for (Synchronization synchronization : copy) {

http://git-wip-us.apache.org/repos/asf/camel/blob/81c22c7b/camel-core/src/main/java/org/apache/camel/util/component/ApiMethodParser.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/util/component/ApiMethodParser.java
b/camel-core/src/main/java/org/apache/camel/util/component/ApiMethodParser.java
index 488dd9e..8829ba5 100644
--- a/camel-core/src/main/java/org/apache/camel/util/component/ApiMethodParser.java
+++ b/camel-core/src/main/java/org/apache/camel/util/component/ApiMethodParser.java
@@ -170,7 +170,7 @@ public abstract class ApiMethodParser<T> {
         }
         allArguments.clear();
 
-        Collections.sort(result, new Comparator<ApiMethodModel>() {
+        result.sort(new Comparator<ApiMethodModel>() {
             @Override
             public int compare(ApiMethodModel model1, ApiMethodModel model2) {
                 final int nameCompare = model1.name.compareTo(model2.name);

http://git-wip-us.apache.org/repos/asf/camel/blob/81c22c7b/camel-core/src/test/java/org/apache/camel/component/bean/BeanConcurrentTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/component/bean/BeanConcurrentTest.java
b/camel-core/src/test/java/org/apache/camel/component/bean/BeanConcurrentTest.java
index abd45a0..4601a21 100644
--- a/camel-core/src/test/java/org/apache/camel/component/bean/BeanConcurrentTest.java
+++ b/camel-core/src/test/java/org/apache/camel/component/bean/BeanConcurrentTest.java
@@ -50,7 +50,7 @@ public class BeanConcurrentTest extends ContextTestSupport {
             String body = mock.getReceivedExchanges().get(i).getIn().getBody(String.class);
             list.add(body);
         }
-        Collections.sort(list);
+        list.sort(null);
 
         // and they should be unique and no lost messages
         assertEquals(1000, list.size());

http://git-wip-us.apache.org/repos/asf/camel/blob/81c22c7b/camel-core/src/test/java/org/apache/camel/component/bean/BeanExpressionConcurrentTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/component/bean/BeanExpressionConcurrentTest.java
b/camel-core/src/test/java/org/apache/camel/component/bean/BeanExpressionConcurrentTest.java
index 6b7674f..aba58bb 100644
--- a/camel-core/src/test/java/org/apache/camel/component/bean/BeanExpressionConcurrentTest.java
+++ b/camel-core/src/test/java/org/apache/camel/component/bean/BeanExpressionConcurrentTest.java
@@ -50,7 +50,7 @@ public class BeanExpressionConcurrentTest extends ContextTestSupport {
             String body = mock.getReceivedExchanges().get(i).getIn().getBody(String.class);
             list.add(body);
         }
-        Collections.sort(list);
+        list.sort(null);
 
         // and they should be unique and no lost messages
         assertEquals(1000, list.size());

http://git-wip-us.apache.org/repos/asf/camel/blob/81c22c7b/camel-core/src/test/java/org/apache/camel/component/file/FileConsumerDirectoryFilterTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/component/file/FileConsumerDirectoryFilterTest.java
b/camel-core/src/test/java/org/apache/camel/component/file/FileConsumerDirectoryFilterTest.java
index 284a51a..26ac284 100644
--- a/camel-core/src/test/java/org/apache/camel/component/file/FileConsumerDirectoryFilterTest.java
+++ b/camel-core/src/test/java/org/apache/camel/component/file/FileConsumerDirectoryFilterTest.java
@@ -69,7 +69,7 @@ public class FileConsumerDirectoryFilterTest extends ContextTestSupport
{
         assertEquals(4, names.size());
         // copy to list so its easier to index
         List<String> list = new ArrayList<String>(names);
-        Collections.sort(list);
+        list.sort(null);
 
         assertEquals("okDir", list.get(0));
         // windows or unix paths

http://git-wip-us.apache.org/repos/asf/camel/blob/81c22c7b/camel-core/src/test/java/org/apache/camel/util/OrderedComparatorTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/util/OrderedComparatorTest.java b/camel-core/src/test/java/org/apache/camel/util/OrderedComparatorTest.java
index 6664224..d663aaf 100644
--- a/camel-core/src/test/java/org/apache/camel/util/OrderedComparatorTest.java
+++ b/camel-core/src/test/java/org/apache/camel/util/OrderedComparatorTest.java
@@ -37,7 +37,7 @@ public class OrderedComparatorTest extends TestCase {
         answer.add(new MyOrder(5));
         answer.add(new MyOrder(4));
 
-        Collections.sort(answer, new OrderedComparator());
+        answer.sort(new OrderedComparator());
 
         assertEquals(0, answer.get(0).getOrder());
         assertEquals(1, answer.get(1).getOrder());
@@ -54,7 +54,7 @@ public class OrderedComparatorTest extends TestCase {
         answer.add(new MyOrder(5));
         answer.add(new MyOrder(4));
 
-        Collections.sort(answer, new OrderedComparator(true));
+        answer.sort(new OrderedComparator(true));
 
         assertEquals(5, answer.get(0).getOrder());
         assertEquals(4, answer.get(1).getOrder());
@@ -72,7 +72,7 @@ public class OrderedComparatorTest extends TestCase {
         answer.add(new MyOrder(Ordered.HIGHEST));
         answer.add(new MyOrder(4));
 
-        Collections.sort(answer, new OrderedComparator());
+        answer.sort(new OrderedComparator());
 
         assertEquals(Ordered.HIGHEST, answer.get(0).getOrder());
         assertEquals(0, answer.get(1).getOrder());
@@ -91,7 +91,7 @@ public class OrderedComparatorTest extends TestCase {
         answer.add(new MyOrder(Ordered.HIGHEST));
         answer.add(new MyOrder(4));
 
-        Collections.sort(answer, new OrderedComparator(true));
+        answer.sort(new OrderedComparator(true));
 
         assertEquals(200, answer.get(0).getOrder());
         assertEquals(50, answer.get(1).getOrder());
@@ -110,7 +110,7 @@ public class OrderedComparatorTest extends TestCase {
         answer.add(new MyOrder(Ordered.LOWEST));
         answer.add(new MyOrder(-4));
 
-        Collections.sort(answer, new OrderedComparator());
+        answer.sort(new OrderedComparator());
 
         assertEquals(-4, answer.get(0).getOrder());
         assertEquals(-2, answer.get(1).getOrder());
@@ -129,7 +129,7 @@ public class OrderedComparatorTest extends TestCase {
         answer.add(new MyOrder(Ordered.LOWEST));
         answer.add(new MyOrder(-4));
 
-        Collections.sort(answer, new OrderedComparator(true));
+        answer.sort(new OrderedComparator(true));
 
         assertEquals(Ordered.LOWEST, answer.get(0).getOrder());
         assertEquals(200, answer.get(1).getOrder());


Mime
View raw message