Uploaded image for project: 'Flink'
  1. Flink
  2. FLINK-10189

FindBugs warnings: Inefficient use of keySet iterator instead of entrySet iterator

    XMLWordPrintableJSON

    Details

      Description

      FindBugs-3.0.1 (http://findbugs.sourceforge.net/) reported two WMI_WRONG_MAP_ITERATOR warnings on master:

      M P WMI: org.apache.flink.runtime.state.ttl.TtlMapState.putAll(Map) makes inefficient use of keySet iterator instead of entrySet iterator  At TtlMapState.java:[line 72]
      M P WMI: org.apache.flink.addons.hbase.HBaseTableSource.projectFields(int[]) makes inefficient use of keySet iterator instead of entrySet iterator  At HBaseTableSource.java:[line 19] 
      

      The description of the bug is as follows:

      WMI: Inefficient use of keySet iterator instead of entrySet iterator (WMI_WRONG_MAP_ITERATOR)
      This method accesses the value of a Map entry, using a key that was retrieved from a keySet iterator. It is more efficient to use an iterator on the entrySet of the map, to avoid the Map.get(key) lookup.
      http://findbugs.sourceforge.net/bugDescriptions.html#WMI_WRONG_MAP_ITERATOR

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                hiroakiyoshida Hiroaki Yoshida
                Reporter:
                hiroakiyoshida Hiroaki Yoshida
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: