Program: 76949
Project: 76949
Buggy source:
/** 
 * Convert report parameter value object into string.
 * @param reportParameterObj report parameter value object.
 * @return parameter value in string.
 */
public String format(Object reportParameterObj){
  String reportParameterValue=null;
  if (reportParameterObj != null && locale != null) {
    if (reportParameterObj instanceof String) {
      StringFormatter sf=new StringFormatter(locale);
      if (format != null) {
        sf.applyPattern(format);
      }
      reportParameterValue=sf.format((String)reportParameterObj);
    }
 else     if (reportParameterObj instanceof Date) {
      DateFormatter df=new DateFormatter(locale);
      if (format != null) {
        df.applyPattern(format);
      }
      reportParameterValue=df.format((Date)reportParameterObj);
    }
 else     if (reportParameterObj instanceof Double) {
      NumberFormatter nf=new NumberFormatter(locale);
      if (format != null) {
        nf.applyPattern(format);
      }
      reportParameterValue=nf.format(((Double)reportParameterObj).doubleValue());
    }
 else     if (reportParameterObj instanceof BigDecimal) {
      NumberFormatter nf=new NumberFormatter(locale);
      if (format != null) {
        nf.applyPattern(format);
      }
      reportParameterValue=nf.format((BigDecimal)reportParameterObj);
    }
 else     if (reportParameterObj instanceof Boolean) {
      reportParameterValue=((Boolean)reportParameterObj).toString();
    }
 else     if (reportParameterObj instanceof Number) {
      NumberFormatter nf=new NumberFormatter(locale);
      if (format != null) {
        nf.applyPattern(format);
      }
      reportParameterValue=nf.format(((Number)reportParameterObj));
    }
 else {
      reportParameterValue=(reportParameterObj.toString());
    }
  }
  return reportParameterValue;
}

Fixed version (ground truth):
/** 
 * Convert report parameter value object into string.
 * @param reportParameterObj report parameter value object.
 * @return parameter value in string.
 */
public String format(Object reportParameterObj){
  String reportParameterValue=null;
  if (reportParameterObj != null && locale != null) {
    if (reportParameterObj instanceof String) {
      StringFormatter sf=new StringFormatter(ULocale.forLocale(locale));
      if (format != null) {
        sf.applyPattern(format);
      }
      reportParameterValue=sf.format((String)reportParameterObj);
    }
 else     if (reportParameterObj instanceof Date) {
      DateFormatter df=new DateFormatter(ULocale.forLocale(locale));
      if (format != null) {
        df.applyPattern(format);
      }
      reportParameterValue=df.format((Date)reportParameterObj);
    }
 else     if (reportParameterObj instanceof Double) {
      NumberFormatter nf=new NumberFormatter(ULocale.forLocale(locale));
      if (format != null) {
        nf.applyPattern(format);
      }
      reportParameterValue=nf.format(((Double)reportParameterObj).doubleValue());
    }
 else     if (reportParameterObj instanceof BigDecimal) {
      NumberFormatter nf=new NumberFormatter(ULocale.forLocale(locale));
      if (format != null) {
        nf.applyPattern(format);
      }
      reportParameterValue=nf.format((BigDecimal)reportParameterObj);
    }
 else     if (reportParameterObj instanceof Boolean) {
      reportParameterValue=((Boolean)reportParameterObj).toString();
    }
 else     if (reportParameterObj instanceof Number) {
      NumberFormatter nf=new NumberFormatter(ULocale.forLocale(locale));
      if (format != null) {
        nf.applyPattern(format);
      }
      reportParameterValue=nf.format(((Number)reportParameterObj));
    }
 else {
      reportParameterValue=(reportParameterObj.toString());
    }
  }
  return reportParameterValue;
}