mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-30 02:09:59 +07:00
Try-with-resource support: reuse variable quick fix
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
// "Reuse previous variable 'r' declaration" "true"
|
||||
import java.io.*;
|
||||
|
||||
class a {
|
||||
static class MyResource implements AutoCloseable {
|
||||
public void close() { }
|
||||
}
|
||||
|
||||
void m() {
|
||||
MyResource r;
|
||||
try (r = new MyResource()) {
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
// "Reuse previous variable 'r' declaration" "true"
|
||||
import java.io.*;
|
||||
|
||||
class a {
|
||||
static class MyResource implements AutoCloseable {
|
||||
public void close() { }
|
||||
}
|
||||
|
||||
void m() {
|
||||
MyResource r;
|
||||
try (MyResource <caret>r = new MyResource()) {
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user