cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ashaki...@apache.org
Subject [1/2] git commit: [CXF-5571] Policy Alternative compatibility checking rely on not overriden equals() method
Date Thu, 20 Feb 2014 13:13:20 GMT
Repository: cxf
Updated Branches:
  refs/heads/master 2be064961 -> b77bbdc44


[CXF-5571] Policy Alternative compatibility checking rely on not overriden equals() method


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/4aefaea4
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/4aefaea4
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/4aefaea4

Branch: refs/heads/master
Commit: 4aefaea4125a4964b2a51ac568798e4be75915eb
Parents: 4554703
Author: Andrei Shakirin <andrei.shakirin@gmail.com>
Authored: Thu Feb 20 12:53:37 2014 +0100
Committer: Andrei Shakirin <andrei.shakirin@gmail.com>
Committed: Thu Feb 20 12:53:37 2014 +0100

----------------------------------------------------------------------
 .../ws/policy/selector/BaseAlternativeSelector.java   | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/4aefaea4/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/selector/BaseAlternativeSelector.java
----------------------------------------------------------------------
diff --git a/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/selector/BaseAlternativeSelector.java
b/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/selector/BaseAlternativeSelector.java
index c3dc6d0..40e51a0 100644
--- a/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/selector/BaseAlternativeSelector.java
+++ b/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/selector/BaseAlternativeSelector.java
@@ -23,6 +23,8 @@ package org.apache.cxf.ws.policy.selector;
 import java.util.ArrayList;
 import java.util.List;
 
+import javax.xml.namespace.QName;
+
 import org.apache.cxf.ws.policy.AlternativeSelector;
 import org.apache.neethi.Assertion;
 
@@ -46,12 +48,14 @@ public abstract class BaseAlternativeSelector implements AlternativeSelector
{
     }
 
     protected boolean isCompatible(List<Assertion> alternative, List<Assertion>
r) {
-        List<Assertion> r2 = new ArrayList<Assertion>(r);
+        // Workaround until Neethi assertions do not override equals()
+        List<QName> rNames = new ArrayList<QName>(r.size());
+        for (Assertion ra : r) {
+            rNames.add(ra.getName());
+        }
         for (Assertion a : alternative) {
-            r2.remove(a);
+            rNames.remove(a.getName());
         }
-        return r2.isEmpty();
+        return rNames.isEmpty();
     }
-    
-    
 }


Mime
View raw message