There should not be an SCABinding created under reference if there is no target 
on the reference 558780
-------------------------------------------------------------------------------------------------------

                 Key: TUSCANY-1636
                 URL: https://issues.apache.org/jira/browse/TUSCANY-1636
             Project: Tuscany
          Issue Type: Bug
          Components: Java SCA Assembly Model
            Reporter: Yang Lei


In CompositeBuilderImpl, we create defeault SCABinding where there is no 
binding defined under reference. This will break the SCABinding handling if the 
reference does not have a target, then SCABinding willl still get executed so 
either there is a NPE as we are not expecting target is not there, or there is 
a null object set to the reference, which will override existing reference 
value in the component. 

I did the following to remove the SCABinding at the end of the 
CompositeBuilderImpl.connectComponentReferences, the else block
            if (!targets.isEmpty()) {
                      ....
            }else
            {
                // need to remove the SCABinding we created that did not have 
target
                if (componentReference.getBindings().size()==1)
                {
                    SCABinding binding = 
componentReference.getBinding(SCABinding.class);
                    if (binding!=null && binding.getURI()==null)
                    {
                        componentReference.getBindings().clear();
                    }
                }
            }
        }


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to