mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-26 03:13:40 +07:00
isEffectivelyFinal: disallow effectively final variables to be initialized twice (IDEA-165060)
This commit is contained in:
+20
@@ -0,0 +1,20 @@
|
||||
// "Replace with collect" "false"
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
class Main {
|
||||
public List<Integer> test(boolean b, List<String> list) {
|
||||
int s;
|
||||
if(b) {
|
||||
s = 1;
|
||||
}
|
||||
List<Integer> result = new ArrayList<>();
|
||||
for(String str : li<caret>st) {
|
||||
if(str != null) {
|
||||
result.add(s++);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user