[ http://issues.apache.org/struts/browse/WW-456?page=comments#action_38769 ] Don Brown commented on WW-456: ------------------------------
I'm sorry, I should have clarified better. The WebWork 2 project has merged with the Struts project to create Struts 2. As part of the merge, we brought over the WebWork JIRA tickets, which included WebWork 1 and WebWork 2 tickets. Since the Struts 2 project is only interested in WebWork 2 tickets, I closed the WebWork 1 tickets. The WebWork 1 project itself is still alive and well at OpenSymphony. This ticket is still open on WebWork 1's OpenSymphony JIRA: http://jira.opensymphony.com/browse/WW-456 > SingleValueMap.entrySet() is broken > ----------------------------------- > > Key: WW-456 > URL: http://issues.apache.org/struts/browse/WW-456 > Project: Struts 2 > Issue Type: Bug > Components: Actions > Affects Versions: WW 1.4, WW 1.3 > Reporter: Attila Szegedi > Fix For: WW 1.4.1 > > > SingleValueMap.entrySet() returns multivalue entries instead of single value > ones. There's a "//TODO: NYI" comment in there... > Here's a patch that makes it right, coded to be similar to how values() is > implemented: > public Set entrySet() > { > Set entries = m.entrySet(); > Set realEntries = new HashSet(entries.size() * 4/3, .75f); > for (Iterator iterator = entries.iterator(); iterator.hasNext();) > { > realEntries.add(new SingleValueEntry((Map.Entry)iterator.next())); > } > return realEntries; > } > > private static class SingleValueEntry implements Map.Entry > { > private final Map.Entry entry; > > SingleValueEntry(Map.Entry entry) > { > this.entry = entry; > } > public Object getKey() > { > return entry.getKey(); > } > > public Object getValue() > { > Object o = entry.getValue(); > return o == null ? null : ((Object[])o)[0]; > } > > public void setValue(Object value) > { > Object o = entry.getValue(); > if(o instanceof Object[]) > { > Object[] ao = (Object[])o; > if(ao.length > 0) > { > ao[0] = value; > return; > } > } > entry.setValue(new Object[] { value }); > } > } -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/struts/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira
