From: "Enrico Weigelt, metux IT consult" <[email protected]>
---
src/net/sf/freecol/common/util/CollectionUtils.java | 18 ++++++++++++------
1 file changed, 12 insertions(+), 6 deletions(-)
diff --git a/src/net/sf/freecol/common/util/CollectionUtils.java
b/src/net/sf/freecol/common/util/CollectionUtils.java
index f6a1e05bb11..c04755bde02 100644
--- a/src/net/sf/freecol/common/util/CollectionUtils.java
+++ b/src/net/sf/freecol/common/util/CollectionUtils.java
@@ -1986,8 +1986,9 @@ public class CollectionUtils {
* @return A list of the stream contents.
*/
public static <T extends Comparable<? super T>> List<T> sort(T[] array) {
- final Comparator<T> comparator = Comparator.naturalOrder();
- return sort_internal(Arrays.stream(array), comparator);
+ List<T> result = Arrays.<T>asList(array);
+ Collections.sort(result);
+ return result;
}
/**
@@ -1999,7 +2000,9 @@ public class CollectionUtils {
* @return A list of the stream contents.
*/
public static <T> List<T> sort(T[] array, Comparator<? super T>
comparator) {
- return sort_internal(Arrays.stream(array), comparator);
+ List<T> result = Arrays.<T>asList(array);
+ Collections.sort(result, comparator);
+ return result;
}
/**
@@ -2010,8 +2013,9 @@ public class CollectionUtils {
* @return A list of the stream contents.
*/
public static <T extends Comparable<? super T>> List<T> sort(Collection<T>
c) {
- final Comparator<T> comparator = Comparator.naturalOrder();
- return sort_internal(c.stream(), comparator);
+ ArrayList<T> result = new ArrayList<T>(c);
+ Collections.sort(result);
+ return result;
}
/**
@@ -2024,7 +2028,9 @@ public class CollectionUtils {
*/
public static <T> List<T> sort(Collection<T> c,
Comparator<? super T> comparator) {
- return sort_internal(c.stream(), comparator);
+ List<T> result = new ArrayList<T>(c);
+ Collections.sort(result, comparator);
+ return result;
}
/**
--
2.11.0.rc0.7.gbe5a750
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Freecol-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freecol-developers