Program: 169078
Project: 169078
Buggy source:
public FilterBuilder createFilterBuilderForDisjunctions(Collection<Disjunction> disjunctions) throws UnsupportedException, ExecutionException {
  if (disjunctions.size() > 1) {
    List<BoolFilterBuilder> external=new ArrayList<>();
    for (    Disjunction disjunction : disjunctions) {
      List<FilterBuilder> internal=new ArrayList<>();
      for (      List<ITerm> terms : disjunction.getTerms()) {
        List<FilterBuilder> internal2=new ArrayList<>();
        Collection<Disjunction> internalDisjunction=new ArrayList<>();
        for (        ITerm term : terms) {
          if (term instanceof Filter) {
            internal2.add(handleCompareFilter((Filter)term));
          }
 else           if (term instanceof Disjunction) {
            internalDisjunction.add((Disjunction)term);
          }
        }
        internal.addAll(internal2);
        if (!internalDisjunction.isEmpty()) {
          internal.add(createFilterBuilderForDisjunctions(internalDisjunction));
        }
      }
      external.add(FilterBuilders.boolFilter().should(internal.toArray(new FilterBuilder[]{})));
    }
    BoolFilterBuilder boolFilterBuilder=FilterBuilders.boolFilter();
    boolFilterBuilder.must(external.toArray(new BoolFilterBuilder[]{}));
    return boolFilterBuilder;
  }
 else {
    BoolFilterBuilder boolFilterBuilder=FilterBuilders.boolFilter();
    Disjunction disjunction=disjunctions.iterator().next();
    List<FilterBuilder> internal=new ArrayList<>();
    for (    List<ITerm> terms : disjunction.getTerms()) {
      List<FilterBuilder> internal2=new ArrayList<>();
      Collection<Disjunction> internalDisjunction=new ArrayList<>();
      for (      ITerm term : terms) {
        if (term instanceof Filter) {
          internal2.add(handleCompareFilter((Filter)term));
        }
 else         if (term instanceof Disjunction) {
          internalDisjunction.add((Disjunction)term);
        }
      }
      internal.add(FilterBuilders.boolFilter().must(internal2.toArray(new FilterBuilder[]{})));
      if (!internalDisjunction.isEmpty()) {
        internal.add(createFilterBuilderForDisjunctions(internalDisjunction));
      }
    }
    boolFilterBuilder.should(internal.toArray(new FilterBuilder[]{}));
    return boolFilterBuilder;
  }
}

Fixed version (ground truth):
public FilterBuilder createFilterBuilderForDisjunctions(Collection<Disjunction> disjunctions) throws UnsupportedException, ExecutionException {
  if (disjunctions.size() > 1) {
    List<BoolFilterBuilder> external=new ArrayList<>();
    for (    Disjunction disjunction : disjunctions) {
      List<FilterBuilder> internal=new ArrayList<>();
      for (      List<ITerm> terms : disjunction.getTerms()) {
        List<FilterBuilder> internal2=new ArrayList<>();
        Collection<Disjunction> internalDisjunction=new ArrayList<>();
        for (        ITerm term : terms) {
          if (term instanceof Filter) {
            internal2.add(handleCompareFilter((Filter)term));
          }
 else           if (term instanceof Disjunction) {
            internalDisjunction.add((Disjunction)term);
          }
        }
        internal.addAll(internal2);
        if (!internalDisjunction.isEmpty()) {
          internal.add(createFilterBuilderForDisjunctions(internalDisjunction));
        }
      }
      external.add(FilterBuilders.boolFilter().should(internal.toArray(new FilterBuilder[]{})));
    }
    BoolFilterBuilder boolFilterBuilder=FilterBuilders.boolFilter();
    boolFilterBuilder.must(external.toArray(new BoolFilterBuilder[]{}));
    return boolFilterBuilder;
  }
 else {
    BoolFilterBuilder boolFilterBuilder=FilterBuilders.boolFilter();
    Disjunction disjunction=disjunctions.iterator().next();
    List<FilterBuilder> internal=new ArrayList<>();
    for (    List<ITerm> terms : disjunction.getTerms()) {
      List<FilterBuilder> internal2=new ArrayList<>();
      Collection<Disjunction> internalDisjunction=new ArrayList<>();
      for (      ITerm term : terms) {
        if (term instanceof Filter) {
          internal2.add(handleCompareFilter((Filter)term));
        }
 else         if (term instanceof Disjunction) {
          internalDisjunction.add((Disjunction)term);
        }
      }
      if (!internal2.isEmpty()) {
        internal.add(FilterBuilders.boolFilter().must(internal2.toArray(new FilterBuilder[]{})));
      }
      if (!internalDisjunction.isEmpty()) {
        internal.add(createFilterBuilderForDisjunctions(internalDisjunction));
      }
    }
    boolFilterBuilder.should(internal.toArray(new FilterBuilder[]{}));
    return boolFilterBuilder;
  }
}