cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r924386 - /cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/WrapperHelperCompiler.java
Date Wed, 17 Mar 2010 17:51:59 GMT
Author: dkulp
Date: Wed Mar 17 17:51:59 2010
New Revision: 924386

URL: http://svn.apache.org/viewvc?rev=924386&view=rev
Log:
[CXF-2719] Fix problems with inOccurs=0/nillable wrapper elements
if the element isn't on the wire

Modified:
    cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/WrapperHelperCompiler.java

Modified: cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/WrapperHelperCompiler.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/WrapperHelperCompiler.java?rev=924386&r1=924385&r2=924386&view=diff
==============================================================================
--- cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/WrapperHelperCompiler.java
(original)
+++ cxf/trunk/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/WrapperHelperCompiler.java
Wed Mar 17 17:51:59 2010
@@ -424,9 +424,14 @@ final class WrapperHelperCompiler extend
                     createObjectWrapper(mv, method.getReturnType());
                 }
                 if (JAXBElement.class.isAssignableFrom(method.getReturnType())) {
+                    Label jumpOverLabel = new Label();
+                    mv.visitInsn(Opcodes.DUP);
+                    mv.visitJumpInsn(Opcodes.IFNULL, jumpOverLabel);
+
                     mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL,
                                        "javax/xml/bind/JAXBElement",
                                        "getValue", "()Ljava/lang/Object;");
+                    mv.visitLabel(jumpOverLabel);
                 }
                 
                 mv.visitMethodInsn(Opcodes.INVOKEINTERFACE, "java/util/List", "add", "(Ljava/lang/Object;)Z");
@@ -463,11 +468,4 @@ final class WrapperHelperCompiler extend
                            "valueOf", "(" + PRIMITIVE_MAP.get(cl) + ")L" 
                            + NONPRIMITIVE_MAP.get(cl) + ";");
     }
-    
-
-    
-    
-        
-
-
 }



Mime
View raw message