diff --git a/src/main/java/com/github/samyadaleh/cltoolbox/chartparsing/Deduction.java b/src/main/java/com/github/samyadaleh/cltoolbox/chartparsing/Deduction.java index 9fe89ea..44c0b44 100644 --- a/src/main/java/com/github/samyadaleh/cltoolbox/chartparsing/Deduction.java +++ b/src/main/java/com/github/samyadaleh/cltoolbox/chartparsing/Deduction.java @@ -323,13 +323,14 @@ private int checkForGoal(ChartItemInterface goal) { * Applies an axiom rule, that is a rule without antecedence items and adds * the consequence items to chart and agenda. */ - @SuppressWarnings("serial") private void applyAxiomRule( + private void applyAxiomRule( StaticDeductionRule rule) { for (ChartItemInterface item : rule.consequences) { if (chart.contains(item)) { continue; } chart.add(item); + currentAddedTrees += item.getTrees().size(); addToAgenda(item); deductedFrom.add(new ArrayList>() { { @@ -370,7 +371,7 @@ private void applyRule(DynamicDeductionRuleInterface rule, rule.clearItems(); rule.setAntecedences(antecedences); List newItems = rule.getConsequences(); - if (newItems.size() > 0) { + if (!newItems.isEmpty()) { processNewItems(newItems, rule, triggerItems); } } @@ -470,6 +471,7 @@ private void processNewItems(List newItems, triggerTreeUpdate(oldId, newTriggerItems); } } else { + currentAddedTrees += newItem.getTrees().size(); chart.add(newItem); addToAgenda(newItem); appliedRule.add(new ArrayList<>()); @@ -650,7 +652,7 @@ private static String[] getLineData(int i, String item, List rules, * form. */ private static String rulesToString(List rules) { - if (rules.size() == 0) + if (rules.isEmpty()) return ""; StringBuilder builder = new StringBuilder(); for (String rule : rules) { @@ -666,7 +668,7 @@ private static String rulesToString(List rules) { * human friendly form. */ private static String backpointersToString(List> backpointers) { - if (backpointers.size() == 0) + if (backpointers.isEmpty()) return ""; StringBuilder builder = new StringBuilder(); for (List pointertuple : backpointers) {