mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-07 13:39:36 +07:00
isEffectivelyFinal: disallow effectively final variables to be initialized twice (IDEA-165060)
This commit is contained in:
@@ -175,4 +175,16 @@ class AssignmentToFinalInsideLambda {
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
class NonInitializedButWrittenTwice {
|
||||
private void test(boolean b) {
|
||||
int s;
|
||||
if(b) {
|
||||
s = 1;
|
||||
J is = () -> <error descr="Variable used in lambda expression should be final or effectively final">s</error>;
|
||||
System.out.println(is.m());
|
||||
}
|
||||
<error descr="Variable 's' might not have been initialized">s</error>++;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user