Program: 81671
Project: 81671
Buggy source:
public static Task buildTask_new(String url,String saveDir,Setting setting,JDialog window) throws SpiderException, WebClientException, ConnectTimeoutException, SocketTimeoutException {
  CreatingWindow creatingWindow=(CreatingWindow)window;
  Task task=new Task(url,saveDir);
  task.setId(UUID.randomUUID().toString());
  String host=url.substring(0,url.indexOf(setting.getGidPrefix()));
  System.out.println("String_Node_Str" + host);
  String gid=Spider.substring(url,setting.getGidPrefix()).substring(0,Spider.substring(url,setting.getGidPrefix()).indexOf("String_Node_Str"));
  String t=Spider.substring(url,gid + "String_Node_Str").substring(0,Spider.substring(url,gid + "String_Node_Str").length()).replaceAll("String_Node_Str","String_Node_Str");
  String hentaiHomeUrl=host + "String_Node_Str" + setting.getHentaiHome().getUri()+ "String_Node_Str"+ setting.getHentaiHome().getFirstParameterName()+ "String_Node_Str"+ gid+ "String_Node_Str"+ setting.getHentaiHome().getSecondParameterName()+ "String_Node_Str"+ t;
  System.out.println("String_Node_Str" + hentaiHomeUrl);
  String hentaiHomeSource=WebClient.postRequestWithCookie(hentaiHomeUrl,setting.getCookieInfo());
  String total_=Spider.getTextFromSource(hentaiHomeSource,setting.getTotalPrefix(),"String_Node_Str");
  System.out.println("String_Node_Str" + total_);
  String name=Spider.getTextFromSource(hentaiHomeSource,setting.getNamePrefix(),"String_Node_Str");
  System.out.println("String_Node_Str" + name);
  creatingWindow.nameLabel.setText(creatingWindow.nameLabel.getText() + name);
  creatingWindow.totalLabel.setText(creatingWindow.totalLabel.getText() + total_);
  creatingWindow.nameLabel.setVisible(true);
  creatingWindow.totalLabel.setVisible(true);
  String fileList=Spider.getTextFromSource(hentaiHomeSource,setting.getFileListPrefix(),setting.getFileListSuffix());
  int total=Integer.parseInt(total_.trim());
  creatingWindow.bar.setMaximum(total);
  task.setTotal(total);
  List<Picture> pictures=getPictures_new(host,setting,gid,fileList.trim(),task,creatingWindow);
  if (pictures.size() == 0) {
    pictures=getPictures(task,fileList,total);
  }
  task.setName(name);
  task.setSaveDir(saveDir + "String_Node_Str" + name);
  task.setPictures(pictures);
  return task;
}

Fixed version (ground truth):
public static Task buildTask_new(String url,String saveDir,Setting setting,JDialog window) throws SpiderException, WebClientException, ConnectTimeoutException, SocketTimeoutException {
  CreatingWindow creatingWindow=(CreatingWindow)window;
  Task task=new Task(url,saveDir);
  task.setId(UUID.randomUUID().toString());
  String host=url.substring(0,url.indexOf(setting.getGidPrefix()));
  System.out.println("String_Node_Str" + host);
  String gid=Spider.substring(url,setting.getGidPrefix()).substring(0,Spider.substring(url,setting.getGidPrefix()).indexOf("String_Node_Str"));
  String t=Spider.substring(url,gid + "String_Node_Str").substring(0,Spider.substring(url,gid + "String_Node_Str").length()).replaceAll("String_Node_Str","String_Node_Str");
  String hentaiHomeUrl=host + "String_Node_Str" + setting.getHentaiHome().getUri()+ "String_Node_Str"+ setting.getHentaiHome().getFirstParameterName()+ "String_Node_Str"+ gid+ "String_Node_Str"+ setting.getHentaiHome().getSecondParameterName()+ "String_Node_Str"+ t;
  System.out.println("String_Node_Str" + hentaiHomeUrl);
  String hentaiHomeSource=WebClient.postRequestWithCookie(hentaiHomeUrl,setting.getCookieInfo());
  String total_=Spider.getTextFromSource(hentaiHomeSource,setting.getTotalPrefix(),"String_Node_Str");
  System.out.println("String_Node_Str" + total_);
  String name=Spider.getTextFromSource(hentaiHomeSource,setting.getNamePrefix(),"String_Node_Str");
  System.out.println("String_Node_Str" + name);
  creatingWindow.nameLabel.setText(creatingWindow.nameLabel.getText() + name);
  creatingWindow.totalLabel.setText(creatingWindow.totalLabel.getText() + total_);
  creatingWindow.nameLabel.setVisible(true);
  creatingWindow.totalLabel.setVisible(true);
  String fileList=Spider.getTextFromSource(hentaiHomeSource,setting.getFileListPrefix(),setting.getFileListSuffix());
  int total=Integer.parseInt(total_.trim());
  creatingWindow.bar.setMaximum(total);
  task.setTotal(total);
  List<Picture> pictures=getPictures_new(host,setting,gid,fileList.trim(),task,creatingWindow);
  if (pictures.size() == 0) {
    pictures=getPictures(task,fileList,total);
    setPicturesUrl(url,pictures,setting,creatingWindow);
  }
  task.setName(name);
  task.setSaveDir(saveDir + "String_Node_Str" + name);
  task.setPictures(pictures);
  return task;
}