Program: 98001
Project: 98001
Buggy source:
public QueryTerm(Object lhsValue,ZooFieldDef lhsFieldDef,QueryFunction lhsFunction,COMP_OP op,String rhsParamName,Object rhsValue,ZooFieldDef rhsFieldDef,QueryFunction rhsFunction,boolean negate){
  this.lhsParam=null;
  if (lhsFunction != null) {
switch (lhsFunction.op()) {
case THIS:
      this.lhsFunction=null;
    this.lhsValue=THIS;
  this.lhsCt=COMPARISON_TYPE.PC;
break;
case CONSTANT:
this.lhsFunction=null;
this.lhsValue=lhsFunction.evaluate(null,null);
this.lhsCt=COMPARISON_TYPE.fromType(lhsValue);
break;
case PARAM:
this.lhsFunction=null;
this.lhsValue=null;
this.lhsParam=(QueryParameter)lhsFunction.getConstant();
this.lhsCt=COMPARISON_TYPE.fromType(lhsParam.getValue());
break;
default :
this.lhsFunction=lhsFunction;
this.lhsValue=null;
this.lhsCt=COMPARISON_TYPE.fromTypeClass(lhsFunction.getReturnType());
}
}
 else {
this.lhsFunction=lhsFunction;
this.lhsValue=lhsValue;
if (lhsFieldDef != null) {
this.lhsCt=COMPARISON_TYPE.fromTypeClass(lhsFieldDef.getJavaType());
}
 else {
this.lhsCt=COMPARISON_TYPE.fromType(lhsValue);
}
}
this.lhsFieldDef=lhsFieldDef;
this.op=op.inverstIfTrue(negate);
this.rhsParamName=rhsParamName;
this.rhsFieldDef=rhsFieldDef;
if (rhsFunction != null) {
switch (rhsFunction.op()) {
case THIS:
this.rhsFunction=null;
this.rhsValue=THIS;
this.rhsCt=COMPARISON_TYPE.PC;
break;
case CONSTANT:
this.rhsFunction=null;
this.rhsValue=rhsFunction.evaluate(null,null);
this.rhsCt=COMPARISON_TYPE.fromType(rhsValue);
break;
case PARAM:
this.rhsFunction=null;
this.rhsValue=null;
this.rhsParam=(QueryParameter)rhsFunction.getConstant();
this.rhsCt=COMPARISON_TYPE.fromType(rhsParam.getValue());
break;
default :
this.rhsFunction=rhsFunction;
this.rhsValue=null;
this.rhsCt=COMPARISON_TYPE.fromTypeClass(rhsFunction.getReturnType());
}
}
 else {
this.rhsFunction=rhsFunction;
this.rhsValue=rhsValue;
if (rhsFieldDef != null) {
this.rhsCt=COMPARISON_TYPE.fromTypeClass(rhsFieldDef.getJavaType());
}
 else {
this.rhsCt=COMPARISON_TYPE.fromType(rhsValue);
}
}
compType=COMPARISON_TYPE.fromOperands(lhsCt,rhsCt);
}

Fixed version (ground truth):
public QueryTerm(Object lhsValue,ZooFieldDef lhsFieldDef,QueryFunction lhsFunction,COMP_OP op,String rhsParamName,Object rhsValue,ZooFieldDef rhsFieldDef,QueryFunction rhsFunction,boolean negate){
  this.lhsParam=null;
  if (lhsFunction != null) {
switch (lhsFunction.op()) {
case THIS:
      this.lhsFunction=null;
    this.lhsValue=THIS;
  this.lhsCt=COMPARISON_TYPE.PC;
break;
case CONSTANT:
this.lhsFunction=null;
this.lhsValue=lhsFunction.evaluate(null,null);
this.lhsCt=COMPARISON_TYPE.fromType(this.lhsValue);
break;
case PARAM:
this.lhsFunction=null;
this.lhsValue=null;
this.lhsParam=(QueryParameter)lhsFunction.getConstant();
this.lhsCt=COMPARISON_TYPE.fromTypeClass(lhsFunction.getReturnType());
break;
default :
this.lhsFunction=lhsFunction;
this.lhsValue=null;
this.lhsCt=COMPARISON_TYPE.fromTypeClass(lhsFunction.getReturnType());
}
}
 else {
this.lhsFunction=null;
this.lhsValue=lhsValue;
if (lhsFieldDef != null) {
this.lhsCt=COMPARISON_TYPE.fromTypeClass(lhsFieldDef.getJavaType());
}
 else {
this.lhsCt=COMPARISON_TYPE.fromType(lhsValue);
}
}
this.lhsFieldDef=lhsFieldDef;
this.op=op.inverstIfTrue(negate);
this.rhsParamName=rhsParamName;
this.rhsFieldDef=rhsFieldDef;
if (rhsFunction != null) {
switch (rhsFunction.op()) {
case THIS:
this.rhsFunction=null;
this.rhsValue=THIS;
this.rhsCt=COMPARISON_TYPE.PC;
break;
case CONSTANT:
this.rhsFunction=null;
this.rhsValue=rhsFunction.evaluate(null,null);
this.rhsCt=COMPARISON_TYPE.fromType(this.rhsValue);
break;
case PARAM:
this.rhsFunction=null;
this.rhsValue=null;
this.rhsParam=(QueryParameter)rhsFunction.getConstant();
this.rhsCt=COMPARISON_TYPE.fromTypeClass(rhsFunction.getReturnType());
break;
default :
this.rhsFunction=rhsFunction;
this.rhsValue=null;
this.rhsCt=COMPARISON_TYPE.fromTypeClass(rhsFunction.getReturnType());
}
}
 else {
this.rhsFunction=null;
this.rhsValue=rhsValue;
if (rhsFieldDef != null) {
this.rhsCt=COMPARISON_TYPE.fromTypeClass(rhsFieldDef.getJavaType());
}
 else {
this.rhsCt=COMPARISON_TYPE.fromType(rhsValue);
}
}
compType=COMPARISON_TYPE.fromOperands(lhsCt,rhsCt);
}