nus-yam/ex-repair huggingface dataset:
Program: 21060
Project: 21060
Buggy source:
@Override public AvailableStatus requestFileInformation(DownloadLink link) throws IOException, PluginException {
  this.setBrowserExclusive();
  br.getPage(link.getDownloadURL());
  if (br.containsHTML("String_Node_Str"))   throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);
  Regex reg=br.getRegex("String_Node_Str");
  String filesize=reg.getMatch(1);
  String filename0=reg.getMatch(0);
  if (filename0 == null || filesize == null)   throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);
  String filename=filename0.replaceAll("String_Node_Str","String_Node_Str");
  link.setName(filename);
  link.setDownloadSize(Regex.getSize(filesize));
  return AvailableStatus.TRUE;
}

Fixed version (ground truth):
@Override public AvailableStatus requestFileInformation(DownloadLink link) throws IOException, PluginException {
  this.setBrowserExclusive();
  br.getHeaders().put("String_Node_Str",RandomUserAgent.generate());
  br.getPage(link.getDownloadURL());
  if (br.containsHTML("String_Node_Str"))   throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);
  Regex reg=br.getRegex("String_Node_Str");
  String filesize=reg.getMatch(1);
  String filename0=reg.getMatch(0);
  if (filename0 == null || filesize == null)   throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);
  String filename=filename0.replaceAll("String_Node_Str","String_Node_Str");
  link.setName(filename);
  link.setDownloadSize(Regex.getSize(filesize));
  return AvailableStatus.TRUE;
}
Program: 21061
Project: 21061
Buggy source:
public void actionPerformed(ActionEvent e){
  if (e.getSource() == menuItem) {
    menuItem.setSelected(!menuItem.isSelected());
    if (menuItem.isSelected()) {
      UserIO.getInstance().requestMessageDialog(JDL.L("String_Node_Str","String_Node_Str"));
    }
 else {
      UserIO.getInstance().requestMessageDialog(JDL.L("String_Node_Str","String_Node_Str"));
    }
  }
}

Fixed version (ground truth):
public void actionPerformed(ActionEvent e){
  if (e.getSource() == menuItem) {
    if (menuItem.isSelected()) {
      UserIO.getInstance().requestMessageDialog(JDL.L("String_Node_Str","String_Node_Str"));
    }
 else {
      UserIO.getInstance().requestMessageDialog(JDL.L("String_Node_Str","String_Node_Str"));
    }
  }
}
Program: 21064
Project: 21064
Buggy source:
private String prepareToSend(String trim){
  String dest=subConfig.getStringProperty(PARAM_DESLANGUAGE,map.get(System.getProperty("String_Node_Str")));
  if (subConfig.getBooleanProperty(PARAM_DOAUTOTRANSLATSELF,false) && dest != null) {
    for (    String next : map.keySet()) {
      if (map.get(next).equals(dest)) {
        trim=JDL.translate(next,trim);
        String tmp=JDL.translate(next,trim);
        if (!tmp.equalsIgnoreCase(trim)) {
          tmp+="String_Node_Str" + trim + "String_Node_Str";
          trim=tmp;
        }
        break;
      }
    }
  }
  return trim;
}

Fixed version (ground truth):
private String prepareToSend(String trim){
  JDLocale dest=subConfig.getGenericProperty(PARAM_DESLANGUAGE,new JDLocale("String_Node_Str"));
  if (subConfig.getBooleanProperty(PARAM_DOAUTOTRANSLATSELF,false) && dest != null) {
    for (    JDLocale loc : lngmap) {
      if (loc.getLanguageCode().equalsIgnoreCase(dest.getLanguageCode())) {
        String tmp=JDL.translate(loc.getLanguageCode(),trim);
        if (tmp != null && !tmp.equalsIgnoreCase(trim)) {
          tmp+="String_Node_Str" + trim + "String_Node_Str";
          trim=tmp;
        }
        break;
      }
    }
  }
  return trim;
}
Program: 21065
Project: 21065
Buggy source:
public AvailableStatus requestFileInformation(DownloadLink downloadLink) throws IOException, PluginException {
  this.setBrowserExclusive();
  br.setCookie("String_Node_Str","String_Node_Str","String_Node_Str");
  br.getPage(downloadLink.getDownloadURL());
  if (br.containsHTML("String_Node_Str"))   throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);
  String filename=Encoding.htmlDecode(br.getRegex("String_Node_Str").getMatch(0));
  String filesize=br.getRegex("String_Node_Str").getMatch(0);
  if (filename == null || filesize == null)   throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);
  downloadLink.setName(filename.trim());
  downloadLink.setDownloadSize(Regex.getSize(filesize));
  return AvailableStatus.TRUE;
}

Fixed version (ground truth):
public AvailableStatus requestFileInformation(DownloadLink downloadLink) throws IOException, PluginException {
  this.setBrowserExclusive();
  br.setCookie("String_Node_Str","String_Node_Str","String_Node_Str");
  br.getPage(downloadLink.getDownloadURL());
  if (br.containsHTML("String_Node_Str"))   throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);
  if (br.containsHTML("String_Node_Str"))   throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);
  if (br.containsHTML("String_Node_Str"))   throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);
  String filename=Encoding.htmlDecode(br.getRegex("String_Node_Str").getMatch(0));
  String filesize=br.getRegex("String_Node_Str").getMatch(0);
  if (filename == null || filesize == null)   throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);
  downloadLink.setName(filename.trim());
  downloadLink.setDownloadSize(Regex.getSize(filesize));
  return AvailableStatus.TRUE;
}
Program: 21066
Project: 21066
Buggy source:
public int getMaxSimultanFreeDownloadNum(){
  return 10;
}

Fixed version (ground truth):
public int getMaxSimultanFreeDownloadNum(){
  return 20;
}
Program: 21067
Project: 21067
Buggy source:
public static String toRapidshareComPremium(File file,String userid,String pass){
  try {
    Browser br=new Browser();
    String[] data=br.getPage("String_Node_Str").split("String_Node_Str");
    PostFormDataRequest r=(PostFormDataRequest)br.createPostFormDataRequest("String_Node_Str" + data[0].trim() + "String_Node_Str");
    r.addFormData(new FormData("String_Node_Str","String_Node_Str"));
    r.addFormData(new FormData("String_Node_Str",file.getName(),file));
    r.addFormData(new FormData("String_Node_Str",userid));
    r.addFormData(new FormData("String_Node_Str",pass));
    r.connect();
    String code=r.read();
    System.out.println(code);
    String[] lines=Regex.getLines(code);
    return lines[1];
  }
 catch (  Exception e) {
    JDLogger.exception(e);
    return null;
  }
}

Fixed version (ground truth):
public static String toRapidshareComPremium(File file,String userid,String pass){
  try {
    Browser br=new Browser();
    String[] data=br.getPage("String_Node_Str").split("String_Node_Str");
    PostFormDataRequest r=(PostFormDataRequest)br.createPostFormDataRequest("String_Node_Str" + data[0].trim() + "String_Node_Str");
    r.addFormData(new FormData("String_Node_Str","String_Node_Str"));
    r.addFormData(new FormData("String_Node_Str",file.getName(),file));
    r.addFormData(new FormData("String_Node_Str",userid));
    r.addFormData(new FormData("String_Node_Str",pass));
    br.openRequestConnection(r);
    String code=r.read();
    System.out.println(code);
    String[] lines=Regex.getLines(code);
    return lines[1];
  }
 catch (  Exception e) {
    JDLogger.exception(e);
    return null;
  }
}
Program: 21069
Project: 21069
Buggy source:
public void setIcon(String key){
  putValue(IMAGE_KEY,key);
  putValue(AbstractAction.SMALL_ICON,JDTheme.II(key,24,24));
}

Fixed version (ground truth):
public void setIcon(String key){
  if (key.length() < 3)   return;
  putValue(AbstractAction.SMALL_ICON,JDTheme.II(key,24,24));
  putValue(IMAGE_KEY,key);
}
Program: 21070
Project: 21070
Buggy source:
public LinkgrabberView(){
  super();
  this.setContent(LinkGrabberPanel.getLinkGrabber());
  this.setDefaultInfoPanel(new LinkGrabberInfoPanel());
  ViewToolbar toolbar=new ViewToolbar();
  toolbar.setList(new String[]{"String_Node_Str","String_Node_Str"});
  this.setToolBar(toolbar);
  ael=new AWTEventListener(){
    public void eventDispatched(    AWTEvent event){
      if (event.getID() == KeyEvent.KEY_TYPED) {
        char keycode=((KeyEvent)event).getKeyChar();
        if (keycode == '\r' || keycode == '\n') {
          LinkGrabberPanel.getLinkGrabber().confirmButton.doClick(500);
        }
      }
    }
  }
;
  LinkGrabberController.getInstance().addListener(new LinkGrabberControllerListener(){
    public void onLinkGrabberControllerEvent(    LinkGrabberControllerEvent event){
switch (event.getID()) {
case LinkGrabberControllerEvent.ADDED:
        JDGui.getInstance().requestPanel(UserIF.Panels.DOWNLOADLIST,null);
      break;
  }
}
}
);
}

Fixed version (ground truth):
public LinkgrabberView(){
  super();
  this.setContent(LinkGrabberPanel.getLinkGrabber());
  this.setDefaultInfoPanel(new LinkGrabberInfoPanel());
  ViewToolbar toolbar=new ViewToolbar();
  toolbar.setList(new String[]{"String_Node_Str","String_Node_Str"});
  this.setToolBar(toolbar);
  LinkGrabberController.getInstance().addListener(new LinkGrabberControllerListener(){
    public void onLinkGrabberControllerEvent(    LinkGrabberControllerEvent event){
switch (event.getID()) {
case LinkGrabberControllerEvent.ADDED:
        JDGui.getInstance().requestPanel(UserIF.Panels.DOWNLOADLIST,null);
      break;
  }
}
}
);
}
Program: 21071
Project: 21071
Buggy source:
@Override protected void onShow(){
  Toolkit.getDefaultToolkit().addAWTEventListener(ael,AWTEvent.KEY_EVENT_MASK);
}

Fixed version (ground truth):
@Override protected void onShow(){
}
Program: 21072
Project: 21072
Buggy source:
@Override protected void onHide(){
  Toolkit.getDefaultToolkit().removeAWTEventListener(ael);
}

Fixed version (ground truth):
@Override protected void onHide(){
}
Program: 21073
Project: 21073
Buggy source:
public void setDefaults(int i,AbstractButton ab){
  if (i == 0) {
    ab.setContentAreaFilled(false);
    ab.setText("String_Node_Str");
  }
 else {
    ab.getAction().putValue(Action.ACCELERATOR_KEY,KeyStroke.getKeyStroke(KeyEvent.VK_ENTER,InputEvent.CTRL_DOWN_MASK));
    confirmButton=ab;
  }
}

Fixed version (ground truth):
public void setDefaults(int i,AbstractButton ab){
  if (i == 0) {
    ab.setContentAreaFilled(false);
    ab.setText("String_Node_Str");
  }
 else {
    confirmButton=ab;
  }
}
Program: 21074
Project: 21074
Buggy source:
public static JFrame getDialogParent(){
  if (SwingGui.getInstance() != null)   return SwingGui.getInstance().getMainFrame();
  return new DummyFrame();
}

Fixed version (ground truth):
public static JFrame getDialogParent(){
  if (SwingGui.getInstance() != null)   return SwingGui.getInstance().getMainFrame();
  if (PARENT == null)   PARENT=new DummyFrame();
  return PARENT;
}
Program: 21075
Project: 21075
Buggy source:
public boolean isSelected(){
  return (Boolean)getValue(SELECTED_KEY);
}

Fixed version (ground truth):
public boolean isSelected(){
  Object value=getValue(SELECTED_KEY);
  if (value == null)   return false;
  return (Boolean)value;
}
Program: 21076
Project: 21076
Buggy source:
@Override public void setContent(SwitchPanel tabbedPanel){
  TabbedPanelView view=new TabbedPanelView(tabbedPanel);
  if (!mainTabbedPane.contains(view)) {
    mainTabbedPane.addTab(view);
  }
  mainTabbedPane.setSelectedComponent(view);
}

Fixed version (ground truth):
@Override public void setContent(SwitchPanel tabbedPanel){
  View view;
  if (tabbedPanel instanceof View) {
    view=(View)tabbedPanel;
  }
 else {
    view=new TabbedPanelView(tabbedPanel);
  }
  if (!mainTabbedPane.contains(view)) {
    mainTabbedPane.addTab(view);
  }
  mainTabbedPane.setSelectedComponent(view);
}
Program: 21077
Project: 21077
Buggy source:
public void handleFree(DownloadLink downloadLink) throws Exception {
  requestFileInformation(downloadLink);
  if (br.containsHTML(IP_BLOCKED_MSG1) || br.containsHTML(IP_BLOCKED_MSG2)) {
    throw new PluginException(LinkStatus.ERROR_IP_BLOCKED);
  }
  String linkurl=br.getRegex("String_Node_Str").getMatch(0);
  if (linkurl == null) {
    throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFEKT);
  }
  br.setFollowRedirects(false);
  dl=br.openDownload(downloadLink,linkurl,false,1);
  if (dl.getConnection().isContentDisposition()) {
    dl.getConnection().disconnect();
    throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);
  }
  URLConnectionAdapter con=dl.getConnection();
  if (con.getResponseCode() != 200 && con.getResponseCode() != 206) {
    con.disconnect();
    throw new PluginException(LinkStatus.ERROR_TEMPORARILY_UNAVAILABLE,30 * 1000l);
  }
  dl.startDownload();
}

Fixed version (ground truth):
public void handleFree(DownloadLink downloadLink) throws Exception {
  requestFileInformation(downloadLink);
  if (br.containsHTML(IP_BLOCKED_MSG1) || br.containsHTML(IP_BLOCKED_MSG2)) {
    throw new PluginException(LinkStatus.ERROR_IP_BLOCKED);
  }
  String linkurl=br.getRegex("String_Node_Str").getMatch(0);
  if (linkurl == null) {
    throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFEKT);
  }
  br.setFollowRedirects(false);
  dl=br.openDownload(downloadLink,linkurl,false,1);
  if (!(dl.getConnection().isContentDisposition())) {
    dl.getConnection().disconnect();
    throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);
  }
  URLConnectionAdapter con=dl.getConnection();
  if (con.getResponseCode() != 200 && con.getResponseCode() != 206) {
    con.disconnect();
    throw new PluginException(LinkStatus.ERROR_TEMPORARILY_UNAVAILABLE,30 * 1000l);
  }
  dl.startDownload();
}
Program: 21079
Project: 21079
Buggy source:
public AvailableStatus requestFileInformation(DownloadLink parameter) throws Exception {
  this.setBrowserExclusive();
  br.getPage(parameter.getDownloadURL());
  if (br.containsHTML("String_Node_Str"))   throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);
  String filename=br.getRegex("String_Node_Str").getMatch(0);
  String filesize=br.getRegex("String_Node_Str").getMatch(0);
  if (filename == null || filesize == null)   throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);
  parameter.setName(filename.trim());
  parameter.setDownloadSize(Regex.getSize(filesize));
  return AvailableStatus.TRUE;
}

Fixed version (ground truth):
public AvailableStatus requestFileInformation(DownloadLink parameter) throws Exception {
  this.setBrowserExclusive();
  br.getPage(parameter.getDownloadURL());
  if (br.containsHTML("String_Node_Str"))   throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);
  if (br.containsHTML("String_Node_Str"))   throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);
  String filename=br.getRegex("String_Node_Str").getMatch(0);
  String filesize=br.getRegex("String_Node_Str").getMatch(0);
  if (filename == null || filesize == null)   throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);
  parameter.setName(filename.trim());
  parameter.setDownloadSize(Regex.getSize(filesize));
  return AvailableStatus.TRUE;
}
Program: 21080
Project: 21080
Buggy source:
/** 
 * returns permissionmask, ?, user?, group?, size?, date, name
 * @return
 * @throws IOException
 */
public String[][] list() throws IOException {
  InetSocketAddress pasv=pasv();
  sendLine("String_Node_Str");
  Socket dataSocket=new Socket(pasv.getHostName(),pasv.getPort());
  BufferedReader input=new BufferedReader(new InputStreamReader(dataSocket.getInputStream(),"String_Node_Str"));
  StringBuilder sb=new StringBuilder();
  String response=readLine();
  if (!response.startsWith("String_Node_Str")) {
    throw new IOException("String_Node_Str" + response);
  }
  char[] buffer=new char[4096];
  int bytesRead=0;
  while ((bytesRead=input.read(buffer)) != -1) {
    sb.append(buffer,0,bytesRead);
  }
  input.close();
  response=readLine();
  String[][] matches=new Regex(sb.toString(),"String_Node_Str").getMatches();
  return matches;
}

Fixed version (ground truth):
/** 
 * returns permissionmask, ?, user?, group?, size?, date, name
 * @return
 * @throws IOException
 */
public String[][] list() throws IOException {
  InetSocketAddress pasv=pasv();
  sendLine("String_Node_Str");
  Socket dataSocket=new Socket(pasv.getHostName(),pasv.getPort());
  BufferedReader input=new BufferedReader(new InputStreamReader(dataSocket.getInputStream(),"String_Node_Str"));
  StringBuilder sb=new StringBuilder();
  String response=readLine();
  if (!response.startsWith("String_Node_Str")) {
    throw new IOException("String_Node_Str" + response);
  }
  char[] buffer=new char[4096];
  int bytesRead=0;
  while ((bytesRead=input.read(buffer)) != -1) {
    sb.append(buffer,0,bytesRead);
  }
  input.close();
  shutDownSocket(dataSocket);
  response=readLine();
  String[][] matches=new Regex(sb.toString(),"String_Node_Str").getMatches();
  return matches;
}
Program: 21082
Project: 21082
Buggy source:
/** 
 * Setzt den Status der Downloadliste zurück. zB. bei einem Abbruch
 */
private void clearDownloadListStatus(){
  ArrayList<DownloadLink> links=new ArrayList<DownloadLink>(DownloadControllers.keySet());
  for (  DownloadLink link : links) {
    this.deactivateDownload(link);
  }
  PluginForHost.resetStatics();
  ArrayList<FilePackage> fps;
  fps=dlc.getPackages();
synchronized (fps) {
    for (    FilePackage filePackage : fps) {
      links=filePackage.getDownloadLinkList();
      for (int i=0; i < links.size(); i++) {
        if (!links.get(i).getLinkStatus().hasStatus(LinkStatus.FINISHED)) {
          links.get(i).getLinkStatus().setStatusText(null);
          links.get(i).setAborted(false);
          links.get(i).getLinkStatus().setStatus(LinkStatus.TODO);
          links.get(i).getLinkStatus().resetWaitTime();
        }
      }
    }
  }
  DownloadController.getInstance().fireGlobalUpdate();
}

Fixed version (ground truth):
/** 
 * Setzt den Status der Downloadliste zurück. zB. bei einem Abbruch
 */
private void clearDownloadListStatus(){
  ArrayList<DownloadLink> links=new ArrayList<DownloadLink>(DownloadControllers.keySet());
  for (  DownloadLink link : links) {
    this.deactivateDownload(link);
  }
  PluginForHost.resetStatics();
  ArrayList<FilePackage> fps;
  fps=dlc.getPackages();
synchronized (fps) {
    for (    FilePackage filePackage : fps) {
      links=filePackage.getDownloadLinkList();
      for (int i=0; i < links.size(); i++) {
        if (!links.get(i).getLinkStatus().isFinished()) {
          links.get(i).getLinkStatus().setStatusText(null);
          links.get(i).setAborted(false);
          links.get(i).getLinkStatus().setStatus(LinkStatus.TODO);
          links.get(i).getLinkStatus().resetWaitTime();
        }
      }
    }
  }
  DownloadController.getInstance().fireGlobalUpdate();
}
Program: 21083
Project: 21083
Buggy source:
public DownloadLink getDownloadLinkByFileOutput(File file,Integer Linkstatus){
  ArrayList<FilePackage> packages=JDUtilities.getDownloadController().getPackages();
  try {
    Iterator<FilePackage> iterator=packages.iterator();
    FilePackage fp=null;
    DownloadLink nextDownloadLink;
    while (iterator.hasNext()) {
      fp=iterator.next();
      Iterator<DownloadLink> it2=fp.getDownloadLinkList().iterator();
      while (it2.hasNext()) {
        nextDownloadLink=it2.next();
        if (new File(nextDownloadLink.getFileOutput()).getAbsoluteFile().equals(file.getAbsoluteFile())) {
          if (Linkstatus != null) {
            if (nextDownloadLink.getLinkStatus().hasStatus(Linkstatus))             return nextDownloadLink;
          }
 else           return nextDownloadLink;
        }
      }
    }
  }
 catch (  Exception e) {
    JDLogger.exception(e);
  }
  return null;
}

Fixed version (ground truth):
public DownloadLink getDownloadLinkByFileOutput(File file,Integer Linkstatus){
  ArrayList<DownloadLink> links=JDUtilities.getDownloadController().getAllDownloadLinks();
  try {
    for (    DownloadLink nextDownloadLink : links) {
      if (new File(nextDownloadLink.getFileOutput()).getAbsoluteFile().equals(file.getAbsoluteFile())) {
        if (Linkstatus != null) {
          if (nextDownloadLink.getLinkStatus().hasStatus(Linkstatus))           return nextDownloadLink;
        }
 else         return nextDownloadLink;
      }
    }
  }
 catch (  Exception e) {
    JDLogger.exception(e);
  }
  return null;
}
Program: 21085
Project: 21085
Buggy source:
public void updateCollectives(){
synchronized (downloadLinkList) {
    totalEstimatedPackageSize_v2=0;
    totalDownloadSpeed_v2=0;
    linksFinished=0;
    linksInProgress=0;
    linksFailed=0;
    totalBytesLoaded_v2=0;
    long avg=0;
    DownloadLink next;
    int i=0;
    for (Iterator<DownloadLink> it=downloadLinkList.iterator(); it.hasNext(); ) {
      next=it.next();
      if (next.getDownloadSize() > 0) {
        if (next.isEnabled()) {
          totalEstimatedPackageSize_v2+=next.getDownloadSize();
        }
        avg=(i * avg + next.getDownloadSize()) / (i + 1);
        i++;
      }
 else {
        if (it.hasNext()) {
          if (next.isEnabled()) {
            totalEstimatedPackageSize_v2+=avg;
          }
        }
 else {
          if (next.isEnabled()) {
            totalEstimatedPackageSize_v2+=avg / 2;
          }
        }
      }
      totalDownloadSpeed_v2+=Math.max(0,next.getDownloadSpeed());
      if (next.isEnabled()) {
        totalBytesLoaded_v2+=next.getDownloadCurrent();
      }
      linksInProgress+=next.getLinkStatus().isPluginActive() ? 1 : 0;
      if (next.getLinkStatus().hasStatus(LinkStatus.FINISHED) || next.getLinkStatus().hasStatus(LinkStatus.ERROR_ALREADYEXISTS)) {
        linksFinished+=1;
      }
      if (next.getLinkStatus().isFailed() && next.isEnabled()) {
        linksFailed++;
      }
    }
  }
  updateTime=System.currentTimeMillis();
}

Fixed version (ground truth):
public void updateCollectives(){
synchronized (downloadLinkList) {
    totalEstimatedPackageSize_v2=0;
    totalDownloadSpeed_v2=0;
    linksFinished=0;
    linksInProgress=0;
    linksFailed=0;
    totalBytesLoaded_v2=0;
    long avg=0;
    DownloadLink next;
    int i=0;
    for (Iterator<DownloadLink> it=downloadLinkList.iterator(); it.hasNext(); ) {
      next=it.next();
      if (next.getDownloadSize() > 0) {
        if (next.isEnabled()) {
          totalEstimatedPackageSize_v2+=next.getDownloadSize();
        }
        avg=(i * avg + next.getDownloadSize()) / (i + 1);
        i++;
      }
 else {
        if (it.hasNext()) {
          if (next.isEnabled()) {
            totalEstimatedPackageSize_v2+=avg;
          }
        }
 else {
          if (next.isEnabled()) {
            totalEstimatedPackageSize_v2+=avg / 2;
          }
        }
      }
      totalDownloadSpeed_v2+=Math.max(0,next.getDownloadSpeed());
      if (next.isEnabled()) {
        totalBytesLoaded_v2+=next.getDownloadCurrent();
      }
      linksInProgress+=next.getLinkStatus().isPluginActive() ? 1 : 0;
      if (next.getLinkStatus().isFinished()) {
        linksFinished+=1;
      }
      if (next.getLinkStatus().isFailed() && next.isEnabled()) {
        linksFailed++;
      }
    }
  }
  updateTime=System.currentTimeMillis();
}
Program: 21086
Project: 21086
Buggy source:
public boolean isFailed(){
  return !hasOnlyStatus(FINISHED | ERROR_IP_BLOCKED | TODO| PLUGIN_ACTIVE| PLUGIN_IN_PROGRESS| DOWNLOADINTERFACE_IN_PROGRESS| WAITING_USERIO);
}

Fixed version (ground truth):
public boolean isFailed(){
  return !hasOnlyStatus(FINISHED | ERROR_ALREADYEXISTS | ERROR_IP_BLOCKED| TODO| PLUGIN_ACTIVE| PLUGIN_IN_PROGRESS| DOWNLOADINTERFACE_IN_PROGRESS| WAITING_USERIO);
}
Program: 21089
Project: 21089
Buggy source:
public void controlEvent(final ControlEvent event){
  new GuiRunnable<Object>(){
    public Object runSave(){
switch (event.getID()) {
case ControlEvent.CONTROL_DOWNLOAD_START:
        stopButton.setEnabled(true);
      pauseButton.setEnabled(true);
    playButton.setEnabled(false);
  if (speedmeter != null)   speedmeter.start();
break;
case ControlEvent.CONTROL_ALL_DOWNLOADS_FINISHED:
case ControlEvent.CONTROL_DOWNLOAD_STOP:
stopButton.setEnabled(false);
setPause(false);
pauseButton.setEnabled(false);
playButton.setEnabled(true);
if (speedmeter != null) speedmeter.stop();
break;
}
return null;
}
}
.start();
}

Fixed version (ground truth):
public void controlEvent(final ControlEvent event){
  new GuiRunnable<Object>(){
    public Object runSave(){
switch (event.getID()) {
case ControlEvent.CONTROL_DOWNLOAD_START:
        stopButton.setEnabled(true);
      pauseButton.setEnabled(true);
    playButton.setEnabled(false);
  speedmeter.start();
break;
case ControlEvent.CONTROL_ALL_DOWNLOADS_FINISHED:
case ControlEvent.CONTROL_DOWNLOAD_STOP:
stopButton.setEnabled(false);
setPause(false);
pauseButton.setEnabled(false);
playButton.setEnabled(true);
speedmeter.stop();
break;
}
return null;
}
}
.start();
}
Program: 21090
Project: 21090
Buggy source:
public Object runSave(){
switch (event.getID()) {
case ControlEvent.CONTROL_DOWNLOAD_START:
    stopButton.setEnabled(true);
  pauseButton.setEnabled(true);
playButton.setEnabled(false);
if (speedmeter != null) speedmeter.start();
break;
case ControlEvent.CONTROL_ALL_DOWNLOADS_FINISHED:
case ControlEvent.CONTROL_DOWNLOAD_STOP:
stopButton.setEnabled(false);
setPause(false);
pauseButton.setEnabled(false);
playButton.setEnabled(true);
if (speedmeter != null) speedmeter.stop();
break;
}
return null;
}

Fixed version (ground truth):
public Object runSave(){
switch (event.getID()) {
case ControlEvent.CONTROL_DOWNLOAD_START:
    stopButton.setEnabled(true);
  pauseButton.setEnabled(true);
playButton.setEnabled(false);
speedmeter.start();
break;
case ControlEvent.CONTROL_ALL_DOWNLOADS_FINISHED:
case ControlEvent.CONTROL_DOWNLOAD_STOP:
stopButton.setEnabled(false);
setPause(false);
pauseButton.setEnabled(false);
playButton.setEnabled(true);
speedmeter.stop();
break;
}
return null;
}
Program: 21091
Project: 21091
Buggy source:
@Override public void onPropertyChanged(Property source,final String key){
  SwingUtilities.invokeLater(new Runnable(){
    public void run(){
      if (key == Configuration.PARAM_LATEST_RECONNECT_RESULT) {
        updateReconnectButtons();
      }
 else       if (key == Configuration.PARAM_CLIPBOARD_ALWAYS_ACTIVE) {
        updateClipboardButton();
      }
 else       if (key == Configuration.PARAM_ALLOW_RECONNECT) {
        updateReconnectButtonIcon();
      }
 else       if (key == Configuration.PARAM_DOWNLOAD_PAUSE_SPEED) {
        updatePauseButton();
      }
    }
  }
);
}

Fixed version (ground truth):
@Override public void onPropertyChanged(Property source,final String key){
  SwingUtilities.invokeLater(new Runnable(){
    public void run(){
      if (key == Configuration.PARAM_LATEST_RECONNECT_RESULT) {
        updateReconnectButtons();
      }
 else       if (key == Configuration.PARAM_CLIPBOARD_ALWAYS_ACTIVE) {
        updateClipboardButton();
      }
 else       if (key == Configuration.PARAM_ALLOW_RECONNECT) {
        updateReconnectButtonIcon();
      }
 else       if (key == Configuration.PARAM_DOWNLOAD_PAUSE_SPEED) {
        updatePauseButton();
      }
 else       if (key == SimpleGuiConstants.PARAM_SHOW_SPEEDMETER) {
        updateSpeedMeterPanel();
      }
    }
  }
);
}
Program: 21092
Project: 21092
Buggy source:
private void initListeners(){
  JDController.getInstance().addControlListener(new ConfigPropertyListener(Configuration.PARAM_LATEST_RECONNECT_RESULT,Configuration.PARAM_CLIPBOARD_ALWAYS_ACTIVE,Configuration.PARAM_ALLOW_RECONNECT,Configuration.PARAM_DOWNLOAD_PAUSE_SPEED){
    @Override public void onPropertyChanged(    Property source,    final String key){
      SwingUtilities.invokeLater(new Runnable(){
        public void run(){
          if (key == Configuration.PARAM_LATEST_RECONNECT_RESULT) {
            updateReconnectButtons();
          }
 else           if (key == Configuration.PARAM_CLIPBOARD_ALWAYS_ACTIVE) {
            updateClipboardButton();
          }
 else           if (key == Configuration.PARAM_ALLOW_RECONNECT) {
            updateReconnectButtonIcon();
          }
 else           if (key == Configuration.PARAM_DOWNLOAD_PAUSE_SPEED) {
            updatePauseButton();
          }
        }
      }
);
    }
  }
);
}

Fixed version (ground truth):
private void initListeners(){
  JDController.getInstance().addControlListener(new ConfigPropertyListener(Configuration.PARAM_LATEST_RECONNECT_RESULT,Configuration.PARAM_CLIPBOARD_ALWAYS_ACTIVE,Configuration.PARAM_ALLOW_RECONNECT,Configuration.PARAM_DOWNLOAD_PAUSE_SPEED,SimpleGuiConstants.PARAM_SHOW_SPEEDMETER){
    @Override public void onPropertyChanged(    Property source,    final String key){
      SwingUtilities.invokeLater(new Runnable(){
        public void run(){
          if (key == Configuration.PARAM_LATEST_RECONNECT_RESULT) {
            updateReconnectButtons();
          }
 else           if (key == Configuration.PARAM_CLIPBOARD_ALWAYS_ACTIVE) {
            updateClipboardButton();
          }
 else           if (key == Configuration.PARAM_ALLOW_RECONNECT) {
            updateReconnectButtonIcon();
          }
 else           if (key == Configuration.PARAM_DOWNLOAD_PAUSE_SPEED) {
            updatePauseButton();
          }
 else           if (key == SimpleGuiConstants.PARAM_SHOW_SPEEDMETER) {
            updateSpeedMeterPanel();
          }
        }
      }
);
    }
  }
);
}
Program: 21093
Project: 21093
Buggy source:
private void addSpeedMeter(){
  speedmeter=new SpeedMeterPanel();
  speedmeter.setPreferredSize(new Dimension(100,30));
  if (SubConfiguration.getConfig(SimpleGuiConstants.GUICONFIGNAME).getBooleanProperty(SimpleGuiConstants.PARAM_SHOW_SPEEDMETER,true)) {
    add(speedmeter,"String_Node_Str");
  }
}

Fixed version (ground truth):
private void addSpeedMeter(){
  speedmeter=new SpeedMeterPanel();
  updateSpeedMeterPanel();
}
Program: 21095
Project: 21095
Buggy source:
public void actionPerformed(ActionEvent e){
  opacity+=fadeSteps;
  if (opacity > 1) {
    opacity=1;
    fadeTimer.stop();
    fadeTimer=null;
  }
 else   if (opacity < 0) {
    opacity=0;
    this.setVisible(false);
    fadeTimer.stop();
    fadeTimer=null;
  }
  update();
}

Fixed version (ground truth):
public void actionPerformed(ActionEvent e){
  if (e.getSource() == fadeTimer) {
    opacity+=fadeSteps;
    if (opacity > 1) {
      opacity=1;
      fadeTimer.stop();
      fadeTimer=null;
    }
 else     if (opacity < 0) {
      opacity=0;
      this.setVisible(false);
      fadeTimer.stop();
      fadeTimer=null;
    }
    update();
  }
 else   if (e.getSource() instanceof JMenuItem) {
    SimpleGuiConstants.GUI_CONFIG.setProperty(SimpleGuiConstants.PARAM_SHOW_SPEEDMETER,false);
    SimpleGuiConstants.GUI_CONFIG.save();
  }
}
Program: 21096
Project: 21096
Buggy source:
public SpeedMeterPanel(){
  this.i=0;
  this.window=SubConfiguration.getConfig(SimpleGuiConstants.GUICONFIGNAME).getIntegerProperty(SimpleGuiConstants.PARAM_SHOW_SPEEDMETER_WINDOWSIZE,60);
  this.setOpaque(false);
  this.setBorder(BorderFactory.createEtchedBorder());
  this.cache=new int[CAPACITY];
  for (int x=0; x < CAPACITY; x++) {
    cache[x]=0;
  }
  this.setVisible(false);
  JDUtilities.getController().addControlListener(this);
}

Fixed version (ground truth):
public SpeedMeterPanel(){
  this.i=0;
  this.window=SubConfiguration.getConfig(SimpleGuiConstants.GUICONFIGNAME).getIntegerProperty(SimpleGuiConstants.PARAM_SHOW_SPEEDMETER_WINDOWSIZE,60);
  this.setOpaque(false);
  this.setBorder(BorderFactory.createEtchedBorder());
  this.addMouseListener(this);
  this.cache=new int[CAPACITY];
  for (int x=0; x < CAPACITY; x++) {
    cache[x]=0;
  }
  this.setVisible(false);
  JDUtilities.getController().addControlListener(this);
}
Program: 21101
Project: 21101
Buggy source:
public ArrayList<DownloadLink> decryptIt(CryptedLink param,ProgressController progress) throws Exception {
  ArrayList<DownloadLink> decryptedLinks=new ArrayList<DownloadLink>();
  String parameter=param.toString();
  br.getPage(parameter);
  File file=this.getLocalCaptchaFile();
  Form form=br.getForm(1);
  Browser.download(file,br.cloneBrowser().openGetConnection("String_Node_Str"));
  Point p=UserIO.getInstance().requestClickPositionDialog(file,JDLocale.L("String_Node_Str","String_Node_Str"),JDLocale.L("String_Node_Str","String_Node_Str"));
  if (p == null)   throw new DecrypterException(DecrypterException.CAPTCHA);
  form.remove("String_Node_Str");
  form.remove("String_Node_Str");
  form.put("String_Node_Str",p.x + "String_Node_Str");
  form.put("String_Node_Str",p.y + "String_Node_Str");
  br.submitForm(form);
  String[] links=br.getRegex("String_Node_Str").getColumn(0);
  for (  String link : links) {
    decryptedLinks.add(createDownloadlink(link.trim()));
  }
  return decryptedLinks;
}

Fixed version (ground truth):
public ArrayList<DownloadLink> decryptIt(CryptedLink param,ProgressController progress) throws Exception {
  ArrayList<DownloadLink> decryptedLinks=new ArrayList<DownloadLink>();
  String parameter=param.toString();
  br.getPage(parameter);
  File file=this.getLocalCaptchaFile();
  Form form=br.getForm(0);
  Browser.download(file,br.cloneBrowser().openGetConnection("String_Node_Str"));
  Point p=UserIO.getInstance().requestClickPositionDialog(file,JDLocale.L("String_Node_Str","String_Node_Str"),JDLocale.L("String_Node_Str","String_Node_Str"));
  if (p == null)   throw new DecrypterException(DecrypterException.CAPTCHA);
  form.remove("String_Node_Str");
  form.remove("String_Node_Str");
  form.put("String_Node_Str",p.x + "String_Node_Str");
  form.put("String_Node_Str",p.y + "String_Node_Str");
  br.submitForm(form);
  String[] links=br.getRegex("String_Node_Str").getColumn(0);
  for (  String link : links) {
    decryptedLinks.add(createDownloadlink(link.trim()));
  }
  return decryptedLinks;
}
Program: 21102
Project: 21102
Buggy source:
public void fireTableChanged(int id,ArrayList<DownloadLink> links){
  if (tablerefreshinprogress)   return;
  final ArrayList<DownloadLink> links2=new ArrayList<DownloadLink>(links);
  final int id2=id;
  new Thread(){
    public void run(){
      tablerefreshinprogress=true;
synchronized (DownloadController.ControllerLock) {
synchronized (JDUtilities.getController().getPackages()) {
          try {
            internalTreeTable.fireTableChanged(id2,links2);
          }
 catch (          Exception e) {
            e.printStackTrace();
          }
        }
        tablerefreshinprogress=false;
      }
    }
  }
.start();
}

Fixed version (ground truth):
public void fireTableChanged(int id,ArrayList<DownloadLink> links){
  if (tablerefreshinprogress)   return;
  final ArrayList<DownloadLink> links2=new ArrayList<DownloadLink>(links);
  final int id2=id;
  new Thread(){
    public void run(){
      tablerefreshinprogress=true;
synchronized (DownloadController.ControllerLock) {
synchronized (JDUtilities.getController().getPackages()) {
          try {
            internalTreeTable.fireTableChanged(id2,links2);
          }
 catch (          Exception e) {
            logger.severe("String_Node_Str");
            updateTableTask(REFRESH_DATA_AND_STRUCTURE_CHANGED,null);
          }
        }
        tablerefreshinprogress=false;
      }
    }
  }
.start();
}
Program: 21103
Project: 21103
Buggy source:
public void fireTableChanged(){
  if (tablerefreshinprogress)   return;
  new Thread(){
    public void run(){
      tablerefreshinprogress=true;
      this.setName("String_Node_Str");
synchronized (LinkGrabberController.ControllerLock) {
synchronized (LGINSTANCE.getPackages()) {
          if (gatherer_running) {
            ArrayList<LinkGrabberFilePackage> fps=LGINSTANCE.getPackages();
            int count=0;
            for (            LinkGrabberFilePackage fp : fps) {
              count+=1 + fp.size();
            }
            if (count > (internalTreeTable.getVisibleRect().getHeight() / 16.0)) {
              for (              LinkGrabberFilePackage fp : fps) {
                if (!fp.getBooleanProperty(LinkGrabberTreeTable.PROPERTY_USEREXPAND,false))                 fp.setProperty(LinkGrabberTreeTable.PROPERTY_EXPANDED,false);
              }
            }
 else {
              for (              LinkGrabberFilePackage fp : fps) {
                if (!fp.getBooleanProperty(LinkGrabberTreeTable.PROPERTY_USEREXPAND,false))                 fp.setProperty(LinkGrabberTreeTable.PROPERTY_EXPANDED,true);
              }
            }
          }
          try {
            internalTreeTable.fireTableChanged();
          }
 catch (          Exception e) {
            e.printStackTrace();
          }
          tablerefreshinprogress=false;
        }
      }
    }
  }
.start();
}

Fixed version (ground truth):
public void fireTableChanged(){
  if (tablerefreshinprogress)   return;
  new Thread(){
    public void run(){
      tablerefreshinprogress=true;
      this.setName("String_Node_Str");
synchronized (LinkGrabberController.ControllerLock) {
synchronized (LGINSTANCE.getPackages()) {
          if (gatherer_running) {
            ArrayList<LinkGrabberFilePackage> fps=LGINSTANCE.getPackages();
            int count=0;
            for (            LinkGrabberFilePackage fp : fps) {
              count+=1 + fp.size();
            }
            if (count > (internalTreeTable.getVisibleRect().getHeight() / 16.0)) {
              for (              LinkGrabberFilePackage fp : fps) {
                if (!fp.getBooleanProperty(LinkGrabberTreeTable.PROPERTY_USEREXPAND,false))                 fp.setProperty(LinkGrabberTreeTable.PROPERTY_EXPANDED,false);
              }
            }
 else {
              for (              LinkGrabberFilePackage fp : fps) {
                if (!fp.getBooleanProperty(LinkGrabberTreeTable.PROPERTY_USEREXPAND,false))                 fp.setProperty(LinkGrabberTreeTable.PROPERTY_EXPANDED,true);
              }
            }
          }
          try {
            internalTreeTable.fireTableChanged();
          }
 catch (          Exception e) {
            logger.severe("String_Node_Str");
            Update_Async.restart();
          }
          tablerefreshinprogress=false;
        }
      }
    }
  }
.start();
}
Program: 21104
Project: 21104
Buggy source:
public Object runSave(){
  JDFileChooser fc=new JDFileChooser();
  fc.setApproveButtonText(JDLocale.L("String_Node_Str","String_Node_Str"));
  fc.setFileSelectionMode(JDFileChooser.DIRECTORIES_ONLY);
  fc.setCurrentDirectory(new File(selected_packages2.get(0).getDownloadDirectory()));
  if (fc.showOpenDialog(INSTANCE) == JDFileChooser.APPROVE_OPTION) {
    if (fc.getSelectedFile() != null) {
      for (      LinkGrabberFilePackage fp2 : selected_packages2) {
        fp2.setDownloadDirectory(fc.getSelectedFile().getAbsolutePath());
      }
    }
  }
  return null;
}

Fixed version (ground truth):
public File runSave(){
  JDFileChooser fc=new JDFileChooser("String_Node_Str");
  fc.setFileFilter(new JDFileFilter(null,"String_Node_Str",true));
  if (fc.showSaveDialog(SimpleGUI.CURRENTGUI) == JDFileChooser.APPROVE_OPTION)   return fc.getSelectedFile();
  return null;
}
Program: 21109
Project: 21109
Buggy source:
private String[] getUserDatafromBasicauth(String basicauth){
  if (basicauth == null || basicauth.length() == 0)   return null;
  if (basicauth.startsWith("String_Node_Str"))   basicauth=new Regex(basicauth,"String_Node_Str").getMatch(0);
  basicauth=Encoding.Base64Decode(basicauth);
  String[] dat=new Regex(basicauth,("String_Node_Str")).getRow(0);
  return new String[]{dat[0],dat[1]};
}

Fixed version (ground truth):
public static String[] getUserDatafromBasicauth(String basicauth){
  if (basicauth == null || basicauth.length() == 0)   return null;
  if (basicauth.startsWith("String_Node_Str"))   basicauth=new Regex(basicauth,"String_Node_Str").getMatch(0);
  basicauth=Encoding.Base64Decode(basicauth);
  String[] dat=new Regex(basicauth,("String_Node_Str")).getRow(0);
  return new String[]{dat[0],dat[1]};
}
Program: 21110
Project: 21110
Buggy source:
public void prepareShutdown(){
  logger.info("String_Node_Str");
  stopDownloads();
  logger.info("String_Node_Str");
  JDUtilities.getDownloadController().saveDownloadLinksSyncnonThread();
  logger.info("String_Node_Str");
  AccountController.getInstance().saveSyncnonThread();
  logger.info("String_Node_Str");
  PasswordListController.getInstance().saveSync();
  logger.info("String_Node_Str");
  HTACCESSController.getInstance().saveSync();
  logger.info("String_Node_Str");
  fireControlEvent(new ControlEvent(this,ControlEvent.CONTROL_SYSTEM_EXIT,this));
  logger.info("String_Node_Str");
  Interaction.handleInteraction(Interaction.INTERACTION_EXIT,null);
  logger.info("String_Node_Str");
  JDUtilities.getDatabaseConnector().shutdownDatabase();
}

Fixed version (ground truth):
public void prepareShutdown(){
  logger.info("String_Node_Str");
  stopDownloads();
  logger.info("String_Node_Str");
  JDUtilities.getDownloadController().saveDownloadLinksSyncnonThread();
  logger.info("String_Node_Str");
  AccountController.getInstance().saveSyncnonThread();
  logger.info("String_Node_Str");
  PasswordListController.getInstance().saveSync();
  logger.info("String_Node_Str");
  HTACCESSController.getInstance().saveSync();
  logger.info("String_Node_Str");
  fireControlEventDirect(new ControlEvent(this,ControlEvent.CONTROL_SYSTEM_EXIT,this));
  logger.info("String_Node_Str");
  Interaction.handleInteraction(Interaction.INTERACTION_EXIT,null);
  logger.info("String_Node_Str");
  JDUtilities.getDatabaseConnector().shutdownDatabase();
}
Program: 21111
Project: 21111
Buggy source:
/** 
 * Displays only if mainframe is hidden
 */
public static void showIfHidden(String title,ImageIcon icon,String htmlmessage){
  if (!SimpleGUI.CURRENTGUI.isActive())   Balloon.show(title,icon,htmlmessage);
}

Fixed version (ground truth):
/** 
 * Displays only if mainframe is hidden
 */
public static void showIfHidden(String title,ImageIcon icon,String htmlmessage){
  if (SimpleGUI.CURRENTGUI != null && !SimpleGUI.CURRENTGUI.isActive())   Balloon.show(title,icon,htmlmessage);
}
Program: 21114
Project: 21114
Buggy source:
public void handleFree(DownloadLink downloadLink) throws Exception {
  requestFileInformation(downloadLink);
  br.setFollowRedirects(true);
  boolean resume=true;
  int chunks=0;
  if (downloadLink.getBooleanProperty("String_Node_Str",false) == true)   resume=false;
  if (downloadLink.getBooleanProperty("String_Node_Str",false) == true || resume == false) {
    chunks=1;
  }
  dl=br.openDownload(downloadLink,downloadLink.getDownloadURL(),resume,chunks);
  if (!dl.startDownload()) {
    if (downloadLink.getLinkStatus().getErrorMessage() != null && downloadLink.getLinkStatus().getErrorMessage().startsWith(JDLocale.L("String_Node_Str","String_Node_Str"))) {
      if (downloadLink.getBooleanProperty("String_Node_Str",false) == false) {
        downloadLink.setProperty("String_Node_Str",new Boolean(true));
        throw new PluginException(LinkStatus.ERROR_RETRY);
      }
    }
    if (downloadLink.getLinkStatus().getErrorMessage() != null && downloadLink.getLinkStatus().getErrorMessage().startsWith(JDLocale.L("String_Node_Str","String_Node_Str"))) {
      if (downloadLink.getBooleanProperty("String_Node_Str",false) == false) {
        downloadLink.setChunksProgress(null);
        downloadLink.setProperty("String_Node_Str",new Boolean(true));
        throw new PluginException(LinkStatus.ERROR_RETRY);
      }
    }
  }
}

Fixed version (ground truth):
public void handleFree(DownloadLink downloadLink) throws Exception {
  requestFileInformation(downloadLink);
  br.setFollowRedirects(true);
  br.setDebug(true);
  boolean resume=true;
  int chunks=0;
  if (downloadLink.getBooleanProperty("String_Node_Str",false) == true)   resume=false;
  if (downloadLink.getBooleanProperty("String_Node_Str",false) == true || resume == false) {
    chunks=1;
  }
  dl=br.openDownload(downloadLink,downloadLink.getDownloadURL(),resume,chunks);
  if (!dl.startDownload()) {
    if (downloadLink.getLinkStatus().getErrorMessage() != null && downloadLink.getLinkStatus().getErrorMessage().startsWith(JDLocale.L("String_Node_Str","String_Node_Str"))) {
      if (downloadLink.getBooleanProperty("String_Node_Str",false) == false) {
        downloadLink.setProperty("String_Node_Str",new Boolean(true));
        throw new PluginException(LinkStatus.ERROR_RETRY);
      }
    }
    if (downloadLink.getLinkStatus().getErrorMessage() != null && downloadLink.getLinkStatus().getErrorMessage().startsWith(JDLocale.L("String_Node_Str","String_Node_Str"))) {
      if (downloadLink.getBooleanProperty("String_Node_Str",false) == false) {
        downloadLink.setChunksProgress(null);
        downloadLink.setProperty("String_Node_Str",new Boolean(true));
        throw new PluginException(LinkStatus.ERROR_RETRY);
      }
    }
  }
}
Program: 21115
Project: 21115
Buggy source:
private String cleanFileName(String name){
  name=getNameMatch(name,"String_Node_Str");
  name=getNameMatch(name,"String_Node_Str");
  name=getNameMatch(name,"String_Node_Str");
  name=getNameMatch(name,"String_Node_Str");
  name=getNameMatch(name,"String_Node_Str");
  name=getNameMatch(name,"String_Node_Str");
  name=getNameMatch(name,"String_Node_Str");
  name=getNameMatch(name,"String_Node_Str");
  int lastPoint=name.lastIndexOf("String_Node_Str");
  if (lastPoint <= 0)   return name;
  String extension=name.substring(name.length() - lastPoint + 1);
  if (extension.length() > 0 && extension.length() < 6) {
    name=name.substring(0,lastPoint);
  }
  return JDUtilities.removeEndingPoints(name);
}

Fixed version (ground truth):
private String cleanFileName(String name){
  name=getNameMatch(name,"String_Node_Str");
  name=getNameMatch(name,"String_Node_Str");
  name=getNameMatch(name,"String_Node_Str");
  name=getNameMatch(name,"String_Node_Str");
  name=getNameMatch(name,"String_Node_Str");
  name=getNameMatch(name,"String_Node_Str");
  name=getNameMatch(name,"String_Node_Str");
  name=getNameMatch(name,"String_Node_Str");
  int lastPoint=name.lastIndexOf("String_Node_Str");
  if (lastPoint <= 0)   return name;
  String extension=name.substring(name.length() - lastPoint + 1);
  if (extension.length() > 0 && lastPoint > 0) {
    name=name.substring(0,lastPoint);
  }
  return JDUtilities.removeEndingPoints(name);
}
Program: 21116
Project: 21116
Buggy source:
public static boolean preferReconnect(){
  if (hasWaittimeLinks && SubConfiguration.getConfig("String_Node_Str").getBooleanProperty("String_Node_Str",true) && JDUtilities.getConfiguration().getBooleanProperty(Configuration.PARAM_LATEST_RECONNECT_RESULT,true))   return true;
  return false;
}

Fixed version (ground truth):
public static boolean preferReconnect(){
  if (hasWaittimeLinks && JDUtilities.getConfiguration().getBooleanProperty(Configuration.PARAM_ALLOW_RECONNECT,true) && SubConfiguration.getConfig("String_Node_Str").getBooleanProperty("String_Node_Str",true)&& JDUtilities.getConfiguration().getBooleanProperty(Configuration.PARAM_LATEST_RECONNECT_RESULT,true))   return true;
  return false;
}
Program: 21118
Project: 21118
Buggy source:
public AvailableStatus requestFileInformation(DownloadLink downloadLink) throws IOException, PluginException {
  String filename=null;
  String filesize=null;
  this.setBrowserExclusive();
  br.setCookie("String_Node_Str","String_Node_Str","String_Node_Str");
  br.getPage(downloadLink.getDownloadURL());
  if (br.containsHTML("String_Node_Str"))   throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);
  if (br.getForm(0) == null) {
    filename=Encoding.htmlDecode(br.getRegex("String_Node_Str").getMatch(0));
    filesize=br.getRegex("String_Node_Str").getMatch(0);
  }
 else {
    filename=Encoding.htmlDecode(br.getRegex("String_Node_Str").getMatch(0));
    filesize=br.getRegex("String_Node_Str").getMatch(0);
  }
  if (filename == null || filesize == null)   throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFEKT);
  downloadLink.setName(filename);
  downloadLink.setDownloadSize(Regex.getSize(filesize));
  return AvailableStatus.TRUE;
}

Fixed version (ground truth):
public AvailableStatus requestFileInformation(DownloadLink downloadLink) throws IOException, PluginException {
  String filename=null;
  String filesize=null;
  this.setBrowserExclusive();
  br.setCookie("String_Node_Str","String_Node_Str","String_Node_Str");
  br.getPage(downloadLink.getDownloadURL());
  if (br.containsHTML("String_Node_Str"))   throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND);
  if (br.containsHTML("String_Node_Str")) {
    logger.warning(JDLocale.L("String_Node_Str","String_Node_Str"));
    throw new PluginException(LinkStatus.ERROR_FILE_NOT_FOUND,"String_Node_Str");
  }
  if (br.getForm(0) == null) {
    filename=Encoding.htmlDecode(br.getRegex("String_Node_Str").getMatch(0));
    filesize=br.getRegex("String_Node_Str").getMatch(0);
  }
 else {
    filename=Encoding.htmlDecode(br.getRegex("String_Node_Str").getMatch(0));
    filesize=br.getRegex("String_Node_Str").getMatch(0);
  }
  if (filename == null || filesize == null)   throw new PluginException(LinkStatus.ERROR_PLUGIN_DEFEKT);
  downloadLink.setName(filename);
  downloadLink.setDownloadSize(Regex.getSize(filesize));
  return AvailableStatus.TRUE;
}