axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject cvs commit: xml-axis/java/src/org/apache/axis/wsdl/toJava JavaBeanWriter.java JavaGeneratorFactory.java
Date Fri, 28 Feb 2003 15:32:34 GMT
dims        2003/02/28 07:32:34

  Modified:    java/src/org/apache/axis/wsdl/toJava JavaBeanWriter.java
                        JavaGeneratorFactory.java
  Log:
  Breaks "ant clean all-tests"....Commenting it out till James/Glen gets a chance to take
a look.
  
  Revision  Changes    Path
  1.36      +13 -13    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.35
  retrieving revision 1.36
  diff -u -r1.35 -r1.36
  --- JavaBeanWriter.java	28 Feb 2003 00:36:09 -0000	1.35
  +++ JavaBeanWriter.java	28 Feb 2003 15:32:34 -0000	1.36
  @@ -273,7 +273,7 @@
               String variable = (String) names.get(i + 1);
   
               // Declare the bean element
  -            pw.print("    private " + typeName + " " + Utils.addUnderscore(variable) +
";");
  +            pw.print("    private " + typeName + " " + variable + ";");
   
               // label the attribute fields.
               if (elements == null || i >= (elements.size()*2))
  @@ -498,14 +498,14 @@
               if (enableGetters) {
                   pw.println("    public " + typeName + " " +
                              get + capName + "() {");
  -                pw.println("        return " + Utils.addUnderscore(name) + ";");
  +                pw.println("        return " + name + ";");
                   pw.println("    }");
                   pw.println();
               }
               if (enableSetters) {
                   pw.println("    public void set" + capName + "(" +
  -                           typeName + " " + Utils.addUnderscore(name) + ") {");
  -                pw.println("        this." + Utils.addUnderscore(name) + " = " + Utils.addUnderscore(name)
+ ";");
  +                           typeName + " " + name + ") {");
  +                pw.println("        this." + name + " = " + name + ";");
                   pw.println("    }");
                   pw.println();
               }
  @@ -525,7 +525,7 @@
                       if (enableGetters) {
                           pw.println("    public " + compName + " " + get + capName +
                                      "(int i) {");
  -                        pw.println("        return " + Utils.addUnderscore(name) + "[i];");
  +                        pw.println("        return " + name + "[i];");
                           pw.println("    }");
                           pw.println();
                       }
  @@ -553,7 +553,7 @@
                           pw.println("            this." + name + " = a;");
                           pw.println("        }");
                           */
  -                        pw.println("        this." + Utils.addUnderscore(name) + "[i] =
value;");
  +                        pw.println("        this." + name + "[i] = value;");
                           pw.println("    }");
                           pw.println();
                       }
  @@ -609,24 +609,24 @@
                           variableType.equals("double") ||
                           variableType.equals("boolean") ||
                           variableType.equals("byte")) {
  -                    pw.print("            " + Utils.addUnderscore(variable) + " == other."
+ get +
  +                    pw.print("            " + variable + " == other." + get +
                               Utils.capitalizeFirstChar(variable) + "()");
                   } else if (variableType.indexOf("[") >=0) {
                       // Use java.util.Arrays.equals to compare arrays.
  -                    pw.println("            ((" + Utils.addUnderscore(variable) +
  +                    pw.println("            ((" + variable +
                                  "==null && other." + get +
                                  Utils.capitalizeFirstChar(variable) + "()==null) || ");
  -                    pw.println("             (" + Utils.addUnderscore(variable) + "!=null
&&");
  -                    pw.print("              java.util.Arrays.equals(" + Utils.addUnderscore(variable)
+
  +                    pw.println("             (" + variable + "!=null &&");
  +                    pw.print("              java.util.Arrays.equals(" + variable +
                                ", other." + get +
                                Utils.capitalizeFirstChar(variable) + "())))");
   
                   } else {
  -                    pw.println("            ((" + Utils.addUnderscore(variable) +
  +                    pw.println("            ((" + variable +
                                  "==null && other." + get +
                                  Utils.capitalizeFirstChar(variable) + "()==null) || ");
  -                    pw.println("             (" + Utils.addUnderscore(variable) + "!=null
&&");
  -                    pw.print("              " + Utils.addUnderscore(variable) +
  +                    pw.println("             (" + variable + "!=null &&");
  +                    pw.print("              " + variable +
                                ".equals(other." + get +
                                Utils.capitalizeFirstChar(variable) + "())))");
                   }
  
  
  
  1.36      +12 -19    xml-axis/java/src/org/apache/axis/wsdl/toJava/JavaGeneratorFactory.java
  
  Index: JavaGeneratorFactory.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/wsdl/toJava/JavaGeneratorFactory.java,v
  retrieving revision 1.35
  retrieving revision 1.36
  diff -u -r1.35 -r1.36
  --- JavaGeneratorFactory.java	28 Feb 2003 14:16:01 -0000	1.35
  +++ JavaGeneratorFactory.java	28 Feb 2003 15:32:34 -0000	1.36
  @@ -372,25 +372,18 @@
                               // the qName
                               tEntry.setName(emitter.getJavaName(typeQName));
                           } else {
  -                           String localName = typeQName.getLocalPart();
  -                              
  -                           // Check to see if this is an anonymous type,
  -                           // if it is, replace Axis' ANON_TOKEN with
  -                           // an underscore to make sure we don't run
  -                           // into name collisions with similarly named
  -                           // non-anonymous types                          
  -                           StringBuffer sb = new StringBuffer(localName);
  -                           int aidx = -1;
  -                           while (
  -                             (aidx = sb.toString().indexOf(
  -                               SymbolTable.ANON_TOKEN)) > -1) {
  -                                 sb.replace(aidx, aidx+SymbolTable.ANON_TOKEN.length(),
"_");
  -                           }
  -                           localName = sb.toString();
  -                                                 
  -                           typeQName = new QName(typeQName.getNamespaceURI(), 
  -                                                 localName);
  -                                                  
  +                            // This is an anonymous type name.
  +                            // Axis uses '>' as a nesting token to generate
  +                            // unique qnames for anonymous types.
  +                            // Only consider the localName after the last '>' 
  +                            // when generating the java name
  +                            String localName = typeQName.getLocalPart();
  +                            localName = 
  +                                localName.substring(
  +                                    localName.lastIndexOf(
  +                                        SymbolTable.ANON_TOKEN)+1);
  +                            typeQName = new QName(typeQName.getNamespaceURI(), 
  +                                                  localName);
                               // If there is already an existing type,
                               // there will be a collision.  
                               // If there is an existing anon type, 
  
  
  

Mime
View raw message