cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r1445729 - /cxf/branches/2.6.x-fixes/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/AssertionInfoMap.java
Date Wed, 13 Feb 2013 16:48:38 GMT
Author: dkulp
Date: Wed Feb 13 16:48:38 2013
New Revision: 1445729

URL: http://svn.apache.org/r1445729
Log:
Merged revisions 1445377 via  git cherry-pick from
https://svn.apache.org/repos/asf/cxf/branches/2.7.x-fixes

........
  r1445377 | dkulp | 2013-02-12 16:16:06 -0500 (Tue, 12 Feb 2013) | 10 lines

  Merged revisions 1445283 via  git cherry-pick from
  https://svn.apache.org/repos/asf/cxf/trunk

  ........
    r1445283 | dkulp | 2013-02-12 12:30:13 -0500 (Tue, 12 Feb 2013) | 2 lines

    Assertions that are not found in the map should not be asserted.

  ........

........

Modified:
    cxf/branches/2.6.x-fixes/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/AssertionInfoMap.java

Modified: cxf/branches/2.6.x-fixes/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/AssertionInfoMap.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.6.x-fixes/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/AssertionInfoMap.java?rev=1445729&r1=1445728&r2=1445729&view=diff
==============================================================================
--- cxf/branches/2.6.x-fixes/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/AssertionInfoMap.java
(original)
+++ cxf/branches/2.6.x-fixes/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/AssertionInfoMap.java
Wed Feb 13 16:48:38 2013
@@ -100,13 +100,20 @@ public class AssertionInfoMap extends Ha
         } else if (assertion instanceof Assertion) {
             Assertion ass = (Assertion)assertion;
             Collection<AssertionInfo> ail = getAssertionInfo(ass.getName());
+            boolean found = false;
             for (AssertionInfo ai : ail) {
-                if (ai.getAssertion().equal(ass)
-                    && !ai.isAsserted() && !ass.isOptional()) {
-                    errors.add(ass.getName());
-                    pass = false;                    
+                if (ai.getAssertion().equal(ass)) {
+                    found = true;
+                    if (!ai.isAsserted() && !ass.isOptional()) {
+                        errors.add(ass.getName());
+                        pass = false;                    
+                    }
                 }
             }
+            if (!found) {
+                errors.add(ass.getName());
+                return false;
+            }
         }
         if (assertion instanceof PolicyContainingAssertion) {
             Policy p = ((PolicyContainingAssertion)assertion).getPolicy();
@@ -149,6 +156,7 @@ public class AssertionInfoMap extends Ha
         
         for (QName name : errors) {
             Collection<AssertionInfo> ais = getAssertionInfo(name);
+            boolean found = false;
             for (AssertionInfo ai : ais) {
                 if (!ai.isAsserted()) {
                     String s = name.toString();
@@ -156,8 +164,12 @@ public class AssertionInfoMap extends Ha
                         s += ": " + ai.getErrorMessage();
                     }
                     msgs.add(s);
+                    found = true;
                 }
             }
+            if (!found) {
+                msgs.add(name.toString());
+            }
         }
         StringBuilder error = new StringBuilder();
         for (String msg : msgs) {



Mime
View raw message