mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-05-01 10:48:09 +07:00
Java: keep final if possible when reusing previous variable (IDEA-312181)
GitOrigin-RevId: 73e54a9e8850f2fa04ac2b642e712c285f5b24f6
This commit is contained in:
committed by
intellij-monorepo-bot
parent
8b8490c8cd
commit
bf8816a076
@@ -0,0 +1,14 @@
|
||||
// "Reuse previous variable 'x' declaration" "true-preview"
|
||||
import java.io.*;
|
||||
|
||||
class X {
|
||||
public void demo() {
|
||||
final boolean x;
|
||||
if (true) {
|
||||
x = false;
|
||||
} else {
|
||||
x = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
// "Reuse previous variable 'x' declaration" "true-preview"
|
||||
import java.io.*;
|
||||
|
||||
class X {
|
||||
public void demo() {
|
||||
final boolean x;
|
||||
if (true) {
|
||||
x = false;
|
||||
} else {
|
||||
boolean <caret>x = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user