Program: 80387
Project: 80387
Buggy source:
public void render(HttpServletRequest req,HttpServletResponse resp,Object obj) throws Throwable {
  if (resp.getContentType() == null)   resp.setContentType(contentType);
  if (obj == null)   return;
  if (obj instanceof File) {
    File file=(File)obj;
    if (log.isDebugEnabled())     log.debug("String_Node_Str" + file.getAbsolutePath());
    if (!file.exists() && file.isDirectory()) {
      resp.sendError(404);
      return;
    }
    file=file.getAbsoluteFile();
    String filename=URLEncoder.encode(file.getName(),Encoding.UTF8);
    resp.setHeader("String_Node_Str","String_Node_Str" + filename + "String_Node_Str");
    resp.setHeader("String_Node_Str","String_Node_Str" + file.length());
    Streams.writeAndClose(resp.getOutputStream(),Streams.fileIn(file));
  }
 else   if (obj instanceof byte[]) {
    resp.setHeader("String_Node_Str","String_Node_Str" + ((byte[])obj).length);
    Streams.writeAndClose(resp.getOutputStream(),(byte[])obj);
  }
 else   if (obj instanceof char[]) {
    Writer writer=resp.getWriter();
    writer.write((char[])obj);
    writer.flush();
  }
 else   if (obj instanceof Reader) {
    Streams.writeAndClose(resp.getWriter(),(Reader)obj);
  }
 else   if (obj instanceof InputStream) {
    Streams.writeAndClose(resp.getOutputStream(),(InputStream)obj);
  }
 else {
    byte[] data=String.valueOf(obj).getBytes(Encoding.UTF8);
    resp.setHeader("String_Node_Str","String_Node_Str" + data.length);
    Streams.writeAndClose(resp.getOutputStream(),data);
  }
}

Fixed version (ground truth):
public void render(HttpServletRequest req,HttpServletResponse resp,Object obj) throws Throwable {
  if (resp.getContentType() == null)   resp.setContentType(contentType);
  if (obj == null)   return;
  if (obj instanceof File) {
    File file=(File)obj;
    long fileSz=file.length();
    if (log.isDebugEnabled())     log.debug("String_Node_Str" + file.getAbsolutePath());
    if (!file.exists() || file.isDirectory()) {
      resp.sendError(404);
      return;
    }
    String filename=URLEncoder.encode(file.getName(),Encoding.UTF8);
    resp.setHeader("String_Node_Str","String_Node_Str" + filename + "String_Node_Str");
    String rangeStr=req.getHeader("String_Node_Str");
    if (DISABLE_RANGE_DOWNLOAD || fileSz == 0 || (rangeStr == null || !rangeStr.startsWith("String_Node_Str") || rangeStr.length() < "String_Node_Str".length())) {
      resp.setHeader("String_Node_Str","String_Node_Str" + fileSz);
      Streams.writeAndClose(resp.getOutputStream(),Streams.fileIn(file));
    }
 else {
      List<RangeRange> rs=new ArrayList<RawView.RangeRange>();
      if (!parseRange(rangeStr,rs,fileSz)) {
        resp.setStatus(416);
        return;
      }
      if (rs.size() != 1) {
        log.info("String_Node_Str");
        resp.setStatus(416);
        return;
      }
      long totolSize=0;
      for (      RangeRange rangeRange : rs) {
        totolSize+=(rangeRange.end - rangeRange.start);
      }
      resp.setStatus(206);
      resp.setHeader("String_Node_Str","String_Node_Str" + totolSize);
      resp.setHeader("String_Node_Str","String_Node_Str");
      RangeRange rangeRange=rs.get(0);
      resp.setHeader("String_Node_Str",String.format("String_Node_Str",rangeRange.start,rangeRange.end - 1,fileSz));
      writeFileRange(file,resp.getOutputStream(),rangeRange);
    }
  }
 else   if (obj instanceof byte[]) {
    resp.setHeader("String_Node_Str","String_Node_Str" + ((byte[])obj).length);
    Streams.writeAndClose(resp.getOutputStream(),(byte[])obj);
  }
 else   if (obj instanceof char[]) {
    Writer writer=resp.getWriter();
    writer.write((char[])obj);
    writer.flush();
  }
 else   if (obj instanceof Reader) {
    Streams.writeAndClose(resp.getWriter(),(Reader)obj);
  }
 else   if (obj instanceof InputStream) {
    Streams.writeAndClose(resp.getOutputStream(),(InputStream)obj);
  }
 else {
    byte[] data=String.valueOf(obj).getBytes(Encoding.UTF8);
    resp.setHeader("String_Node_Str","String_Node_Str" + data.length);
    Streams.writeAndClose(resp.getOutputStream(),data);
  }
}