Statement (Statement stat, VarType classType, Set<? super Statement> setStats) { List<Exprent> lst = new ArrayList<>(); Statement retStat = null; if (stat.getExprents() == null) { int counter = 0; for (Object obj : stat.getSequentialObjects()) { if (obj instanceof Statement st) { Statement stTemp = getDefStatement(st, classType, setStats); if (stTemp != null) { if (counter == 1) { retStat = stat; break; } retStat = stTemp; counter++; } if (st.type == StatementType.DO) { DoStatement dost = (DoStatement)st; lst.addAll(dost.getInitExprentList()); lst.addAll(dost.getConditionExprentList()); } } else if (obj instanceof Exprent) { lst.add((Exprent)obj); } } } else { lst = stat.getExprents(); } if (retStat != stat) { for (Exprent exprent : lst) { if (exprent != null && searchForClass(exprent, classType)) { retStat = stat; break; } } } if (retStat != null) { setStats.add(stat); } return retStat; }