Sort results permanently.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Tue, 9 Apr 2013 20:53:45 +0000 (22:53 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Tue, 9 Apr 2013 20:56:58 +0000 (22:56 +0200)
src/main/java/net/pterodactylus/xdcc/ui/stdin/CommandReader.java

index 9c8c86c..59cdea8 100644 (file)
@@ -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.");