summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbdaniel <bdaniel@13f79535-47bb-0310-9956-ffa450edef68>2011-06-17 21:27:59 +0000
committerbdaniel <bdaniel@13f79535-47bb-0310-9956-ffa450edef68>2011-06-17 21:27:59 +0000
commit7a1fb15ee8302de48aa989085d2211593ba22406 (patch)
treead867678d8d14dbdcde60508f8cc429a10df2f34
parent46639afca6c568f624c1ca4ae6886b4ae914cc95 (diff)
Correctly remove policies from endpoints and endpoint references when there are multiple endpoints
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1137040 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--sca-java-2.x/trunk/modules/builder/src/main/java/org/apache/tuscany/sca/builder/impl/PolicyAppliesToBuilderImpl.java16
1 files changed, 8 insertions, 8 deletions
diff --git a/sca-java-2.x/trunk/modules/builder/src/main/java/org/apache/tuscany/sca/builder/impl/PolicyAppliesToBuilderImpl.java b/sca-java-2.x/trunk/modules/builder/src/main/java/org/apache/tuscany/sca/builder/impl/PolicyAppliesToBuilderImpl.java
index c4dd9b4182..64fcc2bc77 100644
--- a/sca-java-2.x/trunk/modules/builder/src/main/java/org/apache/tuscany/sca/builder/impl/PolicyAppliesToBuilderImpl.java
+++ b/sca-java-2.x/trunk/modules/builder/src/main/java/org/apache/tuscany/sca/builder/impl/PolicyAppliesToBuilderImpl.java
@@ -101,23 +101,23 @@ public class PolicyAppliesToBuilderImpl extends PolicyAttachmentBuilderImpl {
for (Component component : topComposite.getComponents()) {
for (ComponentService componentService : component.getServices()) {
- for (Endpoint ep : componentService.getEndpoints()) {
- List<PolicySet> policySetsToRemove = checkAppliesToSubject(document, appliesToSubjects, topComposite, (PolicySubject)ep.getService(), ep.getService().getPolicySets());
+ List<PolicySet> policySetsToRemove = checkAppliesToSubject(document, appliesToSubjects, topComposite, componentService, componentService.getPolicySets());
+ for (Endpoint ep : componentService.getEndpoints()) {
ep.getPolicySets().removeAll(policySetsToRemove);
if (ep.getBinding() instanceof PolicySubject) {
- policySetsToRemove = checkAppliesToSubject(document, appliesToSubjects, topComposite, (PolicySubject)ep.getBinding(), ((PolicySubject)ep.getBinding()).getPolicySets());
- ep.getPolicySets().removeAll(policySetsToRemove);
+ List<PolicySet> bindingPolicySetsToRemove = checkAppliesToSubject(document, appliesToSubjects, topComposite, (PolicySubject)ep.getBinding(), ((PolicySubject)ep.getBinding()).getPolicySets());
+ ep.getPolicySets().removeAll(bindingPolicySetsToRemove);
}
}
}
for (ComponentReference componentReference : component.getReferences()) {
- for (EndpointReference epr : componentReference.getEndpointReferences()) {
- List<PolicySet> policySetsToRemove = checkAppliesToSubject(document, appliesToSubjects, topComposite, (PolicySubject)epr.getReference(), epr.getReference().getPolicySets());
+ List<PolicySet> policySetsToRemove = checkAppliesToSubject(document, appliesToSubjects, topComposite, componentReference, componentReference.getPolicySets());
+ for (EndpointReference epr : componentReference.getEndpointReferences()) {
epr.getPolicySets().removeAll(policySetsToRemove);
if (epr.getBinding() instanceof PolicySubject) {
- policySetsToRemove = checkAppliesToSubject(document, appliesToSubjects, topComposite, (PolicySubject)epr.getBinding(), ((PolicySubject)epr.getBinding()).getPolicySets());
- epr.getPolicySets().removeAll(policySetsToRemove);
+ List<PolicySet> bindingPolicySetsToRemove = checkAppliesToSubject(document, appliesToSubjects, topComposite, (PolicySubject)epr.getBinding(), ((PolicySubject)epr.getBinding()).getPolicySets());
+ epr.getPolicySets().removeAll(bindingPolicySetsToRemove);
}
}
}