if (thrownExceptionSet.isEmpty()) { Edge edge = cfg.getOutgoingEdgeWithType(basicBlock, UNHANDLED_EXCEPTION_EDGE); if (edge != null) { deletedEdgeSet.add(edge); } } else {   int flag; if (thrownExceptionSet.containsCheckedExceptions()) flag = CHECKED_EXCEPTIONS_FLAG; else if (thrownExceptionSet.containsExplicitExceptions()) flag = EXPLICIT_UNCHECKED_EXCEPTIONS_FLAG; else flag = IMPLICIT_UNCHECKED_EXCEPTIONS_FLAG; Edge edge = cfg.getOutgoingEdgeWithType(basicBlock, UNHANDLED_EXCEPTION_EDGE); if (edge == null) {    throw new DataflowAnalysisException("In method " + SignatureConverter.convertMethodSignature(methodGen) + " block " + basicBlock.getId() + " has missing unhandled exception edge"); } markedEdgeList.add(new MarkedEdge(edge, flag)); }
int flags = 0; if (someChecked) flags |= CHECKED_EXCEPTIONS_FLAG; if (someExplicit) flags |= EXPLICIT_EXCEPTIONS_FLAG;  markedEdgeList.add(new MarkedEdge(edge, flags));
	public void execute() throws ClassNotFoundException, DataflowAnalysisException {		HashSet<Edge> deletedEdgeSet = new HashSet<Edge>();		List<MarkedEdge> markedEdgeList = new LinkedList<MarkedEdge>();		// Scan all basic blocks for infeasible exception edges		Iterator<BasicBlock> i = cfg.blockIterator();		while (i.hasNext()) {			BasicBlock basicBlock = i.next();			if (basicBlock.isExceptionThrower()) {				// Enumerate the kinds of exceptions this block can throw				ExceptionSet thrownExceptionSet = enumerateExceptionTypes(basicBlock);				// For each exception edge, determine if				// the handler is reachable.  If not, delete it.				// This ABSOLUTELY relies on the handled exception edges being				// enumerated in decreasing order of priority,				// because we eliminate thrown types as we encounter				// handlers where they are guaranteed to be caught.				for (Iterator<Edge> j = cfg.outgoingEdgeIterator(basicBlock); j.hasNext(); ) {					Edge edge = j.next();					if (edge.getType() == HANDLED_EXCEPTION_EDGE) {						checkReachability(edge, thrownExceptionSet, deletedEdgeSet, markedEdgeList);					}				}				// If all exceptions are caught, mark the unhandled exception edge				// for deletion				if (thrownExceptionSet.isEmpty()) {					Edge edge = cfg.getOutgoingEdgeWithType(basicBlock, UNHANDLED_EXCEPTION_EDGE);					if (edge != null) {						deletedEdgeSet.add(edge);					}				} else {					// Unhandled exceptions can be thrown.					// Check whether they are implicit or explicit.					int flag;					if (thrownExceptionSet.containsCheckedExceptions())						flag = CHECKED_EXCEPTIONS_FLAG;					else if (thrownExceptionSet.containsExplicitExceptions())						flag = EXPLICIT_UNCHECKED_EXCEPTIONS_FLAG;					else						flag = IMPLICIT_UNCHECKED_EXCEPTIONS_FLAG;					Edge edge = cfg.getOutgoingEdgeWithType(basicBlock, UNHANDLED_EXCEPTION_EDGE);					if (edge == null) {						// Raw CFGs are built conservatively,						// so this exception should never happen.						// If it does happen, it indicates a bug in the CFG builder.						throw new DataflowAnalysisException("In method " +							SignatureConverter.convertMethodSignature(methodGen) +							" block " + basicBlock.getId() + " has missing unhandled exception edge");					}					markedEdgeList.add(new MarkedEdge(edge, flag));				}			}		}		// Remove deleted edges		for (Iterator<Edge> j = deletedEdgeSet.iterator(); j.hasNext(); ) {			Edge edge = j.next();			//if (edge == null) throw new IllegalStateException("null edge");			cfg.removeEdge(edge);			if (STATS) ++numEdgesPruned;		}		// Mark edges		for (Iterator<MarkedEdge> j = markedEdgeList.iterator(); j.hasNext(); ) {			j.next().apply();		}	}