A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/pmd/pmd/issues/1563 below:

[java] ForLoopCanBeForeach false positive with method call using index variable · Issue #1563 · pmd/pmd · GitHub

Affects PMD Version:
6.10.0

Rule:
ForLoopCanBeForeach

Description:
I have code very similar to the following that's producing a ForLoopCanBeForeach issue, even though I definitely need the index variable.

Code Sample demonstrating the issue:

for (int i = 0; i < mList.size(); i++) {
    mList.get(i).setIndex(i);
}

Running PMD through: [CLI | Ant | Maven | Gradle | Designer | Other]
Gradle


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4