Author: dkulp Date: Wed Feb 13 17:09:29 2013 New Revision: 1445749 URL: http://svn.apache.org/r1445749 Log: Merged revisions 1445729 via git cherry-pick from https://svn.apache.org/repos/asf/cxf/branches/2.6.x-fixes
........ r1445729 | dkulp | 2013-02-13 11:48:38 -0500 (Wed, 13 Feb 2013) | 18 lines 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.5.x-fixes/api/src/main/java/org/apache/cxf/ws/policy/AssertionInfoMap.java Modified: cxf/branches/2.5.x-fixes/api/src/main/java/org/apache/cxf/ws/policy/AssertionInfoMap.java URL: http://svn.apache.org/viewvc/cxf/branches/2.5.x-fixes/api/src/main/java/org/apache/cxf/ws/policy/AssertionInfoMap.java?rev=1445749&r1=1445748&r2=1445749&view=diff ============================================================================== --- cxf/branches/2.5.x-fixes/api/src/main/java/org/apache/cxf/ws/policy/AssertionInfoMap.java (original) +++ cxf/branches/2.5.x-fixes/api/src/main/java/org/apache/cxf/ws/policy/AssertionInfoMap.java Wed Feb 13 17:09:29 2013 @@ -99,13 +99,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(); @@ -148,6 +155,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(); @@ -155,8 +163,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) {
