From fe46ff50ea80c96adc552d3dda232834a20f159f Mon Sep 17 00:00:00 2001 From: antelder Date: Mon, 8 Jun 2009 21:39:43 +0000 Subject: Fix NPEs in RuntimeWireImpl2 when implementation.web in one node is wired to a service in another node git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@782798 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/tuscany/sca/core/assembly/impl/RuntimeWireImpl2.java | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'java') diff --git a/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/impl/RuntimeWireImpl2.java b/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/impl/RuntimeWireImpl2.java index 3911d6dd49..ab03645182 100644 --- a/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/impl/RuntimeWireImpl2.java +++ b/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/assembly/impl/RuntimeWireImpl2.java @@ -315,6 +315,9 @@ public class RuntimeWireImpl2 implements RuntimeWire { private InterfaceContract getInterfaceContract(ComponentReference reference, Binding binding) { InterfaceContract interfaceContract = reference.getInterfaceContract(); + if (interfaceContract == null) { + interfaceContract = endpoint.getInterfaceContract(); + } ReferenceBindingProvider provider = ((RuntimeComponentReference)reference).getBindingProvider(binding); if (provider != null) { InterfaceContract bindingContract = provider.getBindingInterfaceContract(); @@ -419,6 +422,8 @@ public class RuntimeWireImpl2 implements RuntimeWire { public EndpointReference getTarget() { // TODO - EPR convert this into method that returns Endpoint2 + Endpoint2 endpoint = this.endpoint != null ? this.endpoint : endpointReference.getTargetEndpoint(); + // convert the target info into old endpoint reference format EndpointReference epr = new EndpointReferenceImpl((RuntimeComponent)endpoint.getComponent(), endpoint.getService(), -- cgit v1.2.3