From 72dfb0e7cc9844a35406f06781b5273303e59f2a Mon Sep 17 00:00:00 2001 From: SquidDev Date: Wed, 3 May 2017 22:27:38 +0100 Subject: [PATCH] Sort the result of FileSystem.list This ensures fs.list and fs.find always return the same result. For some reason, the ComputerCraft jar was being packaged differently on some platforms, causing files to appear in a different order. As computers depend on the colors API being loaded before colours, we need to ensure that they are loaded in a consistent order. --- .../java/dan200/computercraft/core/filesystem/FileSystem.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/dan200/computercraft/core/filesystem/FileSystem.java b/src/main/java/dan200/computercraft/core/filesystem/FileSystem.java index 31446be0d..46ca3dc74 100644 --- a/src/main/java/dan200/computercraft/core/filesystem/FileSystem.java +++ b/src/main/java/dan200/computercraft/core/filesystem/FileSystem.java @@ -10,7 +10,6 @@ import dan200.computercraft.api.filesystem.IWritableMount; import java.io.*; -import java.nio.charset.Charset; import java.util.*; import java.util.regex.Pattern; @@ -441,6 +440,7 @@ public synchronized String[] list( String path ) throws FileSystemException // Return list String[] array = new String[ list.size() ]; list.toArray(array); + Arrays.sort( array ); return array; }