Files
openide/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/mustBeFinal21/beforeInsideWhenWIthIf.java
T

13 lines
299 B
Java

// "Make 'mode' effectively final by moving initializer to the 'if' statement" "true-preview"
class Test {
void test(Object o) {
int mode = 2;
if (Math.random() > 0.5) {
mode = 3;
}
switch (o) {
case Integer i when i == mode<caret> -> {}
default -> {}
}
}
}