Program: 73710
Project: 73710
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);
  Iterator iterator=getAllColumnBindingsIterator();
  while (iterator.hasNext()) {
    ComputedColumnHandle cc=(ComputedColumnHandle)iterator.next();
    if (expression.toUpperCase().indexOf(cc.getName().toUpperCase()) >= 0) {
      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){
  Object[] returnObj=new Object[2];
  returnObj[0]=new Boolean(false);
  Iterator iterator=ChartReportItemUtil.getAllColumnBindingsIterator(itemHandle);
  while (iterator.hasNext()) {
    ComputedColumnHandle cc=(ComputedColumnHandle)iterator.next();
    if (expression.toUpperCase().indexOf(cc.getName().toUpperCase()) >= 0) {
      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;
}