javaserverfaces
  1. javaserverfaces
  2. JAVASERVERFACES-115

API performance: use entrySet, rather than keySet, iterator

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.1
    • Fix Version/s: 1.0
    • Component/s: None
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: All

    • Issuezilla Id:
      115

      Description

      It is more efficient to use an iterator on the entrySet of the map in the following cases, to avoid the
      Map.get(key) lookup.

      Method
      javax.faces.component.UIComponentBase.restoreState(javax.faces.context.FacesContext,Object) makes
      inefficient use of keySet iterator instead of entrySet iterator
      At UIComponentBase.java:[line 1163]

      Method javax.faces.component.UIComponentBase$AttributesMap.putAll(java.util.Map) makes inefficient
      use of keySet iterator instead of entrySet iterator
      At UIComponentBase.java:[line 1470]

      Method javax.faces.component.UIComponentBase$FacetsMap.putAll(java.util.Map) makes inefficient use
      of keySet iterator instead of entrySet iterator
      At UIComponentBase.java:[line 1809]

      Method javax.faces.model.ResultSetDataModel$ResultSetMap.containsValue(Object) makes inefficient
      use of keySet iterator instead of entrySet iterator
      At ResultSetDataModel.java:[line 361]

      Method javax.faces.model.ResultSetDataModel$ResultSetMap.putAll(java.util.Map) makes inefficient use
      of keySet iterator instead of entrySet iterator
      At ResultSetDataModel.java:[line 423]

        Activity

        Hide
        Ryan Lubke added a comment -

        Updated the listed cases to use the Map.Entry from entrySet() vs keySet() and
        get() lookups.

        Show
        Ryan Lubke added a comment - Updated the listed cases to use the Map.Entry from entrySet() vs keySet() and get() lookups.
        Hide
        Manfred Riem added a comment -

        Closing issue out

        Show
        Manfred Riem added a comment - Closing issue out

          People

          • Assignee:
            javaserverfowner
            Reporter:
            rajprem
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: