Andrei Shakirin created CXF-5571:
------------------------------------

             Summary: Policy Alternative compatibility checking rely on not 
overriden equals() method
                 Key: CXF-5571
                 URL: https://issues.apache.org/jira/browse/CXF-5571
             Project: CXF
          Issue Type: Bug
    Affects Versions: 2.7.10, 3.0.0-milestone1
            Reporter: Andrei Shakirin


Use case: SOAP service uses policy containing more than one alternative.
To build outgoing interceptor chain, single alternative in effective policy is 
selected using AlternativeSelector. One of the selection steps is check 
BaseAlternativeSelector.isCompatibleWithRequest() 

Problem:
Method BaseAlternativeSelector.isCompatible doesn't work as designed, 
because Neethi PolicyContainingPrimitiveAssertion and PrimitiveAssertion do not 
override equals() method. As a result alternative is never removed from the 
list r2 if assertions are different objects:
    protected boolean isCompatible(List<Assertion> alternative, List<Assertion> 
r) {
        List<Assertion> r2 = new ArrayList<Assertion>(r);
        for (Assertion a : alternative) {
            r2.remove(a);
        }
        return r2.isEmpty();
    }

Proposal: clean solution will be to fix that in Neethi and provide equals 
method. Quick fix will be check of assertion QName.



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

Reply via email to