axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From veit...@apache.org
Subject svn commit: r788466 - in /webservices/axis2/trunk/java/modules/adb-codegen: src/org/apache/axis2/schema/template/ADBBeanTemplate.xsl test/org/apache/axis2/schema/AbstractTestCase.java
Date Thu, 25 Jun 2009 19:07:56 GMT
Author: veithen
Date: Thu Jun 25 19:07:56 2009
New Revision: 788466

URL: http://svn.apache.org/viewvc?rev=788466&view=rev
Log:
Fixed an issue in the writeStartElement related code generated by ADB: XMLStreamWriter#writeStartElement(String)
creates an element in the default namespace, and not an element with an empty namespace URI,
as the code incorrectly assumed. Fixed that, taking into account that the empty namespace
URI must be mapped to the empty prefix, i.e. it must be the default namespace. This should
fix AXIS2-4374.

Modified:
    webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/template/ADBBeanTemplate.xsl
    webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/AbstractTestCase.java

Modified: webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/template/ADBBeanTemplate.xsl
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/template/ADBBeanTemplate.xsl?rev=788466&r1=788465&r2=788466&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/template/ADBBeanTemplate.xsl
(original)
+++ webservices/axis2/trunk/java/modules/adb-codegen/src/org/apache/axis2/schema/template/ADBBeanTemplate.xsl
Thu Jun 25 19:07:56 2009
@@ -1521,21 +1521,19 @@
          */
         private void writeStartElement(java.lang.String prefix, java.lang.String namespace,
java.lang.String localPart,
                                        javax.xml.stream.XMLStreamWriter xmlWriter) throws
javax.xml.stream.XMLStreamException {
-            if (namespace != null && namespace.trim().length() > 0) {
-                java.lang.String writerPrefix = xmlWriter.getPrefix(namespace);
-                if (writerPrefix != null) {
-                    xmlWriter.writeStartElement(namespace, localPart);
-                } else {
-                    if (prefix == null) {
-                        prefix = generatePrefix(namespace);
-                    }
-
-                    xmlWriter.writeStartElement(prefix, localPart, namespace);
-                    xmlWriter.writeNamespace(prefix, namespace);
-                    xmlWriter.setPrefix(prefix, namespace);
-                }
+            java.lang.String writerPrefix = xmlWriter.getPrefix(namespace);
+            if (writerPrefix != null) {
+                xmlWriter.writeStartElement(namespace, localPart);
             } else {
-                xmlWriter.writeStartElement(localPart);
+                if (namespace.length() == 0) {
+                    prefix = "";
+                } else if (prefix == null) {
+                    prefix = generatePrefix(namespace);
+                }
+
+                xmlWriter.writeStartElement(prefix, localPart, namespace);
+                xmlWriter.writeNamespace(prefix, namespace);
+                xmlWriter.setPrefix(prefix, namespace);
             }
         }
         

Modified: webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/AbstractTestCase.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/AbstractTestCase.java?rev=788466&r1=788465&r2=788466&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/AbstractTestCase.java
(original)
+++ webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/AbstractTestCase.java
Thu Jun 25 19:07:56 2009
@@ -199,8 +199,7 @@
         // TODO: this badly fails for many of the test cases => there are still issues
to solve!!!
 //        testSerializeDeserialize3(bean);
         
-        // TODO: this fails for one of the test cases
-//        testSerializeDeserialize4(bean);
+        testSerializeDeserialize4(bean);
     }
     
     // Deserialization approach 1: use an XMLStreamReader produced by the StAX parser.



Mime
View raw message