Program: 139908
Project: 139908
Buggy source:
public static boolean patternRule(IndicatorEnum indicatorType,TdColumn column){
  int javaType=column.getJavaType();
  DataminingType dataminingType=MetadataHelper.getDataminingType(column);
  if (dataminingType == null) {
    dataminingType=MetadataHelper.getDefaultDataminingType(javaType);
  }
switch (indicatorType) {
case CountsIndicatorEnum:
case RowCountIndicatorEnum:
case NullCountIndicatorEnum:
case DistinctCountIndicatorEnum:
case UniqueIndicatorEnum:
case DuplicateCountIndicatorEnum:
    return true;
case DefValueCountIndicatorEnum:
  if (column.getInitialValue().getBody() != null) {
    return true;
  }
break;
case BlankCountIndicatorEnum:
case TextIndicatorEnum:
case MinLengthIndicatorEnum:
case MaxLengthIndicatorEnum:
case AverageLengthIndicatorEnum:
if (Java2SqlType.isTextInSQL(javaType)) {
if (dataminingType == DataminingType.NOMINAL || dataminingType == DataminingType.UNSTRUCTURED_TEXT) {
  return true;
}
}
break;
case ModeIndicatorEnum:
case FrequencyIndicatorEnum:
case LowFrequencyIndicatorEnum:
case PatternFreqIndicatorEnum:
case PatternLowFreqIndicatorEnum:
if (dataminingType == DataminingType.NOMINAL || dataminingType == DataminingType.INTERVAL) {
return true;
}
break;
case SoundexIndicatorEnum:
case SoundexLowIndicatorEnum:
if (!Java2SqlType.isDateInSQL(javaType) && (dataminingType == DataminingType.NOMINAL || dataminingType == DataminingType.INTERVAL)) {
return true;
}
break;
case MeanIndicatorEnum:
case MedianIndicatorEnum:
case BoxIIndicatorEnum:
case IQRIndicatorEnum:
case LowerQuartileIndicatorEnum:
case UpperQuartileIndicatorEnum:
if (Java2SqlType.isNumbericInSQL(javaType)) {
if (dataminingType == DataminingType.INTERVAL) {
return true;
}
}
break;
case RangeIndicatorEnum:
case MinValueIndicatorEnum:
case MaxValueIndicatorEnum:
if (Java2SqlType.isNumbericInSQL(javaType) || Java2SqlType.isDateInSQL(javaType)) {
if (dataminingType == DataminingType.INTERVAL) {
return true;
}
}
break;
default :
return false;
}
return false;
}

Fixed version (ground truth):
public static boolean patternRule(IndicatorEnum indicatorType,TdColumn column){
  int javaType=column.getJavaType();
  DataminingType dataminingType=MetadataHelper.getDataminingType(column);
  if (dataminingType == null) {
    dataminingType=MetadataHelper.getDefaultDataminingType(javaType);
  }
switch (indicatorType) {
case CountsIndicatorEnum:
case RowCountIndicatorEnum:
case NullCountIndicatorEnum:
case DistinctCountIndicatorEnum:
case UniqueIndicatorEnum:
case DuplicateCountIndicatorEnum:
    return true;
case DefValueCountIndicatorEnum:
  if (column.getInitialValue().getBody() != null) {
    return column.getInitialValue().getBody().length() != 0 || Java2SqlType.isTextInSQL(javaType);
  }
break;
case BlankCountIndicatorEnum:
case TextIndicatorEnum:
case MinLengthIndicatorEnum:
case MaxLengthIndicatorEnum:
case AverageLengthIndicatorEnum:
if (Java2SqlType.isTextInSQL(javaType)) {
if (dataminingType == DataminingType.NOMINAL || dataminingType == DataminingType.UNSTRUCTURED_TEXT) {
  return true;
}
}
break;
case ModeIndicatorEnum:
case FrequencyIndicatorEnum:
case LowFrequencyIndicatorEnum:
case PatternFreqIndicatorEnum:
case PatternLowFreqIndicatorEnum:
if (dataminingType == DataminingType.NOMINAL || dataminingType == DataminingType.INTERVAL) {
return true;
}
break;
case SoundexIndicatorEnum:
case SoundexLowIndicatorEnum:
if (!Java2SqlType.isDateInSQL(javaType) && (dataminingType == DataminingType.NOMINAL || dataminingType == DataminingType.INTERVAL)) {
return true;
}
break;
case MeanIndicatorEnum:
case MedianIndicatorEnum:
case BoxIIndicatorEnum:
case IQRIndicatorEnum:
case LowerQuartileIndicatorEnum:
case UpperQuartileIndicatorEnum:
if (Java2SqlType.isNumbericInSQL(javaType)) {
if (dataminingType == DataminingType.INTERVAL) {
return true;
}
}
break;
case RangeIndicatorEnum:
case MinValueIndicatorEnum:
case MaxValueIndicatorEnum:
if (Java2SqlType.isNumbericInSQL(javaType) || Java2SqlType.isDateInSQL(javaType)) {
if (dataminingType == DataminingType.INTERVAL) {
return true;
}
}
break;
default :
return false;
}
return false;
}