From a99e7c2d1708ba8bb1598c54571dcf540308b03b Mon Sep 17 00:00:00 2001 From: slaws Date: Mon, 15 Aug 2011 16:00:49 +0000 Subject: TUSCANY-3916 - Check for null interface. I need to find out why a null interface is possible but it's causing the build to break so I'll double back to this git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1157897 13f79535-47bb-0310-9956-ffa450edef68 --- .../sca/binding/sca/provider/DefaultSCABindingMapper.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'sca-java-2.x/trunk/modules/binding-sca-runtime/src') diff --git a/sca-java-2.x/trunk/modules/binding-sca-runtime/src/main/java/org/apache/tuscany/sca/binding/sca/provider/DefaultSCABindingMapper.java b/sca-java-2.x/trunk/modules/binding-sca-runtime/src/main/java/org/apache/tuscany/sca/binding/sca/provider/DefaultSCABindingMapper.java index d1af962846..0b16117635 100644 --- a/sca-java-2.x/trunk/modules/binding-sca-runtime/src/main/java/org/apache/tuscany/sca/binding/sca/provider/DefaultSCABindingMapper.java +++ b/sca-java-2.x/trunk/modules/binding-sca-runtime/src/main/java/org/apache/tuscany/sca/binding/sca/provider/DefaultSCABindingMapper.java @@ -41,6 +41,7 @@ import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessor; import org.apache.tuscany.sca.contribution.processor.StAXArtifactProcessorExtensionPoint; import org.apache.tuscany.sca.core.ExtensionPointRegistry; import org.apache.tuscany.sca.extensibility.ServiceDeclarationParser; +import org.apache.tuscany.sca.interfacedef.InterfaceContract; import org.apache.tuscany.sca.policy.PolicySubject; import org.apache.tuscany.sca.provider.ProviderFactory; import org.apache.tuscany.sca.provider.ProviderFactoryExtensionPoint; @@ -263,10 +264,12 @@ public class DefaultSCABindingMapper implements SCABindingMapper { * @return */ protected QName chooseBinding(RuntimeEndpoint endpoint) { - if(endpoint.getService().getInterfaceContract() != null - && ((RuntimeComponentService)endpoint.getService()).getInterfaceContract().getInterface().isRemotable() - && supportsDistributedSCA - && isBindingSupported(defaultMappedBinding)) { + InterfaceContract interfaceContract = endpoint.getService().getInterfaceContract(); + if(interfaceContract != null + && interfaceContract.getInterface() != null + && interfaceContract.getInterface().isRemotable() + && supportsDistributedSCA + && isBindingSupported(defaultMappedBinding)) { return defaultMappedBinding; } -- cgit v1.2.3