cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Aki Yoshida (JIRA)" <j...@apache.org>
Subject [jira] [Created] (CXF-3548) EndPointImpl's hasCode value should not change when its mutable properties are changed
Date Wed, 25 May 2011 09:15:49 GMT
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

Mime
View raw message