axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From whitl...@apache.org
Subject cvs commit: ws-axis/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal BeanParamWriter.java
Date Mon, 31 Jan 2005 14:18:09 GMT
whitlock    2005/01/31 06:18:08

  Modified:    c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal
                        BeanParamWriter.java
  Log:
  If mulitple parameters on an operation are arrays, the generated stubs contained multiple
declarations of local variables with the same name. I fixed this by appending the parameter
index to each local variable name so ensuring that all local variables are unique.
  
  Revision  Changes    Path
  1.43      +17 -17    ws-axis/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/BeanParamWriter.java
  
  Index: BeanParamWriter.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/BeanParamWriter.java,v
  retrieving revision 1.42
  retrieving revision 1.43
  diff -u -r1.42 -r1.43
  --- BeanParamWriter.java	9 Dec 2004 12:08:57 -0000	1.42
  +++ BeanParamWriter.java	31 Jan 2005 14:18:08 -0000	1.43
  @@ -182,27 +182,27 @@
   					
   					if( nillable)
   					{
  -						writer.write("\tAxis_Array\tsAA;\n\n");
  -						writer.write("\tsAA.m_Size = 1;\n\n");
  +						writer.write("\tAxis_Array\tsAA"+i+";\n\n");
  +						writer.write("\tsAA"+i+".m_Size = 1;\n\n");
   						
   						if( moreThanOne)
   						{
  -							writer.write("\tfor( int iCount = 0; iCount < param->count; iCount++)\n");
  +							writer.write("\tfor( int iCount"+i+" = 0; iCount"+i+" < param->count; iCount"+i+"++)\n");
   						}
   						else
   						{
  -							writer.write("\tfor( int iCount = 0; iCount < param->" + attribs[i].getElementNameAsString()
+ ".m_Size; iCount++)\n");
  +							writer.write("\tfor( int iCount"+i+" = 0; iCount"+i+" < param->" + attribs[i].getElementNameAsString()
+ ".m_Size; iCount"+i+"++)\n");
   						}
   
   						writer.write("\t{\n");
   						
   						if( moreThanOne)
   						{
  -							writer.write("\t\tif( param->infos.m_Array[iCount] == NULL)\n");
  +							writer.write("\t\tif( param->infos.m_Array[iCount"+i+"] == NULL)\n");
   						}
   						else
   						{
  -							writer.write("\t\tif( param->" + attribs[i].getElementNameAsString() + ".m_Array[iCount]
== NULL)\n");
  +							writer.write("\t\tif( param->" + attribs[i].getElementNameAsString() + ".m_Array[iCount"+i+"]
== NULL)\n");
   						}
   						
   						writer.write("\t\t{\n");
  @@ -214,14 +214,14 @@
   
   						if( moreThanOne)
   						{
  -							writer.write("\t\t\tsAA.m_Array = (void **)param->infos.m_Array[iCount];\n");
  +							writer.write("\t\t\tsAA"+i+".m_Array = (void **)param->infos.m_Array[iCount"+i+"];\n");
   						}
   						else
   						{
  -							writer.write("\t\t\tsAA.m_Array = param->" + attribs[i].getElementNameAsString()
+ ".m_Array[iCount];\n\n");
  +							writer.write("\t\t\tsAA"+i+".m_Array = param->" + attribs[i].getElementNameAsString()
+ ".m_Array[iCount"+i+"];\n\n");
   						}
   
  -						writer.write("\t\t\tpSZ->serializeCmplxArray( &sAA,\n");
  +						writer.write("\t\t\tpSZ->serializeCmplxArray( &sAA"+i+",\n");
   						writer.write("\t\t\t\t\t\t\t\t\t (void*) Axis_Serialize_"+arrayType+",\n");
   						writer.write("\t\t\t\t\t\t\t\t\t (void*) Axis_Delete_"+arrayType+",\n");
   						writer.write("\t\t\t\t\t\t\t\t\t (void*) Axis_GetSize_"+arrayType+",\n");
  @@ -318,19 +318,19 @@
   
   					if( nillable)
   					{
  -						writer.write("\t"+attribs[i].getTypeName()+" **	pp = param->"+attribs[i].getElementNameAsString()+".m_Array;\n\n");
  +						writer.write("\t"+attribs[i].getTypeName()+" **	pp"+i+" = param->"+attribs[i].getElementNameAsString()+".m_Array;\n\n");
   						writer.write("\tparam->"+attribs[i].getElementNameAsString()+".m_Size = array.m_Size;\n\n");
   						writer.write("\tif( param->"+attribs[i].getElementNameAsString()+".m_Array ==
NULL)\n");
   						writer.write("\t{\n");
  -						writer.write("\t\tpp = ("+attribs[i].getTypeName()+" **) new "+attribs[i].getTypeName()+"*[array.m_Size];\n");
  -						writer.write("\t\tparam->"+attribs[i].getElementNameAsString()+".m_Array = pp;\n");
  +						writer.write("\t\tpp"+i+" = ("+attribs[i].getTypeName()+" **) new "+attribs[i].getTypeName()+"*[array.m_Size];\n");
  +						writer.write("\t\tparam->"+attribs[i].getElementNameAsString()+".m_Array = pp"+i+";\n");
   						writer.write("\t}\n\n");
  -						writer.write("\t"+attribs[i].getTypeName()+" *	p = ("+attribs[i].getTypeName()+"
*) array.m_Array;\n\n");
  -						writer.write("\tfor( int iCount = 0; iCount < array.m_Size; iCount++)\n");
  +						writer.write("\t"+attribs[i].getTypeName()+" *	p"+i+" = ("+attribs[i].getTypeName()+"
*) array.m_Array;\n\n");
  +						writer.write("\tfor( int iCount"+i+" = 0; iCount"+i+" < array.m_Size; iCount"+i+"++)\n");
   						writer.write("\t{\n");
  -						writer.write("\t\t*pp = p;\n\n");
  -						writer.write("\t\tpp++;\n");
  -						writer.write("\t\tp++;\n");
  +						writer.write("\t\t*pp"+i+" = p"+i+";\n\n");
  +						writer.write("\t\tpp"+i+"++;\n");
  +						writer.write("\t\tp"+i+"++;\n");
   						writer.write("\t}\n");
   					}
   					else
  
  
  

Mime
View raw message