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
This commit is contained in:
parent
e4660cb019
commit
8c883a8185
1 changed files with 5 additions and 4 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue