mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-26 15:27:45 +07:00
ControlFlowAnalyzer: pop result of resource expression (Java 9)
If it's not popped, it causes misbalanced stack which may lead to exceptions/strange behavior in data flow analysis.
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
class Test {
|
||||
public void closeable(AutoCloseable y) {
|
||||
try(<error descr="Resource references are not supported at language level '1.7'">y</error>) {
|
||||
System.out.println("Hello");
|
||||
}
|
||||
catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
public void incompleteCode(AutoCloseable y) {
|
||||
try(<error descr="Resource references are not supported at language level '1.7'">y</error><error descr="')' expected"> </error>{
|
||||
System.out.println("Hello");
|
||||
}
|
||||
catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user