Program: 21379
Project: 21379
Buggy source:
/** 
 * Hier werden die Aktionen ausgewertet und weitergeleitet
 * @param e Die erwünschte Aktion
 */
public void actionPerformed(ActionEvent e){
  if (e.getSource() == btnToggleReconnect) {
    JDUtilities.getConfiguration().setProperty(Configuration.PARAM_DISABLE_RECONNECT,btnToggleReconnect.isSelected());
    fireUIEvent(new UIEvent(this,UIEvent.UI_SAVE_CONFIG));
    if (btnToggleReconnect.isSelected())     this.showMessageDialog("String_Node_Str");
    return;
  }
switch (e.getID()) {
case JDAction.ITEMS_MOVE_UP:
case JDAction.ITEMS_MOVE_DOWN:
case JDAction.ITEMS_MOVE_TOP:
case JDAction.ITEMS_MOVE_BOTTOM:
    tabDownloadTable.moveSelectedItems(e.getID());
  break;
case JDAction.APP_PAUSE_DOWNLOADS:
fireUIEvent(new UIEvent(this,UIEvent.UI_PAUSE_DOWNLOADS,btnPause.isSelected()));
break;
case JDAction.APP_TESTER:
logger.finer("String_Node_Str");
Interaction.handleInteraction(Interaction.INTERACTION_TESTTRIGGER,false);
break;
case JDAction.APP_UNRAR:
logger.finer("String_Node_Str");
JDUtilities.getController().getUnrarModule().interact(null);
break;
case JDAction.APP_CLIPBOARD:
logger.finer("String_Node_Str");
JDUtilities.getController().getClipboard().toggleActivation();
btnClipBoard.setIcon(new ImageIcon(JDUtilities.getImage(getClipBoardImage())));
break;
case JDAction.APP_PASSWORDLIST:
new jdUnrarPasswordListDialog(((SimpleGUI)JDUtilities.getController().getUiInterface()).getFrame()).setVisible(true);
break;
case JDAction.APP_START_STOP_DOWNLOADS:
this.startStopDownloads();
break;
case JDAction.APP_SAVE_DLC:
JDFileChooser fc=new JDFileChooser("String_Node_Str");
fc.setFileFilter(new JDFileFilter(null,"String_Node_Str",true));
fc.showSaveDialog(frame);
File ret=fc.getSelectedFile();
if (ret == null) return;
if (JDUtilities.getFileExtension(ret) == null || !JDUtilities.getFileExtension(ret).equalsIgnoreCase("String_Node_Str")) {
ret=new File(ret.getAbsolutePath() + "String_Node_Str");
}
if (ret != null) {
fireUIEvent(new UIEvent(this,UIEvent.UI_SAVE_LINKS,ret));
}
break;
case JDAction.APP_LOAD_DLC:
fc=new JDFileChooser("String_Node_Str");
fc.setFileFilter(new JDFileFilter(null,"String_Node_Str",true));
fc.showOpenDialog(frame);
ret=fc.getSelectedFile();
if (ret != null) {
fireUIEvent(new UIEvent(this,UIEvent.UI_LOAD_LINKS,ret));
}
break;
case JDAction.APP_EXIT:
frame.setVisible(false);
frame.dispose();
fireUIEvent(new UIEvent(this,UIEvent.UI_EXIT));
break;
case JDAction.APP_LOG:
logDialog.setVisible(!logDialog.isVisible());
menViewLog.setSelected(!logDialog.isVisible());
break;
case JDAction.APP_RECONNECT:
this.doReconnect();
break;
case JDAction.APP_UPDATE:
fireUIEvent(new UIEvent(this,UIEvent.UI_INTERACT_UPDATE));
break;
case JDAction.ITEMS_REMOVE:
if (!guiConfig.getBooleanProperty(PARAM_DISABLE_CONFIRM_DIALOGS,false)) {
if (this.showConfirmDialog("String_Node_Str")) {
tabDownloadTable.removeSelectedLinks();
fireUIEvent(new UIEvent(this,UIEvent.UI_LINKS_CHANGED,this.getDownloadLinks()));
}
}
 else {
tabDownloadTable.removeSelectedLinks();
fireUIEvent(new UIEvent(this,UIEvent.UI_LINKS_CHANGED,this.getDownloadLinks()));
}
break;
case JDAction.ITEMS_DND:
this.toggleDnD();
break;
case JDAction.ITEMS_ADD:
Clipboard clipboard=Toolkit.getDefaultToolkit().getSystemClipboard();
String cb="String_Node_Str";
try {
cb=(String)clipboard.getData(DataFlavor.stringFlavor);
}
 catch (UnsupportedFlavorException e1) {
}
catch (IOException e1) {
}
String data=JOptionPane.showInputDialog(frame,"String_Node_Str",cb);
if (data != null) {
fireUIEvent(new UIEvent(this,UIEvent.UI_LINKS_TO_PROCESS,data));
}
break;
case JDAction.HELP:
try {
JLinkButton.OpenURL("String_Node_Str");
}
 catch (Exception e1) {
e1.printStackTrace();
}
break;
case JDAction.APP_CONFIGURATION:
boolean configChanged=ConfigurationDialog.showConfig(frame,this);
if (configChanged) fireUIEvent(new UIEvent(this,UIEvent.UI_SAVE_CONFIG));
break;
}
}

Fixed version (ground truth):
/** 
 * Hier werden die Aktionen ausgewertet und weitergeleitet
 * @param e Die erwünschte Aktion
 */
public void actionPerformed(ActionEvent e){
  if (e.getSource() == btnToggleReconnect) {
    btnToggleReconnect.setSelected(!btnToggleReconnect.isSelected());
    JDUtilities.getConfiguration().setProperty(Configuration.PARAM_DISABLE_RECONNECT,btnToggleReconnect.isSelected());
    fireUIEvent(new UIEvent(this,UIEvent.UI_SAVE_CONFIG));
    if (btnToggleReconnect.isSelected())     this.showMessageDialog("String_Node_Str");
    return;
  }
switch (e.getID()) {
case JDAction.ITEMS_MOVE_UP:
case JDAction.ITEMS_MOVE_DOWN:
case JDAction.ITEMS_MOVE_TOP:
case JDAction.ITEMS_MOVE_BOTTOM:
    tabDownloadTable.moveSelectedItems(e.getID());
  break;
case JDAction.APP_PAUSE_DOWNLOADS:
this.btnPause.setSelected(!btnPause.isSelected());
fireUIEvent(new UIEvent(this,UIEvent.UI_PAUSE_DOWNLOADS,btnPause.isSelected()));
break;
case JDAction.APP_TESTER:
logger.finer("String_Node_Str");
Interaction.handleInteraction(Interaction.INTERACTION_TESTTRIGGER,false);
break;
case JDAction.APP_UNRAR:
logger.finer("String_Node_Str");
JDUtilities.getController().getUnrarModule().interact(null);
break;
case JDAction.APP_CLIPBOARD:
logger.finer("String_Node_Str");
JDUtilities.getController().getClipboard().toggleActivation();
btnClipBoard.setIcon(new ImageIcon(JDUtilities.getImage(getClipBoardImage())));
break;
case JDAction.APP_PASSWORDLIST:
new jdUnrarPasswordListDialog(((SimpleGUI)JDUtilities.getController().getUiInterface()).getFrame()).setVisible(true);
break;
case JDAction.APP_START_STOP_DOWNLOADS:
btnStartStop.setSelected(!btnStartStop.isSelected());
this.startStopDownloads();
break;
case JDAction.APP_SAVE_DLC:
JDFileChooser fc=new JDFileChooser("String_Node_Str");
fc.setFileFilter(new JDFileFilter(null,"String_Node_Str",true));
fc.showSaveDialog(frame);
File ret=fc.getSelectedFile();
if (ret == null) return;
if (JDUtilities.getFileExtension(ret) == null || !JDUtilities.getFileExtension(ret).equalsIgnoreCase("String_Node_Str")) {
ret=new File(ret.getAbsolutePath() + "String_Node_Str");
}
if (ret != null) {
fireUIEvent(new UIEvent(this,UIEvent.UI_SAVE_LINKS,ret));
}
break;
case JDAction.APP_LOAD_DLC:
fc=new JDFileChooser("String_Node_Str");
fc.setFileFilter(new JDFileFilter(null,"String_Node_Str",true));
fc.showOpenDialog(frame);
ret=fc.getSelectedFile();
if (ret != null) {
fireUIEvent(new UIEvent(this,UIEvent.UI_LOAD_LINKS,ret));
}
break;
case JDAction.APP_EXIT:
frame.setVisible(false);
frame.dispose();
fireUIEvent(new UIEvent(this,UIEvent.UI_EXIT));
break;
case JDAction.APP_LOG:
logDialog.setVisible(!logDialog.isVisible());
menViewLog.setSelected(!logDialog.isVisible());
break;
case JDAction.APP_RECONNECT:
this.doReconnect();
break;
case JDAction.APP_UPDATE:
fireUIEvent(new UIEvent(this,UIEvent.UI_INTERACT_UPDATE));
break;
case JDAction.ITEMS_REMOVE:
if (!guiConfig.getBooleanProperty(PARAM_DISABLE_CONFIRM_DIALOGS,false)) {
if (this.showConfirmDialog("String_Node_Str")) {
tabDownloadTable.removeSelectedLinks();
fireUIEvent(new UIEvent(this,UIEvent.UI_LINKS_CHANGED,this.getDownloadLinks()));
}
}
 else {
tabDownloadTable.removeSelectedLinks();
fireUIEvent(new UIEvent(this,UIEvent.UI_LINKS_CHANGED,this.getDownloadLinks()));
}
break;
case JDAction.ITEMS_DND:
this.toggleDnD();
break;
case JDAction.ITEMS_ADD:
Clipboard clipboard=Toolkit.getDefaultToolkit().getSystemClipboard();
String cb="String_Node_Str";
try {
cb=(String)clipboard.getData(DataFlavor.stringFlavor);
}
 catch (UnsupportedFlavorException e1) {
}
catch (IOException e1) {
}
String data=JOptionPane.showInputDialog(frame,"String_Node_Str",cb);
if (data != null) {
fireUIEvent(new UIEvent(this,UIEvent.UI_LINKS_TO_PROCESS,data));
}
break;
case JDAction.HELP:
try {
JLinkButton.OpenURL("String_Node_Str");
}
 catch (Exception e1) {
e1.printStackTrace();
}
break;
case JDAction.APP_CONFIGURATION:
boolean configChanged=ConfigurationDialog.showConfig(frame,this);
if (configChanged) fireUIEvent(new UIEvent(this,UIEvent.UI_SAVE_CONFIG));
break;
}
}