diff options
author | bdaniel <bdaniel@13f79535-47bb-0310-9956-ffa450edef68> | 2010-11-14 22:34:32 +0000 |
---|---|---|
committer | bdaniel <bdaniel@13f79535-47bb-0310-9956-ffa450edef68> | 2010-11-14 22:34:32 +0000 |
commit | da521c2a4e5904efcec4c702d4c90e18e0e8745d (patch) | |
tree | 236e29656cc292ac8757347232bc99dd447c68aa /sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/impl/InterfaceContractMapperImpl.java | |
parent | ebc9f8e8938b56b0564ca447fef38ba42db689dd (diff) |
TUSCANY-3664 Add support for multiple operation output types
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1035091 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to '')
-rw-r--r-- | sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/impl/InterfaceContractMapperImpl.java | 35 |
1 files changed, 25 insertions, 10 deletions
diff --git a/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/impl/InterfaceContractMapperImpl.java b/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/impl/InterfaceContractMapperImpl.java index 3dedb5e62c..c28694c930 100644 --- a/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/impl/InterfaceContractMapperImpl.java +++ b/sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/impl/InterfaceContractMapperImpl.java @@ -19,6 +19,7 @@ package org.apache.tuscany.sca.interfacedef.impl; +import java.util.ArrayList; import java.util.List; import javax.xml.namespace.QName; @@ -252,21 +253,23 @@ public class InterfaceContractMapperImpl implements InterfaceContractMapper { // FIXME: We need to deal with wrapped<-->unwrapped conversion // Check output type - DataType<?> sourceOutputType = source.getOutputType(); - DataType<?> targetOutputType = target.getOutputType(); + List<DataType> sourceOutputType = source.getOutputType().getLogical(); + List<DataType> targetOutputType = target.getOutputType().getLogical(); boolean checkSourceWrapper = true; List<DataType> sourceInputType = source.getInputType().getLogical(); if (source.isWrapperStyle() && source.getWrapper() != null) { sourceInputType = source.getWrapper().getUnwrappedInputType().getLogical(); - sourceOutputType = source.getWrapper().getUnwrappedOutputType(); + sourceOutputType = new ArrayList<DataType>(); + sourceOutputType.add(source.getWrapper().getUnwrappedOutputType()); checkSourceWrapper = false; } boolean checkTargetWrapper = true; List<DataType> targetInputType = target.getInputType().getLogical(); if (target.isWrapperStyle() && target.getWrapper() != null) { targetInputType = target.getWrapper().getUnwrappedInputType().getLogical(); - targetOutputType = target.getWrapper().getUnwrappedOutputType(); + targetOutputType = new ArrayList<DataType>(); + targetOutputType.add(target.getWrapper().getUnwrappedOutputType()); checkTargetWrapper = false; } @@ -276,13 +279,25 @@ public class InterfaceContractMapperImpl implements InterfaceContractMapper { } */ - if (!isCompatible(targetOutputType, sourceOutputType, passByValue, audit)) { - if (audit != null){ - audit.append(" output types"); - audit.appendSeperator(); - } - return false; + + if ( sourceOutputType.size() != targetOutputType.size()) { + if (audit != null){ + audit.append("different number of output types"); + audit.appendSeperator(); + } + return false; + } + + for ( int i=0; i < sourceOutputType.size(); i++) { + if (!isCompatible(targetOutputType.get(i), sourceOutputType.get(i), passByValue, audit)) { + if (audit != null){ + audit.append(" output types"); + audit.appendSeperator(); + } + return false; + } } + if (sourceInputType.size() != targetInputType.size()) { if (audit != null){ |