Program: 111878
Project: 111878
Buggy source:
private CallImplementor createImplementor(final NotNullImplementor implementor,final NullPolicy nullPolicy,final boolean harmonize){
switch (nullPolicy) {
case ANY:
case STRICT:
    return new CallImplementor(){
      public Expression implement(      RexToLixTranslator translator,      RexCall call,      NullAs nullAs){
        return implementNullSemantics0(translator,call,nullAs,nullPolicy,harmonize,implementor);
      }
    }
;
case AND:
  return new CallImplementor(){
    public Expression implement(    RexToLixTranslator translator,    RexCall call,    NullAs nullAs){
      final RexCall call2=call2(false,translator,call);
      final List<Expression> expressions=translator.translateList(call2.getOperandList(),nullAs);
      return Expressions.foldAnd(expressions);
    }
  }
;
case OR:
return new CallImplementor(){
  public Expression implement(  RexToLixTranslator translator,  RexCall call,  NullAs nullAs){
    final RexCall call2=call2(harmonize,translator,call);
    final Expression t0=translator.translate(call2.getOperandList().get(0));
    final Expression t1=translator.translate(call2.getOperandList().get(1));
    if (!nullable(call2,0) && !nullable(call2,1)) {
      return Expressions.orElse(t0,t1);
    }
    return optimize(Expressions.condition(Expressions.equal(t0,NULL_EXPR),Expressions.condition(Expressions.orElse(Expressions.equal(t1,NULL_EXPR),Expressions.not(t1)),NULL_EXPR,BOXED_TRUE_EXPR),Expressions.condition(Expressions.not(t0),t1,BOXED_TRUE_EXPR)));
  }
}
;
case NONE:
return new CallImplementor(){
public Expression implement(RexToLixTranslator translator,RexCall call,NullAs nullAs){
  final RexCall call2=call2(false,translator,call);
  return implementCall(translator,call2,implementor,nullAs);
}
}
;
default :
throw new AssertionError(nullPolicy);
}
}

Fixed version (ground truth):
private CallImplementor createImplementor(final NotNullImplementor implementor,final NullPolicy nullPolicy,final boolean harmonize){
switch (nullPolicy) {
case ANY:
case STRICT:
    return new CallImplementor(){
      public Expression implement(      RexToLixTranslator translator,      RexCall call,      NullAs nullAs){
        return implementNullSemantics0(translator,call,nullAs,nullPolicy,harmonize,implementor);
      }
    }
;
case AND:
  return new CallImplementor(){
    public Expression implement(    RexToLixTranslator translator,    RexCall call,    NullAs nullAs){
      final RexCall call2=call2(false,translator,call);
      final List<Expression> expressions=translator.translateList(call2.getOperandList(),nullAs);
      return Expressions.foldAnd(expressions);
    }
  }
;
case OR:
return new CallImplementor(){
  public Expression implement(  RexToLixTranslator translator,  RexCall call,  NullAs nullAs){
    final RexCall call2=call2(harmonize,translator,call);
    final NullAs nullAs2=nullAs == NullAs.TRUE ? NullAs.NULL : nullAs;
    final List<Expression> expressions=translator.translateList(call2.getOperandList(),nullAs2);
switch (nullAs) {
case NOT_POSSIBLE:
case FALSE:
      return Expressions.foldOr(expressions);
  }
  final Expression t0=expressions.get(0);
  final Expression t1=expressions.get(1);
  if (!nullable(call2,0) && !nullable(call2,1)) {
    return Expressions.orElse(t0,t1);
  }
  return optimize(Expressions.condition(Expressions.equal(t0,NULL_EXPR),Expressions.condition(Expressions.orElse(Expressions.equal(t1,NULL_EXPR),Expressions.not(t1)),NULL_EXPR,BOXED_TRUE_EXPR),Expressions.condition(Expressions.not(t0),t1,BOXED_TRUE_EXPR)));
}
}
;
case NOT:
return new CallImplementor(){
public Expression implement(RexToLixTranslator translator,RexCall call,NullAs nullAs){
NullAs nullAs2;
switch (nullAs) {
case FALSE:
  nullAs2=NullAs.TRUE;
break;
case TRUE:
nullAs2=NullAs.FALSE;
break;
default :
nullAs2=nullAs;
}
return implementNullSemantics0(translator,call,nullAs2,nullPolicy,harmonize,implementor);
}
}
;
case NONE:
return new CallImplementor(){
public Expression implement(RexToLixTranslator translator,RexCall call,NullAs nullAs){
final RexCall call2=call2(false,translator,call);
return implementCall(translator,call2,implementor,nullAs);
}
}
;
default :
throw new AssertionError(nullPolicy);
}
}