Program: 10618
Project: 10618
Buggy source:
private Filter generateFilter(Property field,Object propertyId,Object value){
  if (field instanceof DateFilterPopup) {
    DateInterval interval=((DateFilterPopup)field).getDateValue();
    if (interval == null) {
      return null;
    }
    if (owner.getFilterGenerator() != null) {
      Filter newFilter=owner.getFilterGenerator().generateFilter(propertyId,interval);
      if (newFilter != null) {
        return newFilter;
      }
    }
    Date from=interval.getFrom();
    Date to=interval.getTo();
    if (from != null && to != null) {
      return new Between(propertyId,from,to);
    }
 else     if (from != null) {
      return new Compare.GreaterOrEqual(propertyId,from);
    }
 else {
      return new Compare.LessOrEqual(propertyId,to);
    }
  }
 else   if (field instanceof NumberFilterPopup) {
    NumberInterval interval=((NumberFilterPopup)field).getInterval();
    if (interval == null) {
      return null;
    }
    if (owner.getFilterGenerator() != null) {
      Filter newFilter=owner.getFilterGenerator().generateFilter(propertyId,interval);
      if (newFilter != null) {
        return newFilter;
      }
    }
    String ltValue=interval.getLessThanValue();
    String gtValue=interval.getGreaterThanValue();
    String eqValue=interval.getEqualsValue();
    Class<?> clazz=owner.getContainerDataSource().getType(propertyId);
    Method valueOf;
    try {
      valueOf=clazz.getMethod("String_Node_Str",String.class);
      if (eqValue != null) {
        return new Compare.Equal(propertyId,valueOf.invoke(clazz,eqValue));
      }
 else       if (ltValue != null && gtValue != null) {
        return new And(new Compare.Less(propertyId,valueOf.invoke(clazz,ltValue)),new Compare.Greater(propertyId,valueOf.invoke(clazz,gtValue)));
      }
 else       if (ltValue != null) {
        return new Compare.Less(propertyId,valueOf.invoke(clazz,ltValue));
      }
 else       if (gtValue != null) {
        return new Compare.Greater(propertyId,valueOf.invoke(clazz,gtValue));
      }
 else {
        return null;
      }
    }
 catch (    Exception e) {
      throw new RuntimeException("String_Node_Str",e);
    }
  }
 else   if (value != null && !value.equals("String_Node_Str")) {
    if (owner.getFilterGenerator() != null) {
      Filter newFilter=owner.getFilterGenerator().generateFilter(propertyId,value);
      if (newFilter != null) {
        return newFilter;
      }
    }
    return new SimpleStringFilter(propertyId,String.valueOf(value),true,false);
  }
  return null;
}

Fixed version (ground truth):
private Filter generateFilter(Property field,Object propertyId,Object value){
  if (field instanceof DateFilterPopup) {
    DateInterval interval=((DateFilterPopup)field).getDateValue();
    if (interval == null) {
      return null;
    }
    if (owner.getFilterGenerator() != null) {
      Filter newFilter=owner.getFilterGenerator().generateFilter(propertyId,interval);
      if (newFilter != null) {
        return newFilter;
      }
    }
    Date from=interval.getFrom();
    Date to=interval.getTo();
    if (from != null && to != null) {
      return new Between(propertyId,from,to);
    }
 else     if (from != null) {
      return new Compare.GreaterOrEqual(propertyId,from);
    }
 else {
      return new Compare.LessOrEqual(propertyId,to);
    }
  }
 else   if (field instanceof NumberFilterPopup) {
    NumberInterval interval=((NumberFilterPopup)field).getInterval();
    if (interval == null) {
      return null;
    }
    if (owner.getFilterGenerator() != null) {
      Filter newFilter=owner.getFilterGenerator().generateFilter(propertyId,interval);
      if (newFilter != null) {
        return newFilter;
      }
    }
    String ltValue=interval.getLessThanValue();
    String gtValue=interval.getGreaterThanValue();
    String eqValue=interval.getEqualsValue();
    Class<?> clazz=getProperClass(propertyId);
    Method valueOf;
    try {
      valueOf=clazz.getMethod("String_Node_Str",String.class);
      if (eqValue != null) {
        return new Compare.Equal(propertyId,valueOf.invoke(clazz,eqValue));
      }
 else       if (ltValue != null && gtValue != null) {
        return new And(new Compare.Less(propertyId,valueOf.invoke(clazz,ltValue)),new Compare.Greater(propertyId,valueOf.invoke(clazz,gtValue)));
      }
 else       if (ltValue != null) {
        return new Compare.Less(propertyId,valueOf.invoke(clazz,ltValue));
      }
 else       if (gtValue != null) {
        return new Compare.Greater(propertyId,valueOf.invoke(clazz,gtValue));
      }
 else {
        return null;
      }
    }
 catch (    Exception e) {
      throw new RuntimeException("String_Node_Str",e);
    }
  }
 else   if (value != null && !value.equals("String_Node_Str")) {
    if (owner.getFilterGenerator() != null) {
      Filter newFilter=owner.getFilterGenerator().generateFilter(propertyId,value);
      if (newFilter != null) {
        return newFilter;
      }
    }
    return new SimpleStringFilter(propertyId,String.valueOf(value),true,false);
  }
  return null;
}