diff options
author | slaws <slaws@13f79535-47bb-0310-9956-ffa450edef68> | 2011-12-13 14:12:38 +0000 |
---|---|---|
committer | slaws <slaws@13f79535-47bb-0310-9956-ffa450edef68> | 2011-12-13 14:12:38 +0000 |
commit | 699653d2ae2df1cec6af2915c90a6a7137a1c077 (patch) | |
tree | 86e5639772629c69a4e9637e682ede48b518b70b /sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/impl/InterfaceContractMapperImpl.java | |
parent | 438fd75ec9cb93740700d9a37c6ea133e1c997ed (diff) |
TUSCANY-3890 - separate the request wrapper model from the response wrapper model as per the change in 1.x under TUSCANY-2931.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1213702 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/impl/InterfaceContractMapperImpl.java')
-rw-r--r-- | sca-java-2.x/trunk/modules/assembly/src/main/java/org/apache/tuscany/sca/interfacedef/impl/InterfaceContractMapperImpl.java | 38 |
1 files changed, 16 insertions, 22 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 7e51e38aaf..d04c8b4d97 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 @@ -245,36 +245,29 @@ public class InterfaceContractMapperImpl implements InterfaceContractMapper { boolean passByValue = (source.getInterface().isRemotable()) && byValue; - // if (source.getInterface().isRemotable()) { - // return true; - // } - // FIXME: We need to deal with wrapped<-->unwrapped conversion - // Check output type 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().getLogical(); - 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().getLogical(); - checkTargetWrapper = false; + + if (source.isInputWrapperStyle() && source.getInputWrapper() != null) { + sourceInputType = source.getInputWrapper().getUnwrappedType().getLogical(); + } + + if (source.isOutputWrapperStyle() && source.getOutputWrapper() != null) { + sourceOutputType = source.getOutputWrapper().getUnwrappedType().getLogical(); } - /* TODO - Why are we assuming compatibility if one side is wrapped and the other is not? - if (checkSourceWrapper != checkTargetWrapper) { - return true; + if (target.isInputWrapperStyle() && target.getInputWrapper() != null) { + targetInputType = target.getInputWrapper().getUnwrappedType().getLogical(); + } + + if (target.isOutputWrapperStyle() && target.getOutputWrapper() != null) { + targetOutputType = target.getOutputWrapper().getUnwrappedType().getLogical(); } - */ if ( sourceOutputType.size() != targetOutputType.size()) { if (audit != null){ @@ -294,7 +287,6 @@ public class InterfaceContractMapperImpl implements InterfaceContractMapper { } } - if (sourceInputType.size() != targetInputType.size()) { if (audit != null){ audit.append("different number of input types"); @@ -348,7 +340,9 @@ public class InterfaceContractMapperImpl implements InterfaceContractMapper { @Override public boolean isCompatibleWithoutUnwrapByValue(Operation source, Operation target, Compatibility compatibilityType) { - if (!source.isWrapperStyle() == target.isWrapperStyle()) { + if (!source.isInputWrapperStyle() == target.isInputWrapperStyle()) { + return false; + } else if (!source.isOutputWrapperStyle() == target.isOutputWrapperStyle()) { return false; } else { return isCompatible(source, target, compatibilityType, true); |