mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
fix yet another AIOOBE caused by finally dfa
This commit is contained in:
+1
@@ -714,6 +714,7 @@ class ControlFlowAnalyzer extends JavaElementVisitor {
|
||||
if (cd.isFinally()) {
|
||||
flushVariablesInsideTry(cd);
|
||||
addInstruction(new GosubInstruction(cd.getJumpOffset(this)));
|
||||
break;
|
||||
}
|
||||
else if (cd.getType().isAssignableFrom(exceptionClass)) { // Definite catch.
|
||||
flushVariablesInsideTry(cd);
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.net.Socket;
|
||||
|
||||
public class Foo {
|
||||
private void run(int port) throws Exception {
|
||||
Socket socket = new Socket("localhost", port);
|
||||
|
||||
try {
|
||||
InputStream inputReader = socket.getInputStream();
|
||||
try {
|
||||
OutputStream outputWriter = socket.getOutputStream();
|
||||
try {
|
||||
while (true) {
|
||||
inputReader.read();
|
||||
}
|
||||
}
|
||||
finally {
|
||||
outputWriter.close();
|
||||
}
|
||||
}
|
||||
finally {
|
||||
inputReader.close();
|
||||
}
|
||||
}
|
||||
finally {
|
||||
socket.close();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -69,6 +69,7 @@ public class DataFlowInspectionTest extends LightCodeInsightFixtureTestCase {
|
||||
public void testTryCatchInForNotComplex() throws Throwable { doTest(); }
|
||||
public void testNestedTryInWhileNotComplex() throws Throwable { doTest(); }
|
||||
public void testExceptionFromFinally() throws Throwable { doTest(); }
|
||||
public void testExceptionFromFinallyNesting() throws Throwable { doTest(); }
|
||||
public void testFieldChangedBetweenSynchronizedBlocks() throws Throwable { doTest(); }
|
||||
|
||||
public void testGeneratedEquals() throws Throwable { doTest(); }
|
||||
|
||||
Reference in New Issue
Block a user