aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorendolf <[email protected]>2011-02-20 14:11:41 +0000
committerendolf <[email protected]>2011-02-20 14:11:41 +0000
commitd60bc0649761e4a2a103a7f681446a8f07e0f2d9 (patch)
tree8f9e3bda33ac009a042f43d89d511ed4aad6ceba
parent1d05f15cc4b2625e5aa1a8f8b5b9e23cc652f363 (diff)
Make sure the files are returned in alpha order, so the order is consitent between runs.
git-svn-id: file:///home/sven/projects/JOGL/git-svn/svn-server-sync/jinput/trunk@238 e343933a-64c8-49c5-92b1-88f2ce3e89e8
-rw-r--r--plugins/linux/src/java/net/java/games/input/LinuxEnvironmentPlugin.java11
1 files changed, 10 insertions, 1 deletions
diff --git a/plugins/linux/src/java/net/java/games/input/LinuxEnvironmentPlugin.java b/plugins/linux/src/java/net/java/games/input/LinuxEnvironmentPlugin.java
index 309ccab..fc829c9 100644
--- a/plugins/linux/src/java/net/java/games/input/LinuxEnvironmentPlugin.java
+++ b/plugins/linux/src/java/net/java/games/input/LinuxEnvironmentPlugin.java
@@ -26,6 +26,9 @@
package net.java.games.input;
import net.java.games.util.plugins.Plugin;
+
+import java.util.Arrays;
+import java.util.Comparator;
import java.util.List;
import java.util.ArrayList;
import java.io.IOException;
@@ -435,7 +438,13 @@ public final class LinuxEnvironmentPlugin extends ControllerEnvironment implemen
private static File[] listFilesPrivileged(final File dir, final FilenameFilter filter) {
return (File[])AccessController.doPrivileged(new PrivilegedAction() {
public Object run() {
- return dir.listFiles(filter);
+ File[] files = dir.listFiles(filter);
+ Arrays.sort(files, new Comparator(){
+ public int compare(Object f1, Object f2) {
+ return ((File)f1).getName().compareTo(((File)f2).getName());
+ }
+ });
+ return files;
}
});
}