IDEA-116508 ("Local variable or parameter can be final" inspection use generates uncompilable code not extracting a really finalizable variable)

This commit is contained in:
Bas Leijdekkers
2013-11-22 15:25:56 +01:00
parent fd8772d48f
commit 49639e870b
2 changed files with 12 additions and 1 deletions
@@ -1,7 +1,8 @@
class For {
void f(List<String> list) {
for (Iterator<String> it = list.iterator(); it.hasNext();) { // 'it' can be final but not reported
for (Iterator<String> it = list.iterator(); it.hasNext();) {
}
for (int i = 0; i < 10; i++) {}
for (int i = 0, length = 10; i < length; i++) {}
}
}