[ https://issues.apache.org/jira/browse/TUSCANY-4066?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13407965#comment-13407965 ]
ant elder commented on TUSCANY-4066: ------------------------------------ This is the fix that Hasan has: Index: src/main/java/org/apache/tuscany/sca/interfacedef/util/WrapperInfo.java =================================================================== --- src/main/java/org/apache/tuscany/sca/interfacedef/util/WrapperInfo.java (revision 1357284) +++ src/main/java/org/apache/tuscany/sca/interfacedef/util/WrapperInfo.java (working copy) @@ -146,6 +146,17 @@ if (wrapperType != null) { copy.wrapperType = (DataType<XMLType>)wrapperType.clone(); } + if (unwrappedType != null) { + List<DataType> clonedLogicalTypes = new ArrayList<DataType>(); + for (DataType t : unwrappedType.getLogical()) { + DataType type = (DataType) t.clone(); + clonedLogicalTypes.add(type); + } + DataType<List<DataType>> clonedUnwrappedType = + new DataTypeImpl<List<DataType>>(unwrappedType.getPhysical(), clonedLogicalTypes); + clonedUnwrappedType.setDataBinding(unwrappedType.getDataBinding()); + copy.unwrappedType = clonedUnwrappedType; + } return copy; } Hasan, would you be able to comment here confirming that is your fix and that I can commit it to Tuscany? > WrapperInfo clone does not copy for unwrappedType datatype > ---------------------------------------------------------- > > Key: TUSCANY-4066 > URL: https://issues.apache.org/jira/browse/TUSCANY-4066 > Project: Tuscany > Issue Type: Bug > Components: Java SCA Assembly Model > Affects Versions: Java-SCA-2.0 > Environment: All > Reporter: Hasan Muhammad > Priority: Minor > Fix For: Java-SCA-2.0 > > > The WapperInfo clone does not do a deep copy of unwrappedType datatype. This > seemed to have regressed after Tuscany-3890. I will be sending in the fix to > Ant. With this bug, one would see a ClassCastException such as the following > java.lang.ClassCastException: org.apache.xerces.dom.ElementNSImpl > incompatible with org.apache.axiom.om.OMElement > at > org.apache.tuscany.sca.databinding.axiom.OMElementWrapperHandler.setChild(OMElementWrapperHandler.java:91) > at > org.apache.tuscany.sca.databinding.axiom.OMElementWrapperHandler.setChildren(OMElementWrapperHandler.java:77) > at > org.apache.tuscany.sca.databinding.axiom.OMElementWrapperHandler.setChildren(OMElementWrapperHandler.java:50) > at > org.apache.tuscany.sca.core.databinding.transformers.Input2InputTransformer.transform(Input2InputTransformer.java:213) > at > org.apache.tuscany.sca.core.databinding.transformers.Input2InputTransformer.transform(Input2InputTransformer.java:46) > at > org.apache.tuscany.sca.databinding.DefaultTransformerExtensionPoint$LazyPullTransformer.transform(DefaultTransformerExtensionPoint.java:209) > at > org.apache.tuscany.sca.databinding.impl.MediatorImpl.mediate(MediatorImpl.java:116) > at > org.apache.tuscany.sca.databinding.impl.MediatorImpl.mediateInput(MediatorImpl.java:444) > at > org.apache.tuscany.sca.core.databinding.wire.DataTransformationInterceptor.processRequest(DataTransformationInterceptor.java:69) > at > org.apache.tuscany.sca.core.invocation.InterceptorAsyncImpl.invokeAsyncRequest(InterceptorAsyncImpl.java:65) -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira