ws-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sa...@apache.org
Subject svn commit: r355960 - in /webservices/commons/trunk/policy/src/org/apache/ws/policy/model: AndCompositeAssertion.java Policy.java XorCompositeAssertion.java
Date Sun, 11 Dec 2005 13:36:44 GMT
Author: sanka
Date: Sun Dec 11 05:36:31 2005
New Revision: 355960

URL: http://svn.apache.org/viewcvs?rev=355960&view=rev
Log:
Fixed: wsp:Optional attribute does not get resolved when normalize(..) is called

Modified:
    webservices/commons/trunk/policy/src/org/apache/ws/policy/model/AndCompositeAssertion.java
    webservices/commons/trunk/policy/src/org/apache/ws/policy/model/Policy.java
    webservices/commons/trunk/policy/src/org/apache/ws/policy/model/XorCompositeAssertion.java

Modified: webservices/commons/trunk/policy/src/org/apache/ws/policy/model/AndCompositeAssertion.java
URL: http://svn.apache.org/viewcvs/webservices/commons/trunk/policy/src/org/apache/ws/policy/model/AndCompositeAssertion.java?rev=355960&r1=355959&r2=355960&view=diff
==============================================================================
--- webservices/commons/trunk/policy/src/org/apache/ws/policy/model/AndCompositeAssertion.java
(original)
+++ webservices/commons/trunk/policy/src/org/apache/ws/policy/model/AndCompositeAssertion.java
Sun Dec 11 05:36:31 2005
@@ -266,13 +266,13 @@
                     return anXorTerm;
                 }
                 xorTerms.add(term);
-                break;
+                continue;
 
             }
             
             if (term instanceof AndCompositeAssertion) {
                 AND.addTerms(((AndCompositeAssertion) term).getTerms());
-                break;
+                continue;
             }
             
             AND.addTerm(term);
@@ -322,11 +322,17 @@
             CompositeAssertion XORterm = (CompositeAssertion) xorTerms.get(0);
             XOR.addTerms(XORterm.getTerms());
         }
+        
+        if (XOR.isEmpty()) {
+        	AND.setNormalized(true);
+        	return AND;
+        }
 
         if (AND.isEmpty()) {
             XOR.setNormalized(true);
             return XOR;
         }
+        
 
         List primTerms = AND.getTerms();
         Iterator interator = XOR.getTerms().iterator();

Modified: webservices/commons/trunk/policy/src/org/apache/ws/policy/model/Policy.java
URL: http://svn.apache.org/viewcvs/webservices/commons/trunk/policy/src/org/apache/ws/policy/model/Policy.java?rev=355960&r1=355959&r2=355960&view=diff
==============================================================================
--- webservices/commons/trunk/policy/src/org/apache/ws/policy/model/Policy.java (original)
+++ webservices/commons/trunk/policy/src/org/apache/ws/policy/model/Policy.java Sun Dec 11
05:36:31 2005
@@ -93,16 +93,18 @@
         ArrayList childXorTermList = new ArrayList();
 
         Iterator terms = getTerms().iterator();
+        Assertion term;
 
         while (terms.hasNext()) {
-            Assertion term = (Assertion) terms.next();
-            term = (term instanceof Policy) ? term.normalize(reg) : term;
+
+            term = (Assertion) terms.next();
+            term = (term instanceof Policy) ? term : term.normalize(reg);
             
             if (term instanceof Policy) {
                 Assertion wrapper = new AndCompositeAssertion();
                 ((AndCompositeAssertion) wrapper).addTerms(((Policy) term).getTerms());
                 term = wrapper.normalize(reg);                    
-                break;
+                continue;
             }
             if (term instanceof XorCompositeAssertion) {
                 if (((XorCompositeAssertion) term).isEmpty()) {
@@ -116,7 +118,7 @@
                 }
                 
                 childXorTermList.add(term);
-                break;
+                continue;
             }
             
             if (term instanceof AndCompositeAssertion) {
@@ -128,7 +130,7 @@
                 } else {
                     AND.addTerms(((AndCompositeAssertion) term).getTerms());
                 }
-                break;
+                continue;
             }
             AND.addTerm((Assertion) term);
         }

Modified: webservices/commons/trunk/policy/src/org/apache/ws/policy/model/XorCompositeAssertion.java
URL: http://svn.apache.org/viewcvs/webservices/commons/trunk/policy/src/org/apache/ws/policy/model/XorCompositeAssertion.java?rev=355960&r1=355959&r2=355960&view=diff
==============================================================================
--- webservices/commons/trunk/policy/src/org/apache/ws/policy/model/XorCompositeAssertion.java
(original)
+++ webservices/commons/trunk/policy/src/org/apache/ws/policy/model/XorCompositeAssertion.java
Sun Dec 11 05:36:31 2005
@@ -73,19 +73,19 @@
                 } else {
                     XOR.addTerms(((XorCompositeAssertion) wrapper).getTerms());
                 }
-                break;
+                continue;
             }
 
             if (term instanceof PrimitiveAssertion) {
                 AndCompositeAssertion wrapper = new AndCompositeAssertion();
                 wrapper.addTerm(term);
                 XOR.addTerm(wrapper);
-                break;
+                continue;
             }
 
             if (term instanceof XorCompositeAssertion) {
                 XOR.addTerms(((XorCompositeAssertion) term).getTerms());
-                break;
+                continue;
             }
 
             if (term instanceof AndCompositeAssertion) {



Mime
View raw message