Uploaded image for project: 'Commons BeanUtils'
  1. Commons BeanUtils
  2. BEANUTILS-326

Iterating by key/value pairs in Map in BeanUtilsBean.populate(...) method

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 1.7.0
    • 1.8.0
    • Bean / Property Utils
    • None

    Description

      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.

      Attachments

        Activity

          People

            niallp Niall Pemberton
            vorlov Vladimir Orlov
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: