mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
IDEA-94910 (control flow for resource variables fixed)
This commit is contained in:
@@ -777,11 +777,6 @@ class ControlFlowAnalyzer extends JavaElementVisitor {
|
||||
public void visitTryStatement(PsiTryStatement statement) {
|
||||
startElement(statement);
|
||||
|
||||
PsiResourceList resourceList = statement.getResourceList();
|
||||
if (resourceList != null) {
|
||||
resourceList.accept(this);
|
||||
}
|
||||
|
||||
PsiCodeBlock finallyBlock = statement.getFinallyBlock();
|
||||
if (finallyBlock != null) {
|
||||
myCatchStack.push(new CatchDescriptor(finallyBlock));
|
||||
@@ -806,6 +801,11 @@ class ControlFlowAnalyzer extends JavaElementVisitor {
|
||||
|
||||
int endOffset = finallyBlock == null ? getEndOffset(statement) : getStartOffset(finallyBlock) - 2;
|
||||
|
||||
PsiResourceList resourceList = statement.getResourceList();
|
||||
if (resourceList != null) {
|
||||
resourceList.accept(this);
|
||||
}
|
||||
|
||||
PsiCodeBlock tryBlock = statement.getTryBlock();
|
||||
if (tryBlock != null) {
|
||||
tryBlock.accept(this);
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
import java.lang.Exception;
|
||||
|
||||
class Test {
|
||||
static class MyResource implements AutoCloseable {
|
||||
@Override public void close() { }
|
||||
@@ -22,7 +20,7 @@ class Test {
|
||||
}
|
||||
}
|
||||
|
||||
/*static class ResourcefulException1 extends Exception { }
|
||||
static class ResourcefulException1 extends Exception { }
|
||||
static class ResourcefulException2 extends Exception { }
|
||||
|
||||
static class ExceptionalResource implements AutoCloseable {
|
||||
@@ -45,5 +43,5 @@ class Test {
|
||||
System.out.println("2");
|
||||
}
|
||||
}
|
||||
}*/
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user