commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 17902] New: - [PATCH] MapUtils - invert mapping and convert ResourceBundle to Map
Date Wed, 12 Mar 2003 00:41:29 GMT
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=17902>.
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=17902

[PATCH] MapUtils - invert mapping and convert ResourceBundle to Map

           Summary: [PATCH] MapUtils - invert mapping and convert
                    ResourceBundle to Map
           Product: Commons
           Version: Nightly Builds
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Enhancement
          Priority: Other
         Component: Collections
        AssignedTo: commons-dev@jakarta.apache.org
        ReportedBy: apacheBugzilla@AMammenT.cotse.net


I've had the need to invert mappings - to be able to use a value stored in the 
map to retrieve the associated key.  I've written a function to create a new 
map containing these inverted mappings (note... this creates a new map, rather 
than backing it with the old map).  The comments on the method have additional 
detail.  

I've also always thought it extremely unfortunate that ResourceBundles don't 
implement the map interface.  As such, I've also written a utility function to 
convert a ResourceBundle into a map.  In future, it might actually make sense 
to have a ResourceBundle subclass which satisfies the Map interface and 
delegates to a nested bundle for particular functions.  

Two patches are attached:
  Patch to MapUtils.java with the mentioned changes
  Patch to TestMapUtils.java with tests for the mentioned changes

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


Mime
View raw message