You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by sa...@apache.org on 2005/11/10 06:19:16 UTC

svn commit: r332224 - in /webservices/axis2/trunk/c/modules: test/om/src/test_om.c xml/om/maven.xml xml/om/project.xml xml/om/src/axis2_om_document.c xml/om/src/axis2_om_namespace.c xml/om/src/axis2_om_node.c

Author: samisa
Date: Wed Nov  9 21:19:01 2005
New Revision: 332224

URL: http://svn.apache.org/viewcvs?rev=332224&view=rev
Log:
fixed a bug 

Modified:
    webservices/axis2/trunk/c/modules/test/om/src/test_om.c
    webservices/axis2/trunk/c/modules/xml/om/maven.xml
    webservices/axis2/trunk/c/modules/xml/om/project.xml
    webservices/axis2/trunk/c/modules/xml/om/src/axis2_om_document.c
    webservices/axis2/trunk/c/modules/xml/om/src/axis2_om_namespace.c
    webservices/axis2/trunk/c/modules/xml/om/src/axis2_om_node.c

Modified: webservices/axis2/trunk/c/modules/test/om/src/test_om.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/test/om/src/test_om.c?rev=332224&r1=332223&r2=332224&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/test/om/src/test_om.c (original)
+++ webservices/axis2/trunk/c/modules/test/om/src/test_om.c Wed Nov  9 21:19:01 2005
@@ -100,9 +100,8 @@
     AXIS2_OM_NODE_SERIALIZE (node1, &environment , om_output);
     
     AXIS2_FREE (environment->allocator, om_output);
-    
-    AXIS2_OM_DOCUMENT_FREE (document, &environment);
-    
+    /* AXIS2_OM_NODE_FREE(node1,&environment);    */
+
     AXIS2_OM_STAX_BUILDER_FREE ( builder, &environment);
     guththila_xml_pull_parser_free (my_guththila_environment, parser);
     
@@ -182,7 +181,8 @@
         printf ("\naxis2_om_node_serialize success\n");
     /* end serializing stuff */
 
-    
+     AXIS2_OM_NODE_FREE(node1,&environment);
+     AXIS2_FREE(environment->allocator,om_output);
      printf ("\nDONE\n");
 
     return 0;

Modified: webservices/axis2/trunk/c/modules/xml/om/maven.xml
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/om/maven.xml?rev=332224&r1=332223&r2=332224&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/om/maven.xml (original)
+++ webservices/axis2/trunk/c/modules/xml/om/maven.xml Wed Nov  9 21:19:01 2005
@@ -1,29 +1,29 @@
-<!--
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
--->
-
-<project default="all" xmlns:m="jelly:maven">
-
-  <goal name="build-sub-module">
-     <attainGoal name="nar:compile" />
-  </goal>
-  <goal name="compile-tests">
-     <attainGoal name="nar:compile-tests" />
-  </goal>
-  <goal name="all" prereqs="build-sub-module,compile-tests" />
-
-</project>
+<!--
+/*
+ * Copyright 2001-2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+-->
+
+<project default="all" xmlns:m="jelly:maven">
+
+  <goal name="build-sub-module">
+     <attainGoal name="nar:compile" />
+  </goal>
+  <goal name="compile-tests">
+     <attainGoal name="nar:compile-tests" />
+  </goal>
+  <goal name="all" prereqs="build-sub-module,compile-tests" />
+
+</project>

Modified: webservices/axis2/trunk/c/modules/xml/om/project.xml
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/om/project.xml?rev=332224&r1=332223&r2=332224&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/om/project.xml (original)
+++ webservices/axis2/trunk/c/modules/xml/om/project.xml Wed Nov  9 21:19:01 2005
@@ -1,37 +1,37 @@
-<?xml version="1.0"?>
-<!--
-/*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
--->
-
-<project>
-  <extend>../../../project.xml</extend>
-  <id>axis2-xml-om</id>
-  <name>OM Framework</name>
-  <package>axis2.xml.om.*</package>
-  <description>OM project.</description>
-  <shortDescription>OM project</shortDescription>
-
-  <dependencies>
-    <!--dependency>
-        <groupId>axis2</groupId>
-        <artifactId>libaxis2-xml-guththila-nar</artifactId>
-        <version>0.0</version>
-        <type>nar</type>
-        </dependency-->
-  </dependencies>
-
-</project>
+<?xml version="1.0"?>
+<!--
+/*
+ * Copyright 2001-2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+-->
+
+<project>
+  <extend>../../../project.xml</extend>
+  <id>axis2-xml-om</id>
+  <name>OM Framework</name>
+  <package>axis2.xml.om.*</package>
+  <description>OM project.</description>
+  <shortDescription>OM project</shortDescription>
+
+  <dependencies>
+    <!--dependency>
+        <groupId>axis2</groupId>
+        <artifactId>libaxis2-xml-guththila-nar</artifactId>
+        <version>0.0</version>
+        <type>nar</type>
+        </dependency-->
+  </dependencies>
+
+</project>

Modified: webservices/axis2/trunk/c/modules/xml/om/src/axis2_om_document.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/om/src/axis2_om_document.c?rev=332224&r1=332223&r2=332224&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/om/src/axis2_om_document.c (original)
+++ webservices/axis2/trunk/c/modules/xml/om/src/axis2_om_document.c Wed Nov  9 21:19:01 2005
@@ -143,7 +143,7 @@
 {
     axis2_om_document_impl_t *document = NULL;
     
-    AXIS2_FUNC_PARAM_CHECK(document, env, AXIS2_FAILURE);
+    AXIS2_FUNC_PARAM_CHECK(om_document, env, AXIS2_FAILURE);
     document = AXIS2_INTF_TO_IMPL(om_document);
     
     if (document->char_set_encoding)

Modified: webservices/axis2/trunk/c/modules/xml/om/src/axis2_om_namespace.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/om/src/axis2_om_namespace.c?rev=332224&r1=332223&r2=332224&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/om/src/axis2_om_namespace.c (original)
+++ webservices/axis2/trunk/c/modules/xml/om/src/axis2_om_namespace.c Wed Nov  9 21:19:01 2005
@@ -82,9 +82,9 @@
     /* There should be a uri */
     if(!uri)
     {
-
+
         (*env)->error->error_number = AXIS2_ERROR_INVALID_NULL_PARAM;
-
+
         return NULL;
     }
 
@@ -222,10 +222,10 @@
     AXIS2_ENV_CHECK(env,AXIS2_CRTICAL_FAILURE);
     if (!om_namespace || !om_output)
     {
-
+
         AXIS2_ERROR_SET_ERROR_NUMBER((*env)->error, AXIS2_ERROR_INVALID_NULL_PARAM);
         AXIS2_ERROR_SET_STATUS_CODE((*env)->error, AXIS2_FAILURE);
-
+
         return AXIS2_FAILURE;
     }
     ns_impl = AXIS2_INTF_TO_IMPL(om_namespace);

Modified: webservices/axis2/trunk/c/modules/xml/om/src/axis2_om_node.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/om/src/axis2_om_node.c?rev=332224&r1=332223&r2=332224&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/om/src/axis2_om_node.c (original)
+++ webservices/axis2/trunk/c/modules/xml/om/src/axis2_om_node.c Wed Nov  9 21:19:01 2005
@@ -243,50 +243,50 @@
 
 axis2_status_t AXIS2_CALL axis2_om_node_free(axis2_om_node_t *om_node,axis2_env_t **env)
 {
-    printf("node free");
-    axis2_om_node_t *child_node = NULL;
-      
-    AXIS2_FUNC_PARAM_CHECK(om_node,env,AXIS2_FAILURE);
-    
-    if (AXIS2_INTF_TO_IMPL(om_node)->first_child)
-    {   
-        
-        while (AXIS2_INTF_TO_IMPL(om_node)->first_child)
-        {
-            
-            child_node = AXIS2_OM_NODE_DETACH (AXIS2_INTF_TO_IMPL(om_node)->first_child, env);
-            AXIS2_OM_NODE_FREE ( child_node , env);
-        }
-    }
-    
-    switch (AXIS2_INTF_TO_IMPL(om_node)->node_type)
-    {
+    
+    axis2_om_node_t *child_node = NULL;
+      
+    AXIS2_FUNC_PARAM_CHECK(om_node,env,AXIS2_FAILURE);
+    
+    if (AXIS2_INTF_TO_IMPL(om_node)->first_child)
+    {   
+        
+        while (AXIS2_INTF_TO_IMPL(om_node)->first_child)
+        {
+            
+            child_node = AXIS2_OM_NODE_DETACH (AXIS2_INTF_TO_IMPL(om_node)->first_child, env);
+            AXIS2_OM_NODE_FREE ( child_node , env);
+        }
+    }
+    
+    switch (AXIS2_INTF_TO_IMPL(om_node)->node_type)
+    {
     case AXIS2_OM_ELEMENT:
-        printf(" om element free");
-        AXIS2_OM_ELEMENT_FREE((axis2_om_element_t*)(AXIS2_INTF_TO_IMPL(om_node)->data_element), env);
-        break;
-
-    case AXIS2_OM_COMMENT:
-        /* axis2_om_comment_free(env,(axis2_om_comment_t*)node->data_element) */
-        break;
-    case AXIS2_OM_DOCTYPE:
-        /* axis2_om_doctype_free(env,(axis2_om_doctype_t*)node->data_element) */
-        break;
-    case AXIS2_OM_PROCESSING_INSTRUCTION:
-        /* axis2_om_prcessing_instruction_free(env,(axis2_om_processing_instruction)node->data_element)*/
-        break;
-    case AXIS2_OM_TEXT:
-        AXIS2_OM_TEXT_FREE((axis2_om_text_t*)(AXIS2_INTF_TO_IMPL(om_node)->data_element),env);
-        break;
-
-    default:
-        break;
-    }
-    
-    AXIS2_FREE ((*env)->allocator, om_node->ops);
-    AXIS2_FREE ((*env)->allocator, AXIS2_INTF_TO_IMPL(om_node));
-    
-
+        
+        AXIS2_OM_ELEMENT_FREE((axis2_om_element_t*)(AXIS2_INTF_TO_IMPL(om_node)->data_element), env);
+        break;
+
+    case AXIS2_OM_COMMENT:
+        /* axis2_om_comment_free(env,(axis2_om_comment_t*)node->data_element) */
+        break;
+    case AXIS2_OM_DOCTYPE:
+        /* axis2_om_doctype_free(env,(axis2_om_doctype_t*)node->data_element) */
+        break;
+    case AXIS2_OM_PROCESSING_INSTRUCTION:
+        /* axis2_om_prcessing_instruction_free(env,(axis2_om_processing_instruction)node->data_element)*/
+        break;
+    case AXIS2_OM_TEXT:
+        AXIS2_OM_TEXT_FREE((axis2_om_text_t*)(AXIS2_INTF_TO_IMPL(om_node)->data_element),env);
+        break;
+
+    default:
+        break;
+    }
+    
+    AXIS2_FREE ((*env)->allocator, om_node->ops);
+    AXIS2_FREE ((*env)->allocator, AXIS2_INTF_TO_IMPL(om_node));
+    
+
     return AXIS2_SUCCESS;
 }
 
@@ -298,10 +298,10 @@
     AXIS2_FUNC_PARAM_CHECK(om_node,env,AXIS2_FAILURE);
 
     if(!parent)
-    {
+    {
         AXIS2_ERROR_SET_ERROR_NUMBER((*env)->error, AXIS2_ERROR_INVALID_NULL_PARAM);
         AXIS2_ERROR_SET_STATUS_CODE((*env)->error, AXIS2_FAILURE);
-
+
         return AXIS2_FAILURE;
     }
 
@@ -328,20 +328,21 @@
                       axis2_env_t **env)
 {
     axis2_om_node_t *parent = NULL;
-
+
    
     AXIS2_FUNC_PARAM_CHECK(om_node, env, NULL);
     
     parent = AXIS2_INTF_TO_IMPL(om_node)->parent;
-
-
+    
+    AXIS2_PARAM_CHECK((*env)->error,parent,NULL);
+    
 
-    if ((AXIS2_INTF_TO_IMPL(om_node)->prev_sibling) == NULL)
+    if (!(AXIS2_INTF_TO_IMPL(om_node)->prev_sibling))
     {
-        AXIS2_INTF_TO_IMPL(om_node)->first_child = AXIS2_INTF_TO_IMPL(om_node)->next_sibling;
+        AXIS2_INTF_TO_IMPL(parent)->first_child = AXIS2_INTF_TO_IMPL(om_node)->next_sibling;
     }
     else
-    {
+    {    
         axis2_om_node_t *prev_sib = NULL;
         prev_sib  = AXIS2_INTF_TO_IMPL(om_node)->prev_sibling;
         if(prev_sib)
@@ -372,9 +373,9 @@
     AXIS2_FUNC_PARAM_CHECK(om_node,env,AXIS2_FAILURE);
     if(!parent)
     {
-
+
         AXIS2_ERROR_SET_ERROR_NUMBER((*env)->error, AXIS2_ERROR_INVALID_NULL_PARAM);
-
+
         return AXIS2_FAILURE;
     }
     
@@ -385,7 +386,7 @@
     /* if a new parent is assigned in  place of existing 
      *  one first the node should  be detached  
      */
-    if(!(AXIS2_INTF_TO_IMPL(om_node)->parent))
+    if((AXIS2_INTF_TO_IMPL(om_node)->parent))
     {
         axis2_om_node_detach(om_node,env);
     }
@@ -410,9 +411,9 @@
     AXIS2_FUNC_PARAM_CHECK(om_node, env, AXIS2_FAILURE);
     if(!node_to_insert)
     {
-
+
         AXIS2_ERROR_SET_ERROR_NUMBER((*env)->error, AXIS2_ERROR_INVALID_NULL_PARAM);
-
+
         return AXIS2_FAILURE;
     }
     
@@ -444,9 +445,9 @@
    
     if(!node_to_insert)
     {
-
+
         AXIS2_ERROR_SET_ERROR_NUMBER((*env)->error, AXIS2_ERROR_INVALID_NULL_PARAM);
-
+
         return AXIS2_FAILURE;
     }
     
@@ -481,11 +482,11 @@
     
     if(AXIS2_INTF_TO_IMPL(om_node)->first_child)
     {
-
+
         AXIS2_INTF_TO_IMPL(om_node)->current_child = 
             AXIS2_INTF_TO_IMPL(om_node)->first_child;
         return AXIS2_INTF_TO_IMPL(om_node)->first_child;
-
+
     }
     return NULL;
 }
@@ -502,7 +503,7 @@
     if(!(AXIS2_INTF_TO_IMPL(om_node)->current_child))
     {
         (*env)->error->error_number = AXIS2_ERROR_INVALID_ITERATOR_STATE;
-
+
         return NULL;
     
     }