Program: 99291
Project: 99291
Buggy source:
@Override public void renderResource(HttpServletRequest httpRequest,HttpServletResponse httpResponse,WaybackRequest wbRequest,CaptureSearchResult result,Resource resource,ResultURIConverter uriConverter,CaptureSearchResults results) throws ServletException, IOException, WaybackException {
  String u=wbRequest.getRequestUrl();
  SimpleDateFormat httpformatterl=new SimpleDateFormat("String_Node_Str");
  TimeZone tzo=TimeZone.getTimeZone("String_Node_Str");
  httpformatterl.setTimeZone(tzo);
  SimpleDateFormat formatterk=new SimpleDateFormat("String_Node_Str");
  formatterk.setTimeZone(tzo);
  Properties apProps=wbRequest.getAccessPoint().getConfigs();
  Date closestDate=result.getCaptureDate();
  String uriPrefix=wbRequest.getAccessPoint().getReplayPrefix();
  String agguri=apProps.getProperty("String_Node_Str") + "String_Node_Str" + u;
  String timemap="String_Node_Str" + apProps.getProperty("String_Node_Str") + "String_Node_Str"+ u+ "String_Node_Str";
  String timegate="String_Node_Str" + uriPrefix + "String_Node_Str"+ u+ "String_Node_Str";
  Date f=results.getFirstResultDate();
  Date l=results.getLastResultDate();
  StringBuffer sb=new StringBuffer();
  httpResponse.setHeader("String_Node_Str",httpformatterl.format(result.getCaptureDate()));
  String memento="String_Node_Str" + uriPrefix + formatterk.format(closestDate)+ "String_Node_Str"+ u+ "String_Node_Str"+ httpformatterl.format(closestDate)+ "String_Node_Str";
  String mfl=null;
  if ((closestDate.equals(f)) && closestDate.equals(l)) {
    mfl="String_Node_Str" + uriPrefix + formatterk.format(f)+ "String_Node_Str"+ u+ "String_Node_Str"+ httpformatterl.format(f)+ "String_Node_Str";
  }
 else   if (closestDate.equals(f)) {
    mfl="String_Node_Str" + uriPrefix + formatterk.format(f)+ "String_Node_Str"+ u+ "String_Node_Str"+ httpformatterl.format(f)+ "String_Node_Str";
    mfl=mfl + "String_Node_Str" + uriPrefix+ formatterk.format(l)+ "String_Node_Str"+ u+ "String_Node_Str"+ httpformatterl.format(l)+ "String_Node_Str";
  }
 else   if (closestDate.equals(l)) {
    mfl="String_Node_Str" + uriPrefix + formatterk.format(l)+ "String_Node_Str"+ u+ "String_Node_Str"+ httpformatterl.format(l)+ "String_Node_Str";
    mfl=mfl + "String_Node_Str" + uriPrefix+ formatterk.format(f)+ "String_Node_Str"+ u+ "String_Node_Str"+ httpformatterl.format(f)+ "String_Node_Str";
  }
 else {
    mfl=memento;
    mfl=mfl + "String_Node_Str" + uriPrefix+ formatterk.format(l)+ "String_Node_Str"+ u+ "String_Node_Str"+ httpformatterl.format(l)+ "String_Node_Str";
    mfl=mfl + "String_Node_Str" + uriPrefix+ formatterk.format(f)+ "String_Node_Str"+ u+ "String_Node_Str"+ httpformatterl.format(f)+ "String_Node_Str";
  }
  sb=new StringBuffer(mfl);
  CaptureSearchResult closestleft=null;
  CaptureSearchResult closestright=null;
  long rclosestDistance=0;
  long lclosestDistance=0;
  CaptureSearchResult cur=null;
  long wantTime=closestDate.getTime();
  Iterator<CaptureSearchResult> itr=results.iterator();
  while (itr.hasNext()) {
    cur=itr.next();
    cur.getCaptureDate();
    long curDistance=cur.getCaptureDate().getTime() - wantTime;
    if (curDistance > 0) {
      if ((closestright == null) || (Math.abs(curDistance) < Math.abs(rclosestDistance))) {
        closestright=cur;
        rclosestDistance=Math.abs(curDistance);
      }
    }
    if (curDistance < 0) {
      if ((closestleft == null) || (Math.abs(curDistance) < Math.abs(lclosestDistance))) {
        closestleft=cur;
        lclosestDistance=Math.abs(curDistance);
      }
    }
  }
  if (closestleft != null) {
    if (!(closestleft.getCaptureDate().equals(f))) {
      sb.append("String_Node_Str" + uriPrefix + formatterk.format(closestleft.getCaptureDate())+ "String_Node_Str"+ u+ "String_Node_Str"+ httpformatterl.format(closestleft.getCaptureDate())+ "String_Node_Str");
    }
 else {
      int m_index=sb.lastIndexOf("String_Node_Str");
      sb.insert(m_index + 1,"String_Node_Str");
    }
  }
  if (closestright != null) {
    if (!(closestright.getCaptureDate().equals(l))) {
      sb.append("String_Node_Str" + uriPrefix + formatterk.format(closestright.getCaptureDate())+ "String_Node_Str"+ u+ "String_Node_Str"+ httpformatterl.format(closestright.getCaptureDate())+ "String_Node_Str");
    }
 else {
      int m_index=sb.lastIndexOf("String_Node_Str");
      sb.insert(m_index + 1,"String_Node_Str");
    }
  }
  String origlink="String_Node_Str" + u + "String_Node_Str";
  httpResponse.setHeader("String_Node_Str","String_Node_Str" + agguri + "String_Node_Str"+ origlink+ sb.toString()+ timemap+ timegate);
  decorated.renderResource(httpRequest,httpResponse,wbRequest,result,resource,uriConverter,results);
}

Fixed version (ground truth):
@Override public void renderResource(HttpServletRequest httpRequest,HttpServletResponse httpResponse,WaybackRequest wbRequest,CaptureSearchResult result,Resource resource,ResultURIConverter uriConverter,CaptureSearchResults results) throws ServletException, IOException, WaybackException {
  this.renderResource(httpRequest,httpResponse,wbRequest,result,resource,resource,uriConverter,results);
}