Program: 68847
Project: 68847
Buggy source:
protected String format(Object value,IStyle style){
  if (value instanceof Object[]) {
    Object[] values=(Object[])value;
    if (values.length > 0) {
      value=values[0];
    }
 else {
      value=null;
    }
  }
  if (value == null) {
    return null;
  }
  DataFormatValue dataFormat=style.getDataFormat();
  String pattern=null;
  String locale=null;
  if (value instanceof Number) {
    if (dataFormat != null) {
      pattern=dataFormat.getNumberPattern();
      locale=dataFormat.getNumberLocale();
    }
    NumberFormatter fmt=context.getNumberFormatter(pattern,locale);
    return fmt.format((Number)value);
  }
  if (value instanceof String) {
    if (dataFormat != null) {
      pattern=dataFormat.getStringPattern();
      locale=dataFormat.getStringLocale();
    }
    StringFormatter fmt=context.getStringFormatter(pattern,locale);
    return fmt.format((String)value);
  }
  if (value instanceof java.util.Date) {
    if (dataFormat != null) {
      if (value instanceof java.sql.Date) {
        pattern=dataFormat.getDatePattern();
        locale=dataFormat.getDateLocale();
      }
 else       if (value instanceof java.sql.Time) {
        pattern=dataFormat.getTimePattern();
        locale=dataFormat.getTimeLocale();
      }
      if (pattern == null && locale == null) {
        pattern=dataFormat.getDateTimePattern();
        locale=dataFormat.getDateTimeLocale();
      }
    }
    DateFormatter fmt=context.getDateFormatter(pattern,locale);
    return fmt.format((java.util.Date)value);
  }
  if (value instanceof byte[]) {
    byte[] bytes=(byte[])value;
    int length=(bytes.length <= 8 ? bytes.length : 8);
    StringBuffer buffer=new StringBuffer();
    int index=0;
    while (index < length) {
      byte byteValue=bytes[index];
      int lowValue=byteValue & 0x0F;
      int highValue=(byteValue >> 4) & 0x0F;
      buffer.append(HEX[highValue]).append(HEX[lowValue]).append(' ');
      index++;
    }
    if (length > 0) {
      if (length != bytes.length) {
        buffer.append("String_Node_Str");
      }
 else {
        buffer.setLength(buffer.length() - 1);
      }
    }
    return buffer.toString();
  }
  return value.toString();
}

Fixed version (ground truth):
protected String format(Object value,IStyle style){
  if (value instanceof Object[]) {
    Object[] values=(Object[])value;
    StringBuilder sb=new StringBuilder();
    sb.append('[');
    for (    Object v : values) {
      sb.append(format(v,style));
      sb.append("String_Node_Str");
    }
    if (sb.length() > 1) {
      sb.setLength(sb.length() - 2);
    }
    sb.append(']');
    return sb.toString();
  }
  if (value == null) {
    return null;
  }
  DataFormatValue dataFormat=style.getDataFormat();
  String pattern=null;
  String locale=null;
  if (value instanceof Number) {
    if (dataFormat != null) {
      pattern=dataFormat.getNumberPattern();
      locale=dataFormat.getNumberLocale();
    }
    NumberFormatter fmt=context.getNumberFormatter(pattern,locale);
    return fmt.format((Number)value);
  }
  if (value instanceof String) {
    if (dataFormat != null) {
      pattern=dataFormat.getStringPattern();
      locale=dataFormat.getStringLocale();
    }
    StringFormatter fmt=context.getStringFormatter(pattern,locale);
    return fmt.format((String)value);
  }
  if (value instanceof java.util.Date) {
    if (dataFormat != null) {
      if (value instanceof java.sql.Date) {
        pattern=dataFormat.getDatePattern();
        locale=dataFormat.getDateLocale();
      }
 else       if (value instanceof java.sql.Time) {
        pattern=dataFormat.getTimePattern();
        locale=dataFormat.getTimeLocale();
      }
      if (pattern == null && locale == null) {
        pattern=dataFormat.getDateTimePattern();
        locale=dataFormat.getDateTimeLocale();
      }
    }
    DateFormatter fmt=context.getDateFormatter(pattern,locale);
    return fmt.format((java.util.Date)value);
  }
  if (value instanceof byte[]) {
    byte[] bytes=(byte[])value;
    int length=(bytes.length <= 8 ? bytes.length : 8);
    StringBuffer buffer=new StringBuffer();
    int index=0;
    while (index < length) {
      byte byteValue=bytes[index];
      int lowValue=byteValue & 0x0F;
      int highValue=(byteValue >> 4) & 0x0F;
      buffer.append(HEX[highValue]).append(HEX[lowValue]).append(' ');
      index++;
    }
    if (length > 0) {
      if (length != bytes.length) {
        buffer.append("String_Node_Str");
      }
 else {
        buffer.setLength(buffer.length() - 1);
      }
    }
    return buffer.toString();
  }
  return value.toString();
}