boolean (Statement stat, Statement endstat) { Set<Statement> setStat = stat.getNeighboursSet(EdgeType.DIRECT_ALL, EdgeDirection.FORWARD); if (setStat.isEmpty()) { Statement parent = stat.getParent(); if (parent == null) { return false; } else { switch (parent.type) { case ROOT: return endstat.type == StatementType.DUMMY_EXIT; case DO: return (endstat == parent); case SWITCH: SwitchStatement swst = (SwitchStatement)parent; for (int i = 0; i < swst.getCaseStatements().size() - 1; i++) { Statement stt = swst.getCaseStatements().get(i); if (stt == stat) { Statement stnext = swst.getCaseStatements().get(i + 1); if (stnext.getExprents() != null && stnext.getExprents().isEmpty()) { stnext = stnext.getAllSuccessorEdges().get(0).getDestination(); } return (endstat == stnext); } } default: return isDirectPath(parent, endstat); } } } else { return setStat.contains(endstat); } }