The analysis requires intermediate statements before end of branches see class StackTest.
@Test
public void test6() {
ArrayList l = new ArrayList();
Stack s = new Stack();
if (staticallyUnknown()) {
s.push(new Object());
int x = 1;
}
if (staticallyUnknown()) {
s.push(new Object());
int x = 1;
}
if(!s.isEmpty()) {
Object pop = s.pop();
mayBeInErrorState(s);
}
}
The analysis is unsound when we remove the statements x = 1.
The analysis requires intermediate statements before end of branches see class StackTest.
The analysis is unsound when we remove the statements x = 1.