You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by gd...@apache.org on 2003/01/01 23:21:43 UTC

cvs commit: xml-axis/java/src/org/apache/axis/wsdl/toJava JavaDeployWriter.java

gdaniels    2003/01/01 14:21:43

  Modified:    java/src/org/apache/axis/wsdl/toJava JavaDeployWriter.java
  Log:
  Don't repeat overloaded method names in allowedMethods
  
  Revision  Changes    Path
  1.72      +15 -4     xml-axis/java/src/org/apache/axis/wsdl/toJava/JavaDeployWriter.java
  
  Index: JavaDeployWriter.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/wsdl/toJava/JavaDeployWriter.java,v
  retrieving revision 1.71
  retrieving revision 1.72
  diff -u -r1.71 -r1.72
  --- JavaDeployWriter.java	19 Dec 2002 15:12:24 -0000	1.71
  +++ JavaDeployWriter.java	1 Jan 2003 22:21:43 -0000	1.72
  @@ -87,6 +87,7 @@
   import java.util.Iterator;
   import java.util.Map;
   import java.util.Vector;
  +import java.util.HashSet;
   
   /**
   * This is Wsdl2java's deploy Writer.  It writes the deploy.wsdd file.
  @@ -346,7 +347,7 @@
                            + binding.getPortType().getQName().getLocalPart() + "\"/>");
   
   
  -        String methodList = "";
  +        HashSet allowedMethods = new HashSet();
           if (!emitter.isSkeletonWanted()) {
               Iterator operationsIterator = binding.getBindingOperations().iterator();
               for (; operationsIterator.hasNext();) {
  @@ -362,7 +363,7 @@
                       continue;
                   }
   
  -                methodList = methodList + " " + javaOperName;
  +                allowedMethods.add(javaOperName);
   
                   // We pass "" as the namespace argument because we're just
                   // interested in the return type for now.
  @@ -397,11 +398,21 @@
           }
   
           pw.print("      <parameter name=\"allowedMethods\" value=\"");
  -        if (methodList.length() == 0) {
  +        if (allowedMethods.isEmpty()) {
               pw.println("*\"/>");
           }
           else {
  -            pw.println(methodList.substring(1) + "\"/>");
  +            boolean first = true;
  +            for (Iterator i = allowedMethods.iterator(); i.hasNext();) {
  +                String method = (String) i.next();
  +                if (first) {
  +                    pw.print(method);
  +                    first = false;
  +                } else {
  +                    pw.print(" " + method);
  +                }
  +            }
  +            pw.println("\"/>");
           }
   
           Scope scope = emitter.getScope();