From 1fb59defe41d14db5969726dc9df4c811e715ccc Mon Sep 17 00:00:00 2001 From: bdaniel Date: Wed, 29 Jun 2011 20:16:05 +0000 Subject: Return correct interface contract when interfaces are compatible but not assignable from each other git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1141229 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/tuscany/sca/core/context/impl/ComponentContextImpl.java | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'sca-java-2.x/trunk/modules') diff --git a/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/context/impl/ComponentContextImpl.java b/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/context/impl/ComponentContextImpl.java index dcb2b499e3..fd14c8c03e 100644 --- a/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/context/impl/ComponentContextImpl.java +++ b/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/context/impl/ComponentContextImpl.java @@ -470,6 +470,12 @@ public class ComponentContextImpl implements RuntimeComponentContext { } InterfaceContractMapper ifcm = registry.getExtensionPoint(InterfaceContractMapper.class); compatible = ifcm.isCompatibleSubset(biContract, interfaceContract); + // If the business interface class is not assignable from the service interface class but + // they are compatible, we need to return an InterfaceContract with the business interface + // class to store on the reference side. + if ( compatible ) { + return biContract; + } } } -- cgit v1.2.3