Fix ASM_5031, wire with @replace=true overrides reference @target attribute

git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@807545 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
antelder 2009-08-25 10:36:00 +00:00
parent 3735ba152a
commit 5fffa71fd0

View file

@ -159,6 +159,9 @@ public class ComponentReferenceWireBuilderImpl extends BaseBuilderImpl implement
.isCompatible(resolvedReference.getInterfaceContract(), resolvedService.getInterfaceContract())) {
//resolvedReference.getTargets().add(resolvedService);
if (wire.isReplace()) {
resolvedReference.getTargets().clear();
}
resolvedReference.getTargets().add(wire.getTarget());
} else {
warning(monitor, "WireIncompatibleInterface", composite, source.getName(), target.getName());