LinkedList<State> workList = new LinkedList<State>();
workList.add(stateMachine.getState(enclosingMethod));
while (!workList.isEmpty()) {
// move _backwards_ from the current state, gathering any
// webapps on the way - these can be context
State state1 = workList.removeFirst();
SootMethod callingMethod = state1.getMethod();
SootClass declaringClass = callingMethod.getDeclaringClass();
if (resolver.isWebApp(declaringClass)) {
targetedWebApps.add(declaringClass);
} else {
for (Transition predecessor : pred.getPredecessors(state1)) {
if (predecessor instanceof HandlerTransition
|| predecessor instanceof LambdaTransition
|| predecessor instanceof FilterTransition) {
State target = predecessor.getTarget();
if (!seen.contains(target)) {
seen.add(target);
workList.add(target);
}
}