From 1bcf6002a380a9e84970231dbf3f1f1d10db446a Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Tue, 9 Apr 2013 22:53:45 +0200 Subject: [PATCH] Sort results permanently. --- src/main/java/net/pterodactylus/xdcc/ui/stdin/CommandReader.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/net/pterodactylus/xdcc/ui/stdin/CommandReader.java b/src/main/java/net/pterodactylus/xdcc/ui/stdin/CommandReader.java index 9c8c86c..59cdea8 100644 --- a/src/main/java/net/pterodactylus/xdcc/ui/stdin/CommandReader.java +++ b/src/main/java/net/pterodactylus/xdcc/ui/stdin/CommandReader.java @@ -19,6 +19,7 @@ package net.pterodactylus.xdcc.ui.stdin; import java.io.BufferedReader; import java.io.Reader; +import java.util.Collections; import java.util.List; import net.pterodactylus.xdcc.core.Core; @@ -26,7 +27,6 @@ import net.pterodactylus.xdcc.data.Bot; import net.pterodactylus.xdcc.data.Pack; import com.google.common.collect.Lists; -import com.google.common.collect.Ordering; import com.google.common.util.concurrent.AbstractExecutionThreadService; /** @@ -89,8 +89,9 @@ public class CommandReader extends AbstractExecutionThreadService { } } } + Collections.sort(lastResult); int counter = 0; - for (Result result : Ordering.natural().sortedCopy(lastResult)) { + for (Result result : lastResult) { System.out.println(String.format("[%d] %s (%s) from %s (#%s) on %s", counter++, result.pack().name(), result.pack().size(), result.bot().name(), result.pack().id(), result.bot().network().name())); } System.out.println("End of Search."); -- 2.7.4