EndPointImpl's hasCode value should not change when its mutable properties are 
changed
--------------------------------------------------------------------------------------

                 Key: CXF-3548
                 URL: https://issues.apache.org/jira/browse/CXF-3548
             Project: CXF
          Issue Type: Bug
          Components: Core
    Affects Versions: 2.3.4, 2.4
            Reporter: Aki Yoshida
            Assignee: Aki Yoshida
             Fix For: 2.4.1, 2.3.5


The current implementation of hashCode() simply calls HashMap's hashCode(). 
Consequently, the hashCode changes whenever some changes occur in this property 
table. The endpoint's hashCode should be calculated on the immutable part to 
avoid confusion as the following abnormality can be observed:

Endpoint ep = ...
map = new HashMap<...>();
map.put(ep, "A");
assertNotNull(map.get(ep)); // okay
ep.put(USING_ADDRESSING, b);
assertEquals(ep, map.keySet().iterator().next()); // okay
assertNotNull(map.get(ep)); // error

This issue was discussed in dev@cxf:
http://cxf.547215.n5.nabble.com/org-apache-cxf-endpoint-EndpointImpl-may-not-be-used-as-a-hash-map-key-td4393354.html




--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to