1
考虑这段代码使用Java规则集正确
for (MyRule cr : crList) {
if (crIds.contains(cr.getParentId())) {
ruleSet.add(cr);
for (int cursor = 0; cursor < parentChildrenList.size(); cursor++) {
if (parentChildrenList.get(cursor).getId().equals(cr.getParentId())) {
parentChildrenList2.get(cursor).setChildRules(ruleSet);
parentChildrenList2.remove(cursor + 1);
}
}
}
ruleSet.clear();
}
当我做了ruleSet.clear()
我也失去了我以前在parentChildrenList2.get(cursor).setChildRules(ruleSet);
设置的值如何才能停止失去它,但在同一时间结算ruleSet
?
非常感谢。有用。一旦我能,将会标记为正确的答案。 – Sergiu