Author: dkulp
Date: Tue Jun 2 03:04:31 2009
New Revision: 780919
URL: http://svn.apache.org/viewvc?rev=780919&view=rev
Log:
Merged revisions 780911 via svnmerge from
https://svn.apache.org/repos/asf/cxf/trunk
........
r780911 | dkulp | 2009-06-01 22:46:03 -0400 (Mon, 01 Jun 2009) | 3 lines
Fix problems with the ASM optimized wrapper helpers with newer versions
of HotSpot. Fix issue of not finding certain element names with
xjc:simple.
........
Modified:
cxf/branches/2.1.x-fixes/ (props changed)
cxf/branches/2.1.x-fixes/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBDataBinding.java
cxf/branches/2.1.x-fixes/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/WrapperHelperCompiler.java
cxf/branches/2.1.x-fixes/systests/src/test/java/org/apache/cxf/systest/jaxws/ClientServerMiscTest.java
cxf/branches/2.1.x-fixes/systests/src/test/java/org/apache/cxf/systest/jaxws/DocLitWrappedCodeFirstService.java
cxf/branches/2.1.x-fixes/systests/src/test/java/org/apache/cxf/systest/jaxws/DocLitWrappedCodeFirstServiceImpl.java
Propchange: cxf/branches/2.1.x-fixes/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Jun 2 03:04:31 2009
@@ -1 +1 @@
-/cxf/trunk:743446,753380,753397,753421,754585,755365,757499,757859,757899,757935,757951,758195,758303,758308,758378,758690,758910,759890,759961,759963-759964,759966,760029,760073,760150,760171,760178,760198,760212,760456,760468,760582,760938,761094,761113,761120,761317,761759,761789,762393,762518,762567,763200,763272,763495,763854,763931,763942,763953,764033-764034,764581,764599-764606,764887,765357,766013,766058,766100-766101,766763,766770,766860,766962-766963,767159,767191,767927,771416,772143,772402,772658,772714,773009-773010,773027,773049,773146,773581,773691,773693,774446-774496,774558,774760,774851,774979,775423,776024-776025,776218,776429,776459,777189,777224,777243,777481,777505,777572,777580,780033,780184,780213,780421,780664,780800,780902
+/cxf/trunk:743446,753380,753397,753421,754585,755365,757499,757859,757899,757935,757951,758195,758303,758308,758378,758690,758910,759890,759961,759963-759964,759966,760029,760073,760150,760171,760178,760198,760212,760456,760468,760582,760938,761094,761113,761120,761317,761759,761789,762393,762518,762567,763200,763272,763495,763854,763931,763942,763953,764033-764034,764581,764599-764606,764887,765357,766013,766058,766100-766101,766763,766770,766860,766962-766963,767159,767191,767927,771416,772143,772402,772658,772714,773009-773010,773027,773049,773146,773581,773691,773693,774446-774496,774558,774760,774851,774979,775423,776024-776025,776218,776429,776459,777189,777224,777243,777481,777505,777572,777580,780033,780184,780213,780421,780664,780800,780902,780911
Propchange: cxf/branches/2.1.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.
Modified:
cxf/branches/2.1.x-fixes/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBDataBinding.java
URL:
http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBDataBinding.java?rev=780919&r1=780918&r2=780919&view=diff
==============================================================================
---
cxf/branches/2.1.x-fixes/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBDataBinding.java
(original)
+++
cxf/branches/2.1.x-fixes/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/JAXBDataBinding.java
Tue Jun 2 03:04:31 2009
@@ -807,6 +807,15 @@
}
}
}
+ if (getMethod == null && elField != null) {
+ getAccessor = JAXBUtils.nameToIdentifier(elField.getName(),
JAXBUtils.IdentifierType.GETTER);
+ setAccessor = JAXBUtils.nameToIdentifier(elField.getName(),
JAXBUtils.IdentifierType.SETTER);
+ try {
+ getMethod = valueClass.getMethod(getAccessor,
AbstractWrapperHelper.NO_CLASSES);
+ } catch (NoSuchMethodException ex) {
+ //ignore for now
+ }
+ }
String setAccessor2 = setAccessor;
if ("return".equals(partName)) {
//some versions of jaxb map "return" to "set_return" instead
of "setReturn"
@@ -902,7 +911,6 @@
jaxbMethods,
fields, objectFactory);
} catch (ClassNotFoundException e) {
// ASM not found, just use reflection based stuff
- e.printStackTrace();
}
return null;
}
Modified:
cxf/branches/2.1.x-fixes/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/WrapperHelperCompiler.java
URL:
http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/WrapperHelperCompiler.java?rev=780919&r1=780918&r2=780919&view=diff
==============================================================================
---
cxf/branches/2.1.x-fixes/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/WrapperHelperCompiler.java
(original)
+++
cxf/branches/2.1.x-fixes/rt/databinding/jaxb/src/main/java/org/apache/cxf/jaxb/WrapperHelperCompiler.java
Tue Jun 2 03:04:31 2009
@@ -72,10 +72,11 @@
jaxbMethods,
fields,
objectFactory).compile();
+
} catch (Throwable t) {
// Some error - probably a bad version of ASM or similar
- return null;
}
+ return null;
}
@@ -115,14 +116,14 @@
Opcodes.ACC_PUBLIC | Opcodes.ACC_SUPER,
newClassName,
null,
- periodToSlashes(WrapperHelper.class.getName()),
- null);
+ "java/lang/Object",
+ new String[]
{periodToSlashes(WrapperHelper.class.getName())});
addConstructor(newClassName, cw, objectFactory == null ? null :
objectFactory.getClass());
boolean b = addSignature();
if (b) {
- addCreateWrapperObject(newClassName,
- objectFactory == null ? null :
objectFactory.getClass());
+ b = addCreateWrapperObject(newClassName,
+ objectFactory == null ? null :
objectFactory.getClass());
}
if (b) {
b = addGetWrapperParts(newClassName, wrapperType,
@@ -139,6 +140,7 @@
}
} catch (Throwable e) {
// ignore, we'll just fall down to reflection based
+ e.printStackTrace();
}
return null;
}
@@ -165,14 +167,11 @@
MethodVisitor mv = cw.visitMethod(Opcodes.ACC_PUBLIC,
"getSignature",
"()Ljava/lang/String;", null, null);
mv.visitCode();
+ mv.visitLdcInsn(sig);
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;
@@ -196,7 +195,7 @@
mv.visitVarInsn(Opcodes.ALOAD, 0);
mv.visitMethodInsn(Opcodes.INVOKESPECIAL,
- periodToSlashes(WrapperHelper.class.getName()),
+ "java/lang/Object",
"<init>",
"()V");
if (objectFactory != null) {
@@ -294,7 +293,6 @@
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()) + ";",
@@ -447,7 +445,6 @@
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/branches/2.1.x-fixes/systests/src/test/java/org/apache/cxf/systest/jaxws/ClientServerMiscTest.java
URL:
http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/systests/src/test/java/org/apache/cxf/systest/jaxws/ClientServerMiscTest.java?rev=780919&r1=780918&r2=780919&view=diff
==============================================================================
---
cxf/branches/2.1.x-fixes/systests/src/test/java/org/apache/cxf/systest/jaxws/ClientServerMiscTest.java
(original)
+++
cxf/branches/2.1.x-fixes/systests/src/test/java/org/apache/cxf/systest/jaxws/ClientServerMiscTest.java
Tue Jun 2 03:04:31 2009
@@ -283,6 +283,8 @@
Set<Foo> fooSet = port.getFooSet();
assertEquals(2, fooSet.size());
+ assertEquals("size: 2", port.doFooList(new ArrayList<Foo>(fooSet)));
+
assertEquals(24, port.echoIntDifferentWrapperName(24));
Modified:
cxf/branches/2.1.x-fixes/systests/src/test/java/org/apache/cxf/systest/jaxws/DocLitWrappedCodeFirstService.java
URL:
http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/systests/src/test/java/org/apache/cxf/systest/jaxws/DocLitWrappedCodeFirstService.java?rev=780919&r1=780918&r2=780919&view=diff
==============================================================================
---
cxf/branches/2.1.x-fixes/systests/src/test/java/org/apache/cxf/systest/jaxws/DocLitWrappedCodeFirstService.java
(original)
+++
cxf/branches/2.1.x-fixes/systests/src/test/java/org/apache/cxf/systest/jaxws/DocLitWrappedCodeFirstService.java
Tue Jun 2 03:04:31 2009
@@ -18,6 +18,7 @@
*/
package org.apache.cxf.systest.jaxws;
+import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import java.util.Vector;
@@ -29,6 +30,10 @@
import javax.jws.WebService;
import javax.jws.soap.SOAPBinding;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
import javax.xml.ws.Holder;
import javax.xml.ws.RequestWrapper;
import javax.xml.ws.ResponseWrapper;
@@ -136,5 +141,20 @@
}
Set<Foo> getFooSet();
+
+ @RequestWrapper(className =
"org.apache.cxf.systest.jaxws.DocLitWrappedCodeFirstService$DoFooListRequest")
+ @WebMethod(operationName = "doFooList")
+ String doFooList(@WebParam(name = "dbRef") List<Foo> fooList);
+
+
+ @XmlAccessorType(XmlAccessType.FIELD)
+ @XmlType(name = "doFooList", propOrder = { "dbReves" })
+ public static class DoFooListRequest {
+ @XmlElement(name = "dbRef", required = true)
+ protected List<Foo> dbReves = new ArrayList<Foo>();
+ public List<Foo> getDbReves() {
+ return dbReves;
+ }
+ }
}
Modified:
cxf/branches/2.1.x-fixes/systests/src/test/java/org/apache/cxf/systest/jaxws/DocLitWrappedCodeFirstServiceImpl.java
URL:
http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/systests/src/test/java/org/apache/cxf/systest/jaxws/DocLitWrappedCodeFirstServiceImpl.java?rev=780919&r1=780918&r2=780919&view=diff
==============================================================================
---
cxf/branches/2.1.x-fixes/systests/src/test/java/org/apache/cxf/systest/jaxws/DocLitWrappedCodeFirstServiceImpl.java
(original)
+++
cxf/branches/2.1.x-fixes/systests/src/test/java/org/apache/cxf/systest/jaxws/DocLitWrappedCodeFirstServiceImpl.java
Tue Jun 2 03:04:31 2009
@@ -209,5 +209,9 @@
public String echoStringNotReallyAsync(String s) {
return s;
}
+
+ public String doFooList(List<Foo> fooList) {
+ return "size: " + fooList.size();
+ }
}