axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From veit...@apache.org
Subject svn commit: r787379 - in /webservices/axis2/trunk/java/modules: adb-codegen/test/org/apache/axis2/schema/anytype/AnyTypeTest.java adb/src/org/apache/axis2/databinding/utils/ConverterUtil.java
Date Mon, 22 Jun 2009 20:21:14 GMT
Author: veithen
Date: Mon Jun 22 20:21:14 2009
New Revision: 787379

URL: http://svn.apache.org/viewvc?rev=787379&view=rev
Log:
AXIS2-4402: Fixed issue in ADB when parsing an anyType element with empty value. This also
eliminates one usage of XMLStreamReader#getText which is incorrect if the parser is not coalescing.

Modified:
    webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/anytype/AnyTypeTest.java
    webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/ConverterUtil.java

Modified: webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/anytype/AnyTypeTest.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/anytype/AnyTypeTest.java?rev=787379&r1=787378&r2=787379&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/anytype/AnyTypeTest.java
(original)
+++ webservices/axis2/trunk/java/modules/adb-codegen/test/org/apache/axis2/schema/anytype/AnyTypeTest.java
Mon Jun 22 20:21:14 2009
@@ -253,5 +253,11 @@
         assertNull(test.getParam1());
         assertEquals("test", test.getParam2());
     }
+    
+    public void testEmptyString() throws Exception {
+        TestAnyTypeElement1 testAnyTypeElement = new TestAnyTypeElement1();
+        testAnyTypeElement.setTestAnyTypeElement1("");
+        testSerializeDeserialize(testAnyTypeElement);
+    }
 }
 

Modified: webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/ConverterUtil.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/ConverterUtil.java?rev=787379&r1=787378&r2=787379&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/ConverterUtil.java
(original)
+++ webservices/axis2/trunk/java/modules/adb/src/org/apache/axis2/databinding/utils/ConverterUtil.java
Mon Jun 22 20:21:14 2009
@@ -1529,10 +1529,7 @@
                         xmlStreamReader.next();
                         returnObject = getDataHandlerObject(xmlStreamReader);
                     } else {
-                        // we have to do this other wise xmlstream event type is not set.
-                        xmlStreamReader.next();
-                        String attribValue = xmlStreamReader.getText();
-                        xmlStreamReader.next();
+                        String attribValue = xmlStreamReader.getElementText();
                         if (attribValue != null) {
                             if (attributeType.equals("string")) {
                                 returnObject = attribValue;



Mime
View raw message