Author: rfeng
Date: Mon Sep 10 22:14:52 2012
New Revision: 1383128
URL: http://svn.apache.org/viewvc?rev=1383128&view=rev
Log:
Fix NPE as the autowire is Boolean and the value can be null. The autoboxing
will throw NPE.
Modified:
tuscany/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/runtime/impl/EndpointReferenceBinderImpl.java
Modified:
tuscany/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/runtime/impl/EndpointReferenceBinderImpl.java
URL:
http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/runtime/impl/EndpointReferenceBinderImpl.java?rev=1383128&r1=1383127&r2=1383128&view=diff
==============================================================================
---
tuscany/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/runtime/impl/EndpointReferenceBinderImpl.java
(original)
+++
tuscany/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/runtime/impl/EndpointReferenceBinderImpl.java
Mon Sep 10 22:14:52 2012
@@ -495,14 +495,15 @@ public class EndpointReferenceBinderImpl
}
// 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