Program: 9828
Project: 9828
Buggy source:
public Op processLeftJoinSplitLhs(Op left,Op right,Iterable<Expr> exprs,RestrictionManagerImpl restrictions){
  FilterSplit filterSplit=FilterPlacementOptimizer2.splitFilter(left,restrictions);
  RestrictionManagerImpl leftRestrictions=filterSplit.getPushable();
  Op newLeft=_getApplicableViews(left,filterSplit.getPushable());
  newLeft=FilterPlacementOptimizer2.optimize(newLeft,leftRestrictions);
  List<Op> members;
  if (newLeft instanceof OpDisjunction) {
    OpDisjunction union=(OpDisjunction)newLeft;
    members=union.getElements();
  }
 else {
    members=Collections.singletonList(newLeft);
  }
  OpDisjunction newUnion=OpDisjunction.create();
  for (  Op member : members) {
    RestrictionManagerImpl subRestrictions=new RestrictionManagerImpl(leftRestrictions);
    RestrictionManagerImpl tmp=getRestrictions2(member);
    subRestrictions.stateRestriction(tmp);
    if (exprs != null) {
      for (      Expr expr : exprs) {
        subRestrictions.stateExpr(expr);
      }
    }
    FilterSplit rsplit=FilterPlacementOptimizer2.splitFilter(right,subRestrictions);
    RestrictionManagerImpl rclauses=rsplit.getPushable();
    Op newRight=_getApplicableViews(right,rclauses);
    Op item=(OpLeftJoin)OpLeftJoin.create(member,newRight,new ExprList());
    if (!filterSplit.getNonPushable().getCnf().isEmpty()) {
      item=new OpFilterIndexed(item,filterSplit.getNonPushable());
    }
    newUnion.add(item);
  }
  List<Op> elements=newUnion.getElements();
  Op result;
  if (newUnion.size() == 1) {
    result=elements.iterator().next();
  }
 else {
    result=newUnion;
  }
  return result;
}

Fixed version (ground truth):
public Op processLeftJoinSplitLhs(Op left,Op right,Iterable<Expr> exprs,RestrictionManagerImpl restrictions){
  FilterSplit filterSplit=FilterPlacementOptimizer2.splitFilter(left,restrictions);
  RestrictionManagerImpl leftRestrictions=filterSplit.getPushable();
  Op newLeft=_getApplicableViews(left,filterSplit.getPushable());
  newLeft=FilterPlacementOptimizer2.optimize(newLeft,leftRestrictions);
  List<Op> members;
  if (newLeft instanceof OpDisjunction) {
    OpDisjunction union=(OpDisjunction)newLeft;
    members=union.getElements();
  }
 else {
    members=Collections.singletonList(newLeft);
  }
  OpDisjunction newUnion=OpDisjunction.create();
  for (  Op member : members) {
    RestrictionManagerImpl subRestrictions=new RestrictionManagerImpl(leftRestrictions);
    RestrictionManagerImpl tmp=getRestrictions2(member);
    if (tmp != null) {
      subRestrictions.stateRestriction(tmp);
    }
    if (exprs != null) {
      for (      Expr expr : exprs) {
        subRestrictions.stateExpr(expr);
      }
    }
    FilterSplit rsplit=FilterPlacementOptimizer2.splitFilter(right,subRestrictions);
    RestrictionManagerImpl rclauses=rsplit.getPushable();
    Op newRight=_getApplicableViews(right,rclauses);
    Op item=(OpLeftJoin)OpLeftJoin.create(member,newRight,new ExprList());
    if (!filterSplit.getNonPushable().getCnf().isEmpty()) {
      item=new OpFilterIndexed(item,filterSplit.getNonPushable());
    }
    newUnion.add(item);
  }
  List<Op> elements=newUnion.getElements();
  Op result;
  if (newUnion.size() == 1) {
    result=elements.iterator().next();
  }
 else {
    result=newUnion;
  }
  return result;
}