You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by dk...@apache.org on 2008/05/28 22:48:44 UTC

svn commit: r661076 - in /cxf/trunk: rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/WrapperHelperCompiler.java systests/src/test/java/org/apache/cxf/systest/type_test/AbstractTypeTestClient.java

Author: dkulp
Date: Wed May 28 13:48:44 2008
New Revision: 661076

URL: http://svn.apache.org/viewvc?rev=661076&view=rev
Log:
add some fake line numbers into the generated wrapper helper to hopefully help debugging

Modified:
    cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/WrapperHelperCompiler.java
    cxf/trunk/systests/src/test/java/org/apache/cxf/systest/type_test/AbstractTypeTestClient.java

Modified: cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/WrapperHelperCompiler.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/WrapperHelperCompiler.java?rev=661076&r1=661075&r2=661076&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/WrapperHelperCompiler.java (original)
+++ cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/WrapperHelperCompiler.java Wed May 28 13:48:44 2008
@@ -166,10 +166,12 @@
         mv.visitCode();
         Label l0 = new Label();
         mv.visitLabel(l0);
+        mv.visitLineNumber(100, l0);
         mv.visitLdcInsn(sig);
         mv.visitInsn(Opcodes.ARETURN);
         Label l1 = new Label();
         mv.visitLabel(l1);
+        mv.visitLineNumber(101, l1);
         mv.visitMaxs(0, 0);
         mv.visitEnd();
         return true;
@@ -189,6 +191,7 @@
         mv.visitCode();
         Label l0 = new Label();
         mv.visitLabel(l0);
+        mv.visitLineNumber(102, l0);
         
         mv.visitVarInsn(Opcodes.ALOAD, 0);
         mv.visitMethodInsn(Opcodes.INVOKESPECIAL,
@@ -210,6 +213,8 @@
     
         Label l1 = new Label();
         mv.visitLabel(l1);
+        mv.visitLineNumber(103, l0);
+
         mv.visitLocalVariable("this", "L" + newClassName + ";", null, l0, l1, 0);
         mv.visitMaxs(0, 0);
         mv.visitEnd();
@@ -228,7 +233,8 @@
         mv.visitCode();
         Label lBegin = new Label();
         mv.visitLabel(lBegin);
-        
+        mv.visitLineNumber(104, lBegin);
+
         mv.visitTypeInsn(Opcodes.NEW, periodToSlashes(wrapperType.getName()));
         mv.visitInsn(Opcodes.DUP);
         mv.visitMethodInsn(Opcodes.INVOKESPECIAL, periodToSlashes(wrapperType.getName()),
@@ -287,6 +293,7 @@
     
         Label lEnd = new Label();
         mv.visitLabel(lEnd);
+        mv.visitLineNumber(105, lEnd);
         mv.visitLocalVariable("this", "L" + newClassName + ";", null, lBegin, lEnd, 0);
         mv.visitLocalVariable("lst", "Ljava/util/List;", "Ljava/util/List<*>;", lBegin, lEnd, 1);
         mv.visitLocalVariable("ok", "L" + periodToSlashes(wrapperType.getName()) + ";",
@@ -305,6 +312,10 @@
         // aVal.addAll(newA);
         // }
         
+        Label l3 = new Label();
+        mv.visitLabel(l3);
+        mv.visitLineNumber(114, l3);
+
         mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL,
                            periodToSlashes(wrapperType.getName()),
                            getMethods[x].getName(),
@@ -341,6 +352,8 @@
         Label jumpOverLabel = new Label();
         mv.visitJumpInsn(Opcodes.GOTO, jumpOverLabel);
         mv.visitLabel(nonNullLabel);
+        mv.visitLineNumber(106, nonNullLabel);
+
         mv.visitVarInsn(Opcodes.ALOAD, 4);
         mv.visitJumpInsn(Opcodes.IFNULL, jumpOverLabel);
         mv.visitVarInsn(Opcodes.ALOAD, 3);
@@ -349,7 +362,7 @@
                            "java/util/List", "addAll", "(Ljava/util/Collection;)Z");
         mv.visitInsn(Opcodes.POP);
         mv.visitLabel(jumpOverLabel);
-
+        mv.visitLineNumber(107, jumpOverLabel);
     }
     
     private static boolean addGetWrapperParts(String newClassName,
@@ -367,6 +380,7 @@
         mv.visitCode();
         Label lBegin = new Label();
         mv.visitLabel(lBegin);
+        mv.visitLineNumber(108, lBegin);
                
         // the ret List
         mv.visitTypeInsn(Opcodes.NEW, "java/util/ArrayList");
@@ -387,12 +401,20 @@
             }
             
             if (method == null) {
+                Label l3 = new Label();
+                mv.visitLabel(l3);
+                mv.visitLineNumber(200 + x, l3);
+
                 mv.visitVarInsn(Opcodes.ALOAD, 2);
                 mv.visitInsn(Opcodes.ACONST_NULL);
                 mv.visitMethodInsn(Opcodes.INVOKEINTERFACE, "java/util/List",
                                    "add", "(Ljava/lang/Object;)Z");
                 mv.visitInsn(Opcodes.POP);
             } else {
+                Label l3 = new Label();
+                mv.visitLabel(l3);
+                mv.visitLineNumber(250 + x, l3);
+                
                 mv.visitVarInsn(Opcodes.ALOAD, 2);
                 mv.visitVarInsn(Opcodes.ALOAD, 3);
                 mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, 
@@ -417,12 +439,14 @@
         // return the list
         Label l2 = new Label();
         mv.visitLabel(l2);
+        mv.visitLineNumber(108, l2);
         mv.visitVarInsn(Opcodes.ALOAD, 2);
         mv.visitInsn(Opcodes.ARETURN);
         
         
         Label lEnd = new Label();
         mv.visitLabel(lEnd);
+        mv.visitLineNumber(109, lEnd);
         mv.visitLocalVariable("this", "L" + newClassName + ";", null, lBegin, lEnd, 0);
         mv.visitLocalVariable("o", "Ljava/lang/Object;", null, lBegin, lEnd, 1);
         mv.visitLocalVariable("ret", "Ljava/util/List;", "Ljava/util/List<Ljava/lang/Object;>;",

Modified: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/type_test/AbstractTypeTestClient.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/type_test/AbstractTypeTestClient.java?rev=661076&r1=661075&r2=661076&view=diff
==============================================================================
--- cxf/trunk/systests/src/test/java/org/apache/cxf/systest/type_test/AbstractTypeTestClient.java (original)
+++ cxf/trunk/systests/src/test/java/org/apache/cxf/systest/type_test/AbstractTypeTestClient.java Wed May 28 13:48:44 2008
@@ -30,6 +30,7 @@
 import javax.xml.datatype.XMLGregorianCalendar;
 import javax.xml.namespace.QName;
 import javax.xml.ws.Holder;
+import javax.xml.ws.soap.SOAPFaultException;
 
 import org.apache.cxf.helpers.IOUtils;
 import org.apache.cxf.testutil.common.AbstractBusClientServerTestBase;
@@ -2075,7 +2076,11 @@
                 assertTrue("testStringList(): Incorrect return value", x.equals(ret));
             }
             if (testDocLiteral) {
-                ret = docClient.testStringList(null, y, z);
+                try {
+                    ret = docClient.testStringList(null, y, z);
+                } catch (SOAPFaultException ex) {
+                    assertTrue(ex.getMessage(), ex.getMessage().contains("Unmarshalling"));
+                }
             }
         } else {
             String[] x = {"I", "am", "SimpleList"};