Author: bodewig
Date: Mon Aug 17 04:04:22 2009
New Revision: 804845

URL: http://svn.apache.org/viewvc?rev=804845&view=rev
Log:
alphasort entries before adding them - will allow directory entries to be added 
based on real resources rather than artifically later

Modified:
    
ant/sandbox/antlibs/compress/trunk/src/main/org/apache/ant/compress/taskdefs/ArchiveBase.java

Modified: 
ant/sandbox/antlibs/compress/trunk/src/main/org/apache/ant/compress/taskdefs/ArchiveBase.java
URL: 
http://svn.apache.org/viewvc/ant/sandbox/antlibs/compress/trunk/src/main/org/apache/ant/compress/taskdefs/ArchiveBase.java?rev=804845&r1=804844&r2=804845&view=diff
==============================================================================
--- 
ant/sandbox/antlibs/compress/trunk/src/main/org/apache/ant/compress/taskdefs/ArchiveBase.java
 (original)
+++ 
ant/sandbox/antlibs/compress/trunk/src/main/org/apache/ant/compress/taskdefs/ArchiveBase.java
 Mon Aug 17 04:04:22 2009
@@ -23,6 +23,8 @@
 import java.io.InputStream;
 import java.io.IOException;
 import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
 import java.util.Iterator;
 import java.util.List;
 import java.util.zip.ZipException;
@@ -170,6 +172,13 @@
                 }
             }
         }
+        Collections.sort(l, new Comparator/*<ResourceWithFlags>*/() {
+                public int compare(Object o1, Object o2) {
+                    ResourceWithFlags r1 = (ResourceWithFlags) o1;
+                    ResourceWithFlags r2 = (ResourceWithFlags) o2;
+                    return r1.getName().compareTo(r2.getName());
+                }
+            });
         return (ResourceWithFlags[]) l.toArray(new 
ResourceWithFlags[l.size()]);
     }
 


Reply via email to