Program: 21406
Project: 21406
Buggy source:
/** 
 * Hier werden ControlEvent ausgewertet
 * @param event
 */
public void controlEvent(ControlEvent event){
switch (event.getID()) {
case ControlEvent.CONTROL_SINGLE_DOWNLOAD_FINISHED:
    lastDownloadFinished=(DownloadLink)event.getParameter();
  saveDownloadLinks(JDUtilities.getResourceFile("String_Node_Str"));
this.addToFinished(lastDownloadFinished);
if (this.getMissingPackageFiles(lastDownloadFinished) == 0) {
Interaction.handleInteraction(Interaction.INTERACTION_DOWNLOAD_PACKAGE_FINISHED,this);
}
if (lastDownloadFinished.getStatus() == DownloadLink.STATUS_DONE && Configuration.FINISHED_DOWNLOADS_REMOVE.equals(JDUtilities.getConfiguration().getProperty(Configuration.PARAM_FINISHED_DOWNLOADS_ACTION))) {
downloadLinks.remove(lastDownloadFinished);
saveDownloadLinks(JDUtilities.getResourceFile("String_Node_Str"));
uiInterface.setDownloadLinks(downloadLinks);
}
break;
case ControlEvent.CONTROL_CAPTCHA_LOADED:
lastCaptchaLoaded=(File)event.getParameter();
break;
case ControlEvent.CONTROL_ALL_DOWNLOADS_FINISHED:
saveDownloadLinks(JDUtilities.getResourceFile("String_Node_Str"));
break;
case ControlEvent.CONTROL_DISTRIBUTE_FINISHED:
Object links=event.getParameter();
if (links != null && links instanceof Vector && ((Vector)links).size() > 0) {
uiInterface.addLinksToGrabber((Vector<DownloadLink>)links);
}
break;
case ControlEvent.CONTROL_PLUGIN_INTERACTION_INACTIVE:
Interaction interaction=(Interaction)event.getParameter();
if (interaction instanceof HTTPReconnect && interaction.getCallCode() == Interaction.INTERACTION_CALL_SUCCESS) {
Iterator<DownloadLink> iterator=downloadLinks.iterator();
DownloadLink i;
while (iterator.hasNext()) {
i=iterator.next();
if (i.getRemainingWaittime() > 0) {
i.setEndOfWaittime(0);
i.setStatus(DownloadLink.STATUS_TODO);
}
}
}
 else if (interaction instanceof WebUpdate) {
}
break;
default :
break;
}
uiInterface.delegatedControlEvent(event);
}

Fixed version (ground truth):
/** 
 * Hier werden ControlEvent ausgewertet
 * @param event
 */
public void controlEvent(ControlEvent event){
switch (event.getID()) {
case ControlEvent.CONTROL_SINGLE_DOWNLOAD_FINISHED:
    lastDownloadFinished=(DownloadLink)event.getParameter();
  saveDownloadLinks(JDUtilities.getResourceFile("String_Node_Str"));
this.addToFinished(lastDownloadFinished);
if (this.getMissingPackageFiles(lastDownloadFinished) == 0) {
Interaction.handleInteraction(Interaction.INTERACTION_DOWNLOAD_PACKAGE_FINISHED,this);
}
if (lastDownloadFinished.getStatus() == DownloadLink.STATUS_DONE && Configuration.FINISHED_DOWNLOADS_REMOVE.equals(JDUtilities.getConfiguration().getProperty(Configuration.PARAM_FINISHED_DOWNLOADS_ACTION))) {
logger.info("String_Node_Str");
downloadLinks.remove(lastDownloadFinished);
saveDownloadLinks(JDUtilities.getResourceFile("String_Node_Str"));
uiInterface.setDownloadLinks(downloadLinks);
}
break;
case ControlEvent.CONTROL_CAPTCHA_LOADED:
lastCaptchaLoaded=(File)event.getParameter();
break;
case ControlEvent.CONTROL_ALL_DOWNLOADS_FINISHED:
saveDownloadLinks(JDUtilities.getResourceFile("String_Node_Str"));
break;
case ControlEvent.CONTROL_DISTRIBUTE_FINISHED:
Object links=event.getParameter();
if (links != null && links instanceof Vector && ((Vector)links).size() > 0) {
uiInterface.addLinksToGrabber((Vector<DownloadLink>)links);
}
break;
case ControlEvent.CONTROL_PLUGIN_INTERACTION_INACTIVE:
Interaction interaction=(Interaction)event.getParameter();
if (interaction instanceof HTTPReconnect && interaction.getCallCode() == Interaction.INTERACTION_CALL_SUCCESS) {
Iterator<DownloadLink> iterator=downloadLinks.iterator();
DownloadLink i;
while (iterator.hasNext()) {
i=iterator.next();
if (i.getRemainingWaittime() > 0) {
i.setEndOfWaittime(0);
i.setStatus(DownloadLink.STATUS_TODO);
}
}
}
 else if (interaction instanceof WebUpdate) {
}
break;
default :
break;
}
uiInterface.delegatedControlEvent(event);
}