commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vladimir Orlov (JIRA)" <j...@apache.org>
Subject [jira] Created: (BEANUTILS-326) Iterating by key/value pairs in Map in BeanUtilsBean.populate(...) method
Date Thu, 14 Aug 2008 10:21:44 GMT
Iterating by key/value pairs in Map in BeanUtilsBean.populate(...) method
-------------------------------------------------------------------------

                 Key: BEANUTILS-326
                 URL: https://issues.apache.org/jira/browse/BEANUTILS-326
             Project: Commons BeanUtils
          Issue Type: Improvement
          Components: Bean / Property Utils
    Affects Versions: 1.7.0
            Reporter: Vladimir Orlov
            Priority: Minor


I think that iterating by key/value pairs in Map should be done in more appropriate way than
it is done currently: it takes set of keys, iterates by it and on each iteration cycle searchches
for the value via Map.get(<key>) API. Consequently it does the search by key in map
on every step and it should make the processign slower.

An alternative to such approach is to use Map.entrySet() API which returns the Set of key/value
pairs (as instances of Map.Entry class). Using it eliminates the need to do a search by key
(Map.get(...) API) in the map on each step of iteration and should work faster.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message