You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by bu...@apache.org on 2005/07/06 16:44:57 UTC

DO NOT REPLY [Bug 35631] New: - Missing putAll(Map map) in MultiHashMap since 3.1

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=35631>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=35631

           Summary: Missing putAll(Map map) in MultiHashMap since 3.1
           Product: Commons
           Version: 3.1
          Platform: PC
        OS/Version: Windows 2000
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Collections
        AssignedTo: commons-dev@jakarta.apache.org
        ReportedBy: sven.macke@rewe.de


I just upgraded to version 3.1 and noticed some errors in my application. The 
cause is the method putAll(Map map) I used to call on a MultiHashMap to copy to 
content of one to another. That method is not defined in MultiHashMap any more, 
so HashMap.putAll(Map map) is used. The result of that is a MultiHashMap that 
contains ONE value per key and the value itself is a Collection.

Here is some test code I would expect to work, but it fails:

public class MultiHashMapTest extends TestCase
{
    public void testIt()
    {
        MultiMap original = new MultiHashMap();
        original.put("key", "object1");
        original.put("key", "object2");

        MultiMap copy = new MultiHashMap();
        copy.putAll(original);

        assertEquals(original.values().size(), copy.values().size());
        assertTrue(copy.containsValue("object1"));
        assertTrue(copy.containsValue("object2"));
    }
}

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org