summaryrefslogtreecommitdiffstats
path: root/sca-java-2.x/trunk
diff options
context:
space:
mode:
authorrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2012-09-10 22:14:52 +0000
committerrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2012-09-10 22:14:52 +0000
commit8c883a81853cfacce62af5cdc98d7fd7331d229e (patch)
treec36c76c45317758388d4bc7d94105ac99417b5d2 /sca-java-2.x/trunk
parente4660cb019a85229d47a043581be126f03dfd0f1 (diff)
Fix NPE as the autowire is Boolean and the value can be null. The autoboxing will throw NPE.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1383128 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk')
-rw-r--r--sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/runtime/impl/EndpointReferenceBinderImpl.java9
1 files changed, 5 insertions, 4 deletions
diff --git a/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/runtime/impl/EndpointReferenceBinderImpl.java b/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/runtime/impl/EndpointReferenceBinderImpl.java
index 4ce163f389..5118571e1f 100644
--- a/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/runtime/impl/EndpointReferenceBinderImpl.java
+++ b/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/runtime/impl/EndpointReferenceBinderImpl.java
@@ -495,14 +495,15 @@ public class EndpointReferenceBinderImpl implements EndpointReferenceBinder {
}
// TUSCANY-4069 if no binding specified on reference then use service binding.sca if that exists
- if (endpointReference.getBinding() == null && endpointReference.getReference().getAutowire() == true){
- for (Endpoint endpoint : matchedEndpoints){
- if (endpoint.getBinding() instanceof SCABinding){
+ if (endpointReference.getBinding() == null && Boolean.TRUE.equals(endpointReference.getReference()
+ .getAutowire())) {
+ for (Endpoint endpoint : matchedEndpoints) {
+ if (endpoint.getBinding() instanceof SCABinding) {
matchedEndpoint = endpoint;
break;
}
}
- }
+ }
if (matchedEndpoint == null) {
// just take the first matched endpoint from the list