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:
Tagir Valeev
2017-10-09 15:59:45 +07:00
parent 28e3a28f8e
commit 59526abd92
3 changed files with 22 additions and 0 deletions
@@ -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);
}
}
}