Program: 73139
Project: 73139
Buggy source:
/** 
 * Find data type of expression from specified item handle.
 * @param expression expression.
 * @param itemHandle specified item handle.
 * @return an object array, size is two, the first element is a booleanobject, if its value is <code>true</code> then means the data type is found and the second element of array stores the data type; if its value is <code>false</code> then means that data type is not found.
 */
private Object[] findDataType(String expression,ReportItemHandle itemHandle){
  Object[] returnObj=new Object[2];
  returnObj[0]=new Boolean(false);
  String columnName=getQueryStringForProcessing(expression);
  Iterator iterator=ChartReportItemUtil.getAllColumnBindingsIterator(itemHandle);
  while (iterator.hasNext()) {
    ComputedColumnHandle cc=(ComputedColumnHandle)iterator.next();
    if (cc.getName().equalsIgnoreCase(columnName)) {
      String dataType=cc.getDataType();
      if (dataType.equals(DesignChoiceConstants.COLUMN_DATA_TYPE_STRING)) {
        returnObj[0]=new Boolean(true);
        returnObj[1]=DataType.TEXT_LITERAL;
        break;
      }
 else       if (dataType.equals(DesignChoiceConstants.COLUMN_DATA_TYPE_DECIMAL) || dataType.equals(DesignChoiceConstants.COLUMN_DATA_TYPE_FLOAT) || dataType.equals(DesignChoiceConstants.COLUMN_DATA_TYPE_INTEGER)|| dataType.equals(DesignChoiceConstants.COLUMN_DATA_TYPE_BOOLEAN)) {
        returnObj[0]=new Boolean(true);
        returnObj[1]=DataType.NUMERIC_LITERAL;
        break;
      }
 else       if (dataType.equals(DesignChoiceConstants.COLUMN_DATA_TYPE_DATETIME) || dataType.equals(DesignChoiceConstants.COLUMN_DATA_TYPE_DATE) || dataType.equals(DesignChoiceConstants.COLUMN_DATA_TYPE_TIME)) {
        returnObj[0]=new Boolean(true);
        returnObj[1]=DataType.DATE_TIME_LITERAL;
        break;
      }
 else       if (dataType.equals(DesignChoiceConstants.COLUMN_DATA_TYPE_ANY)) {
        returnObj[0]=new Boolean(true);
        returnObj[1]=null;
        break;
      }
    }
  }
  return returnObj;
}

Fixed version (ground truth):
/** 
 * Find data type of expression from specified item handle.
 * @param expression expression.
 * @param itemHandle specified item handle.
 * @return an object array, size is two, the first element is a booleanobject, if its value is <code>true</code> then means the data type is found and the second element of array stores the data type; if its value is <code>false</code> then means that data type is not found.
 */
private Object[] findDataType(String expression,ReportItemHandle itemHandle){
  if (ChartReportItemUtil.checkStringInExpression(expression)) {
    return new Object[]{true,DataType.TEXT_LITERAL};
  }
  Object[] returnObj=new Object[2];
  returnObj[0]=new Boolean(false);
  String columnName=getQueryStringForProcessing(expression);
  Iterator iterator=ChartReportItemUtil.getAllColumnBindingsIterator(itemHandle);
  while (iterator.hasNext()) {
    ComputedColumnHandle cc=(ComputedColumnHandle)iterator.next();
    if (cc.getName().equalsIgnoreCase(columnName)) {
      String dataType=cc.getDataType();
      if (dataType.equals(DesignChoiceConstants.COLUMN_DATA_TYPE_STRING)) {
        returnObj[0]=new Boolean(true);
        returnObj[1]=DataType.TEXT_LITERAL;
        break;
      }
 else       if (dataType.equals(DesignChoiceConstants.COLUMN_DATA_TYPE_DECIMAL) || dataType.equals(DesignChoiceConstants.COLUMN_DATA_TYPE_FLOAT) || dataType.equals(DesignChoiceConstants.COLUMN_DATA_TYPE_INTEGER)|| dataType.equals(DesignChoiceConstants.COLUMN_DATA_TYPE_BOOLEAN)) {
        returnObj[0]=new Boolean(true);
        returnObj[1]=DataType.NUMERIC_LITERAL;
        break;
      }
 else       if (dataType.equals(DesignChoiceConstants.COLUMN_DATA_TYPE_DATETIME) || dataType.equals(DesignChoiceConstants.COLUMN_DATA_TYPE_DATE) || dataType.equals(DesignChoiceConstants.COLUMN_DATA_TYPE_TIME)) {
        returnObj[0]=new Boolean(true);
        returnObj[1]=DataType.DATE_TIME_LITERAL;
        break;
      }
 else       if (dataType.equals(DesignChoiceConstants.COLUMN_DATA_TYPE_ANY)) {
        returnObj[0]=new Boolean(true);
        returnObj[1]=null;
        break;
      }
    }
  }
  return returnObj;
}