@Test void test_cleanup_state() { final int[] steps = new int[2]; CheckVerifier.newVerifier() .onFile("src/test/files/se/SeEngineTestCleanupState.java") .withCheck(new SymbolicExecutionVisitor(Collections.emptyList(), new BehaviorCache()) { @Override public void visitNode(Tree tree) { ExplodedGraphWalker explodedGraphWalker = new ExplodedGraphWalker(this.behaviorCache, (Sema) context.getSemanticModel(), false); explodedGraphWalker.visitMethod((MethodTree) tree, methodBehaviorForSymbol(((MethodTree) tree).symbol())); steps[0] += explodedGraphWalker.steps; } }) .withClassPath(SETestUtils.CLASS_PATH) .verifyNoIssues(); CheckVerifier.newVerifier() .onFile("src/test/files/se/SeEngineTestCleanupState.java") .withCheck(new SymbolicExecutionVisitor(Collections.emptyList(), new BehaviorCache()) { @Override public void visitNode(Tree tree) { ExplodedGraphWalker explodedGraphWalker = new ExplodedGraphWalker(this.behaviorCache, (Sema) context.getSemanticModel()); MethodTree methodTree = (MethodTree) tree; explodedGraphWalker.visitMethod(methodTree, methodBehaviorForSymbol(methodTree.symbol())); steps[1] += explodedGraphWalker.steps; } }) .withClassPath(SETestUtils.CLASS_PATH) .verifyNoIssues(); assertThat(steps[0]) .isPositive() .isGreaterThan(steps[1]); }
public MethodBehavior visitMethod(MethodTree tree) { return visitMethod(tree, null); }
ExplodedGraphWalker { public MethodBehavior visitMethod(MethodTree tree) { return visitMethod(tree, null); } }
ExplodedGraphWalker { public MethodBehavior visitMethod(MethodTree tree) { return visitMethod(tree, null); } @VisibleForTesting  ExplodedGraphWalker(BehaviorCache behaviorCache, Sema semanticModel); @VisibleForTesting  ExplodedGraphWalker(BehaviorCache behaviorCache, Sema semanticModel, boolean cleanup); @VisibleForTesting protected  ExplodedGraphWalker(List<SECheck> seChecks, BehaviorCache behaviorCache, Sema semanticModel); }
ExplodedGraphWalker { public MethodBehavior visitMethod(MethodTree tree) { return visitMethod(tree, null); } @VisibleForTesting  ExplodedGraphWalker(BehaviorCache behaviorCache, Sema semanticModel); @VisibleForTesting  ExplodedGraphWalker(BehaviorCache behaviorCache, Sema semanticModel, boolean cleanup); @VisibleForTesting protected  ExplodedGraphWalker(List<SECheck> seChecks, BehaviorCache behaviorCache, Sema semanticModel); MethodBehavior visitMethod(MethodTree tree); MethodBehavior visitMethod(MethodTree tree, @Nullable MethodBehavior methodBehavior); void addExceptionalYield(SymbolicValue target, ProgramState exceptionalState, String exceptionFullyQualifiedName, SECheck check); void clearStack(Tree tree); void enqueue(ProgramPoint programPoint, ProgramState programState); void enqueue(ProgramPoint programPoint, ProgramState programState, @Nullable MethodYield methodYield); void enqueue(ProgramPoint newProgramPoint, ProgramState programState, boolean exitPath); void enqueue(ProgramPoint newProgramPoint, ProgramState programState, boolean exitPath, @Nullable MethodYield methodYield); }
ExplodedGraphWalker { public MethodBehavior visitMethod(MethodTree tree) { return visitMethod(tree, null); } @VisibleForTesting  ExplodedGraphWalker(BehaviorCache behaviorCache, Sema semanticModel); @VisibleForTesting  ExplodedGraphWalker(BehaviorCache behaviorCache, Sema semanticModel, boolean cleanup); @VisibleForTesting protected  ExplodedGraphWalker(List<SECheck> seChecks, BehaviorCache behaviorCache, Sema semanticModel); MethodBehavior visitMethod(MethodTree tree); MethodBehavior visitMethod(MethodTree tree, @Nullable MethodBehavior methodBehavior); void addExceptionalYield(SymbolicValue target, ProgramState exceptionalState, String exceptionFullyQualifiedName, SECheck check); void clearStack(Tree tree); void enqueue(ProgramPoint programPoint, ProgramState programState); void enqueue(ProgramPoint programPoint, ProgramState programState, @Nullable MethodYield methodYield); void enqueue(ProgramPoint newProgramPoint, ProgramState programState, boolean exitPath); void enqueue(ProgramPoint newProgramPoint, ProgramState programState, boolean exitPath, @Nullable MethodYield methodYield); static final int MAX_NESTED_BOOLEAN_STATES; static final MethodMatchers EQUALS_METHODS; }