Author: lresende
Date: Fri Feb 26 21:25:33 2010
New Revision: 916821

URL: http://svn.apache.org/viewvc?rev=916821&view=rev
Log:
TUSCANY-3463 - Removing the policySet that is being flatted to avoid issues 
during resolution

Modified:
    
tuscany/sca-java-2.x/trunk/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/definitions/xml/DefinitionsProcessor.java

Modified: 
tuscany/sca-java-2.x/trunk/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/definitions/xml/DefinitionsProcessor.java
URL: 
http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/definitions/xml/DefinitionsProcessor.java?rev=916821&r1=916820&r2=916821&view=diff
==============================================================================
--- 
tuscany/sca-java-2.x/trunk/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/definitions/xml/DefinitionsProcessor.java
 (original)
+++ 
tuscany/sca-java-2.x/trunk/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/definitions/xml/DefinitionsProcessor.java
 Fri Feb 26 21:25:33 2010
@@ -250,12 +250,15 @@
         // Flat intentMap structure by creating a policySet for each one
         List<PolicySet> copy = new 
ArrayList<PolicySet>(scaDefns.getPolicySets());
         for (PolicySet policySet : copy) {
-            //[LRESENDE] Do we need to remove the current policySet and just 
include the flat one based on qualifiers ?
-            //Maybe not, as this would resolve to explicitly attached 
policySet 
+            //[lresende] Do we need to remove the current policySet and just 
include the flat one based on qualifiers ?
+            //If we don't, the policy is being resolved to the one that has 
intentMap and no direct concrete policies 
+            boolean remove = false;
             
             //process intent maps
             for(IntentMap intentMap : policySet.getIntentMaps()) {
                 for(Qualifier qualifier : intentMap.getQualifiers()) {
+                    remove = true;
+                    
                     PolicySet qualifiedPolicySet = 
policyFactory.createPolicySet();
                     qualifiedPolicySet.setAppliesTo(policySet.getAppliesTo());
                     
qualifiedPolicySet.setAppliesToXPathExpression(policySet.getAttachToXPathExpression());
@@ -271,6 +274,10 @@
                     scaDefns.getPolicySets().add(qualifiedPolicySet);
                 }
             }
+            
+            if(remove) {
+                scaDefns.getPolicySets().remove(policySet);
+            }
         }
     }
 


Reply via email to