fix: fix recursion
@@ -37,12 +37,7 @@ public class DetectorAggregateEvaluationResult {
}
public Set<DetectorType> getApplicableDetectorTypesRecursively() {
- Set<DetectorType> applied = new HashSet<>();
- applied.addAll(getApplicableDetectorTypes());
- for (DetectorEvaluationTree child : evaluationTree.getChildren()) {
- applied.addAll(getApplicableDetectorTypes(child));
- }
- return applied;
+ return getApplicableDetectorTypesRecursively(evaluationTree);
}
public Integer getExtractionCount() {
@@ -51,6 +46,15 @@ public class DetectorAggregateEvaluationResult {
.count());
}
+ private Set<DetectorType> getApplicableDetectorTypesRecursively(DetectorEvaluationTree givenEvaluationTree) {
+ Set<DetectorType> applied = new HashSet<>();
+ applied.addAll(getApplicableDetectorTypes(givenEvaluationTree));
+ for (DetectorEvaluationTree childEvaluationTree : givenEvaluationTree.getChildren()) {
+ applied.addAll(getApplicableDetectorTypesRecursively(childEvaluationTree));
+ }
+ return applied;
+ }
+
private List<DetectorEvaluation> getDetectorEvaluations(DetectorEvaluationTree givenEvaluationTree) {
return givenEvaluationTree.getOrderedEvaluations();
}
