spring-projects/spring-framework — pull request #672 by RyuSangGi (2014-10-23 05:18:58+00:00)
Title: Spr 12363

It is more efficient to use an iterator on the entrySet of the map, to avoid the Map.get(key) lookup.
Test is ModelMapTests.java
@Test
public void testMergeMapWithOverriding() throws Exception {
Map beans = new HashMap();
beans.put("one", new TestBean("one"));
beans.put("two", new TestBean("two"));
beans.put("three", new TestBean("three"));
ModelMap model = new ModelMap();
model.put("one", new TestBean("oneOld"));
model.mergeAttributes(beans);
assertEquals(3, model.size());
assertEquals("oneOld", ((TestBean) model.get("one")).getName());
}