cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r1090405 - in /cxf/trunk: api/src/main/java/org/apache/cxf/ws/policy/AssertionInfoMap.java rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/EndpointPolicyImpl.java
Date Fri, 08 Apr 2011 19:13:22 GMT
Author: dkulp
Date: Fri Apr  8 19:13:22 2011
New Revision: 1090405

URL: http://svn.apache.org/viewvc?rev=1090405&view=rev
Log:
Make sure policy assertions are only added to the vocabulary and
assertioninfomap once to keep the maps smaller.

Modified:
    cxf/trunk/api/src/main/java/org/apache/cxf/ws/policy/AssertionInfoMap.java
    cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/EndpointPolicyImpl.java

Modified: cxf/trunk/api/src/main/java/org/apache/cxf/ws/policy/AssertionInfoMap.java
URL: http://svn.apache.org/viewvc/cxf/trunk/api/src/main/java/org/apache/cxf/ws/policy/AssertionInfoMap.java?rev=1090405&r1=1090404&r2=1090405&view=diff
==============================================================================
--- cxf/trunk/api/src/main/java/org/apache/cxf/ws/policy/AssertionInfoMap.java (original)
+++ cxf/trunk/api/src/main/java/org/apache/cxf/ws/policy/AssertionInfoMap.java Fri Apr  8
19:13:22 2011
@@ -72,6 +72,11 @@ public class AssertionInfoMap extends Ha
             ail = new ArrayList<AssertionInfo>();
             put(a.getName(), ail);
         }
+        for (AssertionInfo ai2 : ail) {
+            if (ai2.getAssertion() == a) {
+                return;
+            }
+        }
         ail.add(ai);
     }
     

Modified: cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/EndpointPolicyImpl.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/EndpointPolicyImpl.java?rev=1090405&r1=1090404&r2=1090405&view=diff
==============================================================================
--- cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/EndpointPolicyImpl.java
(original)
+++ cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/EndpointPolicyImpl.java
Fri Apr  8 19:13:22 2011
@@ -182,6 +182,14 @@ public class EndpointPolicyImpl implemen
         return alternatives;
     }
     
+    private void addAll(Collection<Assertion> target, Collection<Assertion> l1)
{
+        for (Assertion l : l1) {
+            if (!target.contains(l)) {
+                target.add(l);
+            }
+        }
+    }
+    
     void initializeVocabulary() {
         vocabulary = new ArrayList<Assertion>();
         if (requestor) {
@@ -213,9 +221,9 @@ public class EndpointPolicyImpl implemen
             }
             Collection<Assertion> c = engine.getAssertions(p, false);
             if (c != null) {
-                vocabulary.addAll(c);
+                addAll(vocabulary, c);
                 if (null != faultVocabulary) {
-                    faultVocabulary.addAll(c);
+                    addAll(faultVocabulary, c);
                 }
             }
             if (this.requestor) {
@@ -226,9 +234,9 @@ public class EndpointPolicyImpl implemen
             }
             c = engine.getAssertions(p, false);
             if (c != null) {
-                vocabulary.addAll(c);
+                addAll(vocabulary, c);
                 if (null != faultVocabulary) {
-                    faultVocabulary.addAll(c);
+                    addAll(faultVocabulary, c);
                 }
             }
             if (boi.getFaults() != null) {
@@ -241,9 +249,9 @@ public class EndpointPolicyImpl implemen
                     }
                     c = engine.getAssertions(p, false);
                     if (c != null) {
-                        vocabulary.addAll(c);
+                        addAll(vocabulary, c);
                         if (null != faultVocabulary) {
-                            faultVocabulary.addAll(c);
+                            addAll(faultVocabulary, c);
                         }
                     }
                 }



Mime
View raw message