Fix NPE as the autowire is Boolean and the value can be null. The autoboxing will throw NPE.

git-svn-id: https://svn.apache.org/repos/asf/tuscany/sca-java-2.x/trunk@1383128 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/modules/core/src/main/java/org/apache/tuscany/sca/core/runtime/impl/EndpointReferenceBinderImpl.java b/modules/core/src/main/java/org/apache/tuscany/sca/core/runtime/impl/EndpointReferenceBinderImpl.java
index 4ce163f..5118571 100644
--- a/modules/core/src/main/java/org/apache/tuscany/sca/core/runtime/impl/EndpointReferenceBinderImpl.java
+++ b/modules/core/src/main/java/org/apache/tuscany/sca/core/runtime/impl/EndpointReferenceBinderImpl.java
@@ -495,14 +495,15 @@
             } 
             
             // 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