You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-commits@axis.apache.org by ve...@apache.org on 2016/04/18 23:28:10 UTC

svn commit: r1739825 - in /axis/axis2/java/core/branches/1_7: ./ modules/adb/ modules/adb/src/org/apache/axis2/databinding/utils/ modules/adb/test/org/apache/axis2/databinding/utils/

Author: veithen
Date: Mon Apr 18 21:28:09 2016
New Revision: 1739825

URL: http://svn.apache.org/viewvc?rev=1739825&view=rev
Log:
AXIS2-5751: Merge r1739815 to the 1.7 branch.

Added:
    axis/axis2/java/core/branches/1_7/modules/adb/test/org/apache/axis2/databinding/utils/ComplexTypeWithAnyTypeElement.java
      - copied unchanged from r1739815, axis/axis2/java/core/trunk/modules/adb/test/org/apache/axis2/databinding/utils/ComplexTypeWithAnyTypeElement.java
Modified:
    axis/axis2/java/core/branches/1_7/   (props changed)
    axis/axis2/java/core/branches/1_7/modules/adb/pom.xml
    axis/axis2/java/core/branches/1_7/modules/adb/src/org/apache/axis2/databinding/utils/BeanUtil.java
    axis/axis2/java/core/branches/1_7/modules/adb/test/org/apache/axis2/databinding/utils/BeanUtilTest.java

Propchange: axis/axis2/java/core/branches/1_7/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Apr 18 21:28:09 2016
@@ -1,4 +1,4 @@
 /axis/axis2/java/core/branches/1_6:1295540
 /axis/axis2/java/core/branches/AXIOM-420:1334386-1336397
 /axis/axis2/java/core/branches/AXIS2-4318:1230452,1295542,1324772,1327468,1329571,1332141,1335355,1335357,1340985
-/axis/axis2/java/core/trunk:1726494,1726509,1726513,1727171,1727174,1727177,1727180,1729891,1730095,1730139,1730180,1730186,1730195,1730197,1730222,1730300,1730308,1730310,1730317,1730322,1730335,1730369,1730427,1730618,1731425,1731441,1731446,1731448,1732354,1733137,1733663,1733713,1733766,1733770,1733773,1733850,1734176,1735331,1735795,1736512,1736543,1737030,1737567,1739001,1739186,1739346,1739348
+/axis/axis2/java/core/trunk:1726494,1726509,1726513,1727171,1727174,1727177,1727180,1729891,1730095,1730139,1730180,1730186,1730195,1730197,1730222,1730300,1730308,1730310,1730317,1730322,1730335,1730369,1730427,1730618,1731425,1731441,1731446,1731448,1732354,1733137,1733663,1733713,1733766,1733770,1733773,1733850,1734176,1735331,1735795,1736512,1736543,1737030,1737567,1739001,1739186,1739346,1739348,1739815

Modified: axis/axis2/java/core/branches/1_7/modules/adb/pom.xml
URL: http://svn.apache.org/viewvc/axis/axis2/java/core/branches/1_7/modules/adb/pom.xml?rev=1739825&r1=1739824&r2=1739825&view=diff
==============================================================================
--- axis/axis2/java/core/branches/1_7/modules/adb/pom.xml (original)
+++ axis/axis2/java/core/branches/1_7/modules/adb/pom.xml Mon Apr 18 21:28:09 2016
@@ -61,7 +61,12 @@
             <groupId>xmlunit</groupId>
             <artifactId>xmlunit</artifactId>
             <scope>test</scope>
-        </dependency>       
+        </dependency>
+        <dependency>
+            <groupId>org.apache.ws.commons.axiom</groupId>
+            <artifactId>xml-truth</artifactId>
+            <scope>test</scope>
+        </dependency>
         <dependency>
             <groupId>org.apache.geronimo.specs</groupId>
             <artifactId>geronimo-javamail_1.4_spec</artifactId>

Modified: axis/axis2/java/core/branches/1_7/modules/adb/src/org/apache/axis2/databinding/utils/BeanUtil.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/core/branches/1_7/modules/adb/src/org/apache/axis2/databinding/utils/BeanUtil.java?rev=1739825&r1=1739824&r2=1739825&view=diff
==============================================================================
--- axis/axis2/java/core/branches/1_7/modules/adb/src/org/apache/axis2/databinding/utils/BeanUtil.java (original)
+++ axis/axis2/java/core/branches/1_7/modules/adb/src/org/apache/axis2/databinding/utils/BeanUtil.java Mon Apr 18 21:28:09 2016
@@ -355,7 +355,7 @@ public class BeanUtil {
                 }else {
                     addTypeQname(elemntNameSpace, propertyQnameValueList, property,
                                  beanName, processingDocLitBare);
-                    if (Object.class.equals(ptype)) {
+                    if (Object.class.equals(ptype) && value != null) {
                         //this is required to match this element prefix as
                         //root element's prefix.
                         QName qNamefortheType = (QName) typeTable

Modified: axis/axis2/java/core/branches/1_7/modules/adb/test/org/apache/axis2/databinding/utils/BeanUtilTest.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/core/branches/1_7/modules/adb/test/org/apache/axis2/databinding/utils/BeanUtilTest.java?rev=1739825&r1=1739824&r2=1739825&view=diff
==============================================================================
--- axis/axis2/java/core/branches/1_7/modules/adb/test/org/apache/axis2/databinding/utils/BeanUtilTest.java (original)
+++ axis/axis2/java/core/branches/1_7/modules/adb/test/org/apache/axis2/databinding/utils/BeanUtilTest.java Mon Apr 18 21:28:09 2016
@@ -34,6 +34,9 @@ import javax.activation.DataHandler;
 import javax.mail.util.ByteArrayDataSource;
 import javax.xml.namespace.QName;
 
+import static com.google.common.truth.Truth.assertAbout;
+import static org.apache.axiom.truth.xml.XMLTruth.xml;
+
 import java.io.ByteArrayInputStream;
 import java.math.BigInteger;
 import java.util.List;
@@ -283,5 +286,14 @@ public class BeanUtilTest extends TestCa
 	    return new String(theChars);
 	      }
   
-   
+    /**
+     * Regression test for AXIS2-5751.
+     */
+    public void testSerializeAnyTypeNull() {
+        assertAbout(xml())
+                .that(BeanUtil.getPullParser(new ComplexTypeWithAnyTypeElement(), new QName("root"), null, false, false))
+                .ignoringNamespaceDeclarations()
+                .ignoringNamespacePrefixes()
+                .hasSameContentAs("<root><prop xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:nil='true'/></root>");
+    }
 }