scheu       02/04/09 11:50:13

  Modified:    java/src/org/apache/axis/wsdl/toJava JavaBeanWriter.java
  Log:
  The following changes were made to change the echo sample
  to be generated from a wsdl file.
  
  1) Added a samples/echo/InteropTest.wsdl that
     contains the White Mesa Round 2 and Round 2 B
     operations, our service stanza, and the echoMap/echoMapArray
     operations.
  
  2) Changed build.xml to define the wsdl2java task and
     run wsdl2java on the samples/echo/InteropTest.wsdl.
  
  3) Changed samples/echo/TestClient to remove deprecated
     "soap action" options.  Also changes were made
     to comply with the generated java beans.
  
  4) Small change to the deploy.wsdd.  This checked in file
     will continue to be used for service deployment.
  
  5) Removed the checked in samples/echo/Echo*.java files
     and the samples/echo/SOAP*.java files.  These are
     now generated.
  
  6) Improved the equals() generation in the JavaBeanWriter
     to properly handle input Objects that are of the wrong
     class and handle array properties.
  
  7) Fixed the test/encoding and test/functional tests to
     use the appropriate samples.echo.SOAP* constructors.
  
  FYI NOTE: There are a number of failures in Sam's nightly interop
  test.  I tracked these down to Tom's changes on 4/5
  
  More commits to follow.
  
  Revision  Changes    Path
  1.6       +11 -0     
xml-axis/java/src/org/apache/axis/wsdl/toJava/JavaBeanWriter.java
  
  Index: JavaBeanWriter.java
  ===================================================================
  RCS file: 
/home/cvs/xml-axis/java/src/org/apache/axis/wsdl/toJava/JavaBeanWriter.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- JavaBeanWriter.java       22 Mar 2002 17:21:25 -0000      1.5
  +++ JavaBeanWriter.java       9 Apr 2002 18:50:13 -0000       1.6
  @@ -257,6 +257,7 @@
       protected void writeEqualsMethod() {
           pw.println("    public boolean equals(Object obj) {");
           pw.println("        // compare elements");
  +        pw.println("        if (!(obj instanceof " + className + ")) return 
false;");
           pw.println("        " +  className + " other = (" + className + ") obj;");
           pw.println("        if (obj == null) return false;");
           pw.println("        if (this == obj) return true;");
  @@ -282,6 +283,16 @@
                           variableType.equals("byte")) {
                       pw.print("            " + variable + " == other." + get +
                               Utils.capitalizeFirstChar(variable) + "()");
  +                } else if (variableType.indexOf("[") >=0) {
  +                    // Use java.util.Arrays.equals to compare arrays.
  +                    pw.println("            ((" + variable +
  +                               "==null && other." + get +
  +                               Utils.capitalizeFirstChar(variable) + "()==null) || 
");
  +                    pw.println("             (" + variable + "!=null &&");
  +                    pw.print("              java.util.Arrays.equals(" + variable +
  +                             ", other." + get +
  +                             Utils.capitalizeFirstChar(variable) + "())))");
  +
                   } else {
                       pw.println("            ((" + variable +
                                  "==null && other." + get +
  
  
  


Reply via email to