axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From di...@apache.org
Subject svn commit: r379795 - in /webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp: BeanParamWriter.java literal/BeanParamWriter.java
Date Wed, 22 Feb 2006 15:34:00 GMT
Author: dicka
Date: Wed Feb 22 07:33:58 2006
New Revision: 379795

URL: http://svn.apache.org/viewcvs?rev=379795&view=rev
Log:
AXISCPP-935

Produce correct code in generated bean delete methods to handle arrays.

Modified:
    webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/BeanParamWriter.java
    webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/BeanParamWriter.java

Modified: webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/BeanParamWriter.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/BeanParamWriter.java?rev=379795&r1=379794&r2=379795&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/BeanParamWriter.java
(original)
+++ webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/BeanParamWriter.java
Wed Feb 22 07:33:58 2006
@@ -786,23 +786,35 @@
 
 	private void writeDeleteGlobalMethod() throws IOException 
     {
-		writer.write("/*\n");
-		writer.write(" * This static method delete a " + classname
-				+ " type of object\n");
-		writer.write(" */\n");
-		writer.write("void Axis_Delete_" + classname + "(" + classname
-				+ "* param, bool bArray = false, int nSize=0)\n");
-		writer.write("{\n");
-		writer.write("\tif (bArray)\n");
-		writer.write("\t{\n");
-		writer.write("\t\tdelete [] param;\n");
-		writer.write("\t}\n");
-		writer.write("\telse\n");
-		writer.write("\t{\n");
-		writer.write("\t\tdelete param;\n");
-		writer.write("\t}\n");
-		writer.write("}\n");
-	}
+        writer.write("/*\n");
+        writer.write(" * This static method delete a " + classname
+                + " type of object\n");
+        writer.write(" */\n");
+        writer.write("void Axis_Delete_" + classname + "(" + classname
+                + "* param, bool bArray = false, int nSize=0)\n");
+        writer.write("{\n");
+        writer.write("\tif (bArray)\n");
+        writer.write("\t{\n");
+        writer.write("\t\tif (nSize > 0)\n");
+        writer.write("\t\t{\n");
+        writer.write("\t\t\tfor (int count = 0 ; count < nSize ; count++ )\n");
+        writer.write("\t\t\t{\n");
+        writer.write("\t\t\t\tif ( (( " + classname + " ** ) param)[count])\n");
+        writer.write("\t\t\t\t{\n");
+        writer.write("\t\t\t\t\tdelete (( " + classname + " ** ) param)[count];\n");
+        writer.write("\t\t\t\t\t(( " + classname + " ** ) param)[count] = NULL;\n");
+        writer.write("\t\t\t\t}\n");
+        writer.write("\t\t\t}\n");
+        writer.write("\t\t\tdelete [] ( " + classname + " ** ) param;\n");
+        writer.write("\t\t}\n");
+        writer.write("\t}\n");
+        writer.write("\telse\n");
+        writer.write("\t{\n");
+        writer.write("\t\tdelete param;\n");
+        writer.write("\t}\n");
+        writer.write("\tparam = NULL;\n");
+        writer.write("}\n");
+    }
 
 	/*
 	 * (non-Javadoc)

Modified: webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/BeanParamWriter.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/BeanParamWriter.java?rev=379795&r1=379794&r2=379795&view=diff
==============================================================================
--- webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/BeanParamWriter.java
(original)
+++ webservices/axis/trunk/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/cpp/literal/BeanParamWriter.java
Wed Feb 22 07:33:58 2006
@@ -1307,12 +1307,24 @@
         writer.write("{\n");
         writer.write("\tif (bArray)\n");
         writer.write("\t{\n");
-        writer.write("\t\tdelete [] param;\n");
+        writer.write("\t\tif (nSize > 0)\n");
+        writer.write("\t\t{\n");
+        writer.write("\t\t\tfor (int count = 0 ; count < nSize ; count++ )\n");
+        writer.write("\t\t\t{\n");
+        writer.write("\t\t\t\tif ( (( " + classname + " ** ) param)[count])\n");
+        writer.write("\t\t\t\t{\n");
+        writer.write("\t\t\t\t\tdelete (( " + classname + " ** ) param)[count];\n");
+        writer.write("\t\t\t\t\t(( " + classname + " ** ) param)[count] = NULL;\n");
+        writer.write("\t\t\t\t}\n");
+        writer.write("\t\t\t}\n");
+        writer.write("\t\t\tdelete [] ( " + classname + " ** ) param;\n");
+        writer.write("\t\t}\n");
         writer.write("\t}\n");
         writer.write("\telse\n");
         writer.write("\t{\n");
         writer.write("\t\tdelete param;\n");
         writer.write("\t}\n");
+        writer.write("\tparam = NULL;\n");
         writer.write("}\n");
     }
 



Mime
View raw message