You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by bu...@apache.org on 2002/01/29 15:23:26 UTC
DO NOT REPLY [Bug 6096] New: -
PropertyMessageResources uses HashMap instead of Set
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=6096>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND
INSERTED IN THE BUG DATABASE.
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=6096
PropertyMessageResources uses HashMap instead of Set
Summary: PropertyMessageResources uses HashMap instead of Set
Product: Struts
Version: Nightly Build
Platform: All
OS/Version: Other
Status: NEW
Severity: Normal
Priority: Other
Component: Utilities
AssignedTo: struts-dev@jakarta.apache.org
ReportedBy: wayfarer3134@yahoo.com
In general, one should use the appropriate data structure, and declare variables
to be of the interface type rather than using the concrete implementations. I
have updated the PropertyMessageResources.java to use Set and Map instead of
HashMap for each of those. This is somewhat more efficient, but is really just
cleanup. Note that there are some comment lines that didn't diff correctly,
there are no actual changes in those lines. The diff file follows:
80c80
< * <strong>IMPLEMENTATION NOTE</strong> - This class trades memory for
---
> * <strong>IMPLEMENTATION NOTE</strong> - This class trades memory for
135c135
< protected Set locales = new HashSet();
---
> protected HashMap locales = new HashMap();
142c142
< protected Map messages = new HashMap();
---
> protected HashMap messages = new HashMap();
155c155
< * This method must be implemented by a concrete subclass.
---
> * This method must be implemented by a concrete subclass.
158c158
< * for the system default Locale
---
> * for the system default Locale
252c252
< if (locales.contains(localeKey))
---
> if (locales.get(localeKey) != null)
254c254
< locales.add(localeKey);
---
> locales.put(localeKey, localeKey);
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>