Statement (Statement head) { if (head.getLastBasicType() != StatementType.GENERAL) { return null; } Set<Statement> setHandlers = DecHelper.getUniquePredExceptions(head); if (setHandlers.size() != 1) { return null; } for (StatEdge edge : head.getSuccessorEdges(EdgeType.EXCEPTION)) { Statement exc = edge.getDestination(); if (edge.getExceptions() == null && exc.getLastBasicType() == StatementType.GENERAL && setHandlers.contains(exc)) { List<StatEdge> lstSuccs = exc.getSuccessorEdges(EdgeType.DIRECT_ALL); if (lstSuccs.isEmpty() || lstSuccs.get(0).getType() != EdgeType.REGULAR) { if (head.isMonitorEnter() || exc.isMonitorEnter()) { return null; } if (DecHelper.checkStatementExceptions(Arrays.asList(head, exc))) { return new CatchAllStatement(head, exc); } } } } return null; }