[
https://issues.apache.org/jira/browse/FLINK-10189?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16587608#comment-16587608
]
ASF GitHub Bot commented on FLINK-10189:
----------------------------------------
yanghua commented on issue #6596: [FLINK-10189] Fix FindBugs warnings:
Inefficient use of keySet iterat…
URL: https://github.com/apache/flink/pull/6596#issuecomment-414721125
@hiroakiy Thanks for your contribution. The change looks good to me. I just
give a suggestion : change the PR's description like other PRs (Flink has its
PR template) to give more details (such as test coverage).
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
> FindBugs warnings: Inefficient use of keySet iterator instead of entrySet
> iterator
> ----------------------------------------------------------------------------------
>
> Key: FLINK-10189
> URL: https://issues.apache.org/jira/browse/FLINK-10189
> Project: Flink
> Issue Type: Bug
> Reporter: Hiroaki Yoshida
> Priority: Major
> Labels: pull-request-available
>
> FindBugs-3.0.1 ([http://findbugs.sourceforge.net/]) reported two
> WMI_WRONG_MAP_ITERATOR warnings on master:
> {code:java}
> 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]
> {code}
> The description of the bug is as follows:
> {quote}*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]
> {quote}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)