Author: jochen
Date: Thu Jul  3 06:58:06 2008
New Revision: 673682

URL: http://svn.apache.org/viewvc?rev=673682&view=rev
Log:
Unfortunately, JaxMe has a bug which changes the
generated code somewhat, depending on the order
of the processed schemas. It is hard to fix that
bug and impossible to do it without loosing
upwards compatibility. Therefore, we don't fix
that branch for the 0.5 branch, but at least
make the order deterministic.

Modified:
    
webservices/jaxme/trunk/ws-jaxme/maven-jaxme-plugin/src/main/java/org/apache/ws/jaxme/maven/plugins/SchemaCollectionProcessor.java

Modified: 
webservices/jaxme/trunk/ws-jaxme/maven-jaxme-plugin/src/main/java/org/apache/ws/jaxme/maven/plugins/SchemaCollectionProcessor.java
URL: 
http://svn.apache.org/viewvc/webservices/jaxme/trunk/ws-jaxme/maven-jaxme-plugin/src/main/java/org/apache/ws/jaxme/maven/plugins/SchemaCollectionProcessor.java?rev=673682&r1=673681&r2=673682&view=diff
==============================================================================
--- 
webservices/jaxme/trunk/ws-jaxme/maven-jaxme-plugin/src/main/java/org/apache/ws/jaxme/maven/plugins/SchemaCollectionProcessor.java
 (original)
+++ 
webservices/jaxme/trunk/ws-jaxme/maven-jaxme-plugin/src/main/java/org/apache/ws/jaxme/maven/plugins/SchemaCollectionProcessor.java
 Thu Jul  3 06:58:06 2008
@@ -17,11 +17,14 @@
 
 import java.io.File;
 import java.io.IOException;
+import java.text.Collator;
 import java.util.ArrayList;
 import java.util.Arrays;
+import java.util.Comparator;
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.List;
+import java.util.Locale;
 import java.util.Map;
 
 import javax.xml.parsers.ParserConfigurationException;
@@ -98,7 +101,32 @@
                                list.add(new FileSpec(dir, files[j]));
                        }
                }
-               return (FileSpec[]) list.toArray(new FileSpec[list.size()]);
+               final FileSpec[] result = (FileSpec[]) list.toArray(new 
FileSpec[list.size()]);
+               /*
+                *  Unfortunately, JaxMe has a bug which changes the
+                *  generated code somewhat, depending on the order
+                *  of the processed schemas. It is hard to fix that
+                *  bug and impossible to do it without loosing
+                *  upwards compatibility. Therefore, we don't fix
+                *  that branch for the 0.5 branch, but at least
+                *  make the order deterministic.
+                */
+               Arrays.sort(result, new Comparator(){
+                       final Collator coll = Collator.getInstance(Locale.US);
+                       private String pathOf(File pFile) {
+                               if (pFile == null) {
+                                       return "";
+                               }
+                               final String path = pFile.getPath();
+                               return path == null ? "" : path;
+                       }
+                       public int compare(Object pArg0, Object pArg1) {
+                               final FileSpec fs1 = (FileSpec) pArg0;
+                               final FileSpec fs2 = (FileSpec) pArg1;
+                               return coll.compare(pathOf(fs1.getFile()), 
pathOf(fs2.getFile()));
+                       }
+               });
+               return result;
        }
 
        private FileSpec[] getSchemaFiles(ISchemaCollection pCollection)



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to