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: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to