private Optional<JavaFileScannerContext.Location> flowFromCaughtException(ExplodedGraph.Edge edge) { ProgramPoint programPoint = edge.parent.programPoint; if (((CFG.Block) programPoint.block).isCatchBlock() && programPoint.i == 0) { VariableTree catchVariable = ((VariableTree) programPoint.syntaxTree()); SymbolicValue.CaughtExceptionSymbolicValue caughtSv = ((SymbolicValue.CaughtExceptionSymbolicValue) edge.child.programState.getValue(catchVariable.symbol())); Preconditions.checkNotNull(caughtSv, "Caught exception not found in program state"); Type exceptionType = caughtSv.exception().exceptionType(); return Optional.of(location(edge.parent, String.format("%s is caught.", exceptionName(exceptionType)))); } return Optional.empty(); }
private Optional<JavaFileScannerContext.Location> flowFromCaughtException(ExplodedGraph.Edge edge) { ProgramPoint programPoint = edge.parent.programPoint; if (((CFG.Block) programPoint.block).isCatchBlock() && programPoint.i == 0) { VariableTree catchVariable = ((VariableTree) programPoint.syntaxTree()); SymbolicValue.CaughtExceptionSymbolicValue caughtSv = ((SymbolicValue.CaughtExceptionSymbolicValue) edge.child.programState.getValue(catchVariable.symbol())); Preconditions.checkNotNull(caughtSv, "Caught exception not found in program state"); Type exceptionType = caughtSv.exception().exceptionType(); return Optional.of(location(edge.parent, String.format("%s is caught.", exceptionName(exceptionType)))); } return Optional.empty(); }
private void executeNewClass(NewClassTree tree) { NewClassTree newClassTree = tree; programState = programState.unstackValue(newClassTree.arguments().size()).state; // Enqueue exceptional paths ((CFG.Block) node.programPoint.block).exceptions().forEach(b -> enqueue(new ProgramPoint(b), programState, !b.isCatchBlock())); SymbolicValue svNewClass = constraintManager.createSymbolicValue(newClassTree); programState = programState.stackValue(svNewClass); programState = svNewClass.setSingleConstraint(programState, ObjectConstraint.NOT_NULL); }
private void executeNewClass(NewClassTree tree) { NewClassTree newClassTree = tree; programState = programState.unstackValue(newClassTree.arguments().size()).state; // Enqueue exceptional paths ((CFG.Block) node.programPoint.block).exceptions().forEach(b -> enqueue(new ProgramPoint(b), programState, !b.isCatchBlock())); SymbolicValue svNewClass = constraintManager.createSymbolicValue(newClassTree); programState = programState.stackValue(svNewClass); programState = svNewClass.setSingleConstraint(programState, ObjectConstraint.NOT_NULL); }