axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ami...@apache.org
Subject svn commit: r477593 - /webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/databinding/TypeMappingAdapter.java
Date Tue, 21 Nov 2006 09:32:13 GMT
Author: amilas
Date: Tue Nov 21 01:32:13 2006
New Revision: 477593

URL: http://svn.apache.org/viewvc?view=rev&rev=477593
Log:
parameter prefix is added only if that name already appeared.

Modified:
    webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/databinding/TypeMappingAdapter.java

Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/databinding/TypeMappingAdapter.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/databinding/TypeMappingAdapter.java?view=diff&rev=477593&r1=477592&r2=477593
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/databinding/TypeMappingAdapter.java
(original)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/databinding/TypeMappingAdapter.java
Tue Nov 21 01:32:13 2006
@@ -23,6 +23,8 @@
 import javax.xml.namespace.QName;
 import java.util.HashMap;
 import java.util.Map;
+import java.util.List;
+import java.util.ArrayList;
 
 public abstract class TypeMappingAdapter implements TypeMapper {
 
@@ -46,6 +48,10 @@
 
     //counter variable to generate unique parameter ID's
     protected int counter = 0;
+
+    // this is to keep generated parameter names
+    protected List parameterNameList = new ArrayList();
+
     protected boolean isObject = false;
 
     //Upper limit for the paramete count
@@ -95,7 +101,11 @@
             if (paramName.length() > 1){
                 paramName = paramName.substring(0,1).toLowerCase() + paramName.substring(1);
             }
-            return paramName + counter++;
+            if (parameterNameList.contains(paramName)){
+                paramName = paramName + counter++;
+            }
+            parameterNameList.add(paramName);
+            return paramName;
         } else {
             return PARAMETER_NAME_SUFFIX + counter++;
         }
@@ -157,7 +167,7 @@
     }
 
     /**
-     * @see TypeMapper#setDefaultMappingName(String) 
+     * @see TypeMapper#setDefaultMappingName(String)
      * @param defaultMapping
      */
     public void setDefaultMappingName(String defaultMapping) {
@@ -174,7 +184,7 @@
     }
 
     /**
-     * @see TypeMapper#getTypeMappingStatus(javax.xml.namespace.QName) 
+     * @see TypeMapper#getTypeMappingStatus(javax.xml.namespace.QName)
      * @param qName
      */
     public Object getTypeMappingStatus(QName qName) {



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org


Mime
View raw message