felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject svn commit: r1720111 - /felix/trunk/fileinstall/src/main/java/org/apache/felix/fileinstall/internal/Scanner.java
Date Tue, 15 Dec 2015 10:26:43 GMT
Author: gnodet
Date: Tue Dec 15 10:26:42 2015
New Revision: 1720111

URL: http://svn.apache.org/viewvc?rev=1720111&view=rev
Log:
[FELIX-4714] Sort files alphabetically

Modified:
    felix/trunk/fileinstall/src/main/java/org/apache/felix/fileinstall/internal/Scanner.java

Modified: felix/trunk/fileinstall/src/main/java/org/apache/felix/fileinstall/internal/Scanner.java
URL: http://svn.apache.org/viewvc/felix/trunk/fileinstall/src/main/java/org/apache/felix/fileinstall/internal/Scanner.java?rev=1720111&r1=1720110&r2=1720111&view=diff
==============================================================================
--- felix/trunk/fileinstall/src/main/java/org/apache/felix/fileinstall/internal/Scanner.java
(original)
+++ felix/trunk/fileinstall/src/main/java/org/apache/felix/fileinstall/internal/Scanner.java
Tue Dec 15 10:26:42 2015
@@ -22,10 +22,13 @@ import java.io.Closeable;
 import java.io.File;
 import java.io.FilenameFilter;
 import java.io.IOException;
+import java.util.Arrays;
 import java.util.HashMap;
 import java.util.HashSet;
+import java.util.LinkedHashSet;
 import java.util.Map;
 import java.util.Set;
+import java.util.TreeSet;
 import java.util.regex.Pattern;
 import java.util.zip.CRC32;
 
@@ -124,15 +127,16 @@ public class Scanner implements Closeabl
     public Set<File> scan(boolean reportImmediately)
     {
         File[] list = directory.listFiles(filter);
-        if (list == null)
-        {
-            return null;
-        }
-        return processFiles(reportImmediately, list);
+        Set<File> files = processFiles(reportImmediately, list);
+        return new TreeSet<>(files);
     }
 
     private Set<File> processFiles(boolean reportImmediately, File[] list)
     {
+        if (list == null)
+        {
+            return new HashSet<>();
+        }
         Set<File> files = new HashSet<File>();
         Set<File> removed = new HashSet<File>(storedChecksums.keySet());
         for (File file : list)



Mime
View raw message