mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-26 15:27:45 +07:00
Java inspection: Check if the returned variable is read in the 'finally' block of an enclosing 'try' statement in "Move return to computation" inspection (IDEA-121153)
This commit is contained in:
+14
@@ -0,0 +1,14 @@
|
||||
// "Move 'return' closer to computation of the value of 'n'" "false"
|
||||
class T {
|
||||
int f(boolean b) {
|
||||
int n = -1;
|
||||
try {
|
||||
if (b) throw new RuntimeException();
|
||||
n = 1;
|
||||
re<caret>turn n;
|
||||
}
|
||||
finally {
|
||||
System.out.println(n);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user