You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by di...@apache.org on 2005/05/01 17:02:50 UTC

cvs commit: ws-axis/java/src/org/apache/axis/wsdl/toJava JavaStubWriter.java

dims        2005/05/01 08:02:50

  Modified:    java/src/org/apache/axis/wsdl/toJava JavaStubWriter.java
  Log:
  Sort the TypeEntries...test/wsdl/echo fails on some machines for test2ComplexEchoServiceEcho21 and not on others because of the ordering. make the behavior consistent.
  
  Revision  Changes    Path
  1.148     +12 -0     ws-axis/java/src/org/apache/axis/wsdl/toJava/JavaStubWriter.java
  
  Index: JavaStubWriter.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/java/src/org/apache/axis/wsdl/toJava/JavaStubWriter.java,v
  retrieving revision 1.147
  retrieving revision 1.148
  diff -u -r1.147 -r1.148
  --- JavaStubWriter.java	25 Apr 2005 20:54:26 -0000	1.147
  +++ JavaStubWriter.java	1 May 2005 15:02:50 -0000	1.148
  @@ -55,6 +55,9 @@
   import java.util.List;
   import java.util.Map;
   import java.util.Vector;
  +import java.util.Arrays;
  +import java.util.Comparator;
  +import java.util.Collections;
   
   /**
    * This is Wsdl2java's stub writer.  It writes the <BindingName>Stub.java
  @@ -224,6 +227,15 @@
               }
           }
   
  +        // Sort the TypeEntry's by their qname.
  +        Collections.sort(deferredBindings, new Comparator() {
  +            public int compare(Object a, Object b) {
  +                TypeEntry type1 = (TypeEntry)a;
  +                TypeEntry type2 = (TypeEntry)b;
  +                return type1.getQName().toString().compareToIgnoreCase(type2.getQName().toString());
  +            }
  +        });
  +
           // We need to write out the MIME mapping, even if we don't have
           // any type mappings
           if ((typeMappingCount == 0) && hasMIME) {