Program: 21244
Project: 21244
Buggy source:
/** 
 * Hier werden die Aktionen ausgewertet und weitergeleitet
 * @param e Die erwünschte Aktion
 */
public void actionPerformed(ActionEvent e){
  JDSounds.PT("String_Node_Str");
  ConfigPanelAddons config;
switch (e.getID()) {
case JDAction.ITEMS_MOVE_UP:
case JDAction.ITEMS_MOVE_DOWN:
case JDAction.ITEMS_MOVE_TOP:
case JDAction.ITEMS_MOVE_BOTTOM:
    linkListPane.moveSelectedItems(e.getID());
  break;
case JDAction.COLLAPSE_ALL:
linkListPane.collapseAll();
break;
case JDAction.EXPAND_ALL:
linkListPane.expandAll();
break;
case JDAction.APP_ALLOW_RECONNECT:
logger.finer("String_Node_Str");
boolean checked=!JDUtilities.getConfiguration().getBooleanProperty(Configuration.PARAM_DISABLE_RECONNECT,false);
if (checked) {
displayMiniWarning(JDLocale.L("String_Node_Str","String_Node_Str"),JDLocale.L("String_Node_Str","String_Node_Str"),10000);
}
JDUtilities.getConfiguration().setProperty(Configuration.PARAM_DISABLE_RECONNECT,checked);
JDUtilities.saveConfig();
break;
case JDAction.APP_PAUSE_DOWNLOADS:
btnPause.setSelected(!btnPause.isSelected());
fireUIEvent(new UIEvent(this,UIEvent.UI_PAUSE_DOWNLOADS,btnPause.isSelected()));
btnPause.setIcon(new ImageIcon(JDUtilities.getImage(getPauseImage())));
break;
case JDAction.APP_CLIPBOARD:
logger.finer("String_Node_Str");
ClipboardHandler.getClipboard().toggleActivation();
break;
case JDAction.APP_START_STOP_DOWNLOADS:
logger.finer("String_Node_Str");
startStopDownloads();
btnStartStop.setIcon(new ImageIcon(JDUtilities.getImage(getStartStopDownloadImage())));
btnPause.setIcon(new ImageIcon(JDUtilities.getImage(getPauseImage())));
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));
if (fc.showOpenDialog(frame) == JDFileChooser.APPROVE_OPTION) {
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_RESTART:
frame.setVisible(false);
frame.dispose();
fireUIEvent(new UIEvent(this,UIEvent.UI_RESTART));
break;
case JDAction.APP_LOG:
logDialog.setVisible(!logDialog.isVisible());
menViewLog.setSelected(!logDialog.isVisible());
break;
case JDAction.APP_RECONNECT:
new Thread(){
@Override public void run(){
doReconnect();
}
}
.start();
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 (showConfirmDialog(JDLocale.L("String_Node_Str","String_Node_Str"))) {
linkListPane.removeSelectedLinks();
}
}
 else {
linkListPane.removeSelectedLinks();
}
break;
case JDAction.APP_OPEN_OPT_CONFIG:
config=new ConfigPanelAddons(JDUtilities.getConfiguration());
JPanel panel=new JPanel(new BorderLayout());
panel.add(new JPanel(),BorderLayout.NORTH);
panel.add(config,BorderLayout.CENTER);
ConfigurationPopup pop=new ConfigurationPopup(frame,config,panel);
pop.setModal(true);
pop.setAlwaysOnTop(true);
pop.setLocation(JDUtilities.getCenterOfComponent(frame,pop));
pop.setVisible(true);
break;
case JDAction.ITEMS_REMOVE_PACKAGES:
if (!guiConfig.getBooleanProperty(PARAM_DISABLE_CONFIRM_DIALOGS,false)) {
if (showConfirmDialog(JDLocale.L("String_Node_Str","String_Node_Str"))) {
JDUtilities.getController().removeCompletedPackages();
}
}
 else {
JDUtilities.getController().removeCompletedPackages();
}
break;
case JDAction.ITEMS_REMOVE_LINKS:
if (!guiConfig.getBooleanProperty(PARAM_DISABLE_CONFIRM_DIALOGS,false)) {
if (showConfirmDialog(JDLocale.L("String_Node_Str","String_Node_Str"))) {
JDUtilities.getController().removeCompletedDownloadLinks();
}
}
 else {
JDUtilities.getController().removeCompletedDownloadLinks();
}
break;
case JDAction.ITEMS_DND:
toggleDnD();
break;
case JDAction.ABOUT:
JDAboutDialog.getDialog().setVisible(true);
break;
case JDAction.CHANGES:
showChangelogDialog();
break;
case JDAction.ITEMS_ADD:
String cb="String_Node_Str";
try {
cb=(String)Toolkit.getDefaultToolkit().getSystemClipboard().getData(DataFlavor.stringFlavor);
}
 catch (Exception e1) {
}
String data=LinkInputDialog.showDialog(frame,cb.trim());
if (data != null && data.length() > 0) {
fireUIEvent(new UIEvent(this,UIEvent.UI_LINKS_TO_PROCESS,data));
}
break;
case JDAction.HELP:
try {
JLinkButton.openURL(JDLocale.L("String_Node_Str","String_Node_Str"));
}
 catch (Exception e1) {
e1.printStackTrace();
}
break;
case JDAction.WIKI:
try {
JLinkButton.openURL(JDLocale.L("String_Node_Str","String_Node_Str"));
}
 catch (Exception e1) {
e1.printStackTrace();
}
break;
case JDAction.APP_CONFIGURATION:
showConfig();
break;
}
}

Fixed version (ground truth):
/** 
 * Hier werden die Aktionen ausgewertet und weitergeleitet
 * @param e Die erwünschte Aktion
 */
public void actionPerformed(ActionEvent e){
  JDSounds.PT("String_Node_Str");
switch (e.getID()) {
case JDAction.ITEMS_MOVE_UP:
case JDAction.ITEMS_MOVE_DOWN:
case JDAction.ITEMS_MOVE_TOP:
case JDAction.ITEMS_MOVE_BOTTOM:
    linkListPane.moveSelectedItems(e.getID());
  break;
case JDAction.COLLAPSE_ALL:
linkListPane.collapseAll();
break;
case JDAction.EXPAND_ALL:
linkListPane.expandAll();
break;
case JDAction.APP_ALLOW_RECONNECT:
logger.finer("String_Node_Str");
boolean checked=!JDUtilities.getConfiguration().getBooleanProperty(Configuration.PARAM_DISABLE_RECONNECT,false);
if (checked) {
displayMiniWarning(JDLocale.L("String_Node_Str","String_Node_Str"),JDLocale.L("String_Node_Str","String_Node_Str"),10000);
}
JDUtilities.getConfiguration().setProperty(Configuration.PARAM_DISABLE_RECONNECT,checked);
JDUtilities.saveConfig();
break;
case JDAction.APP_PAUSE_DOWNLOADS:
btnPause.setSelected(!btnPause.isSelected());
fireUIEvent(new UIEvent(this,UIEvent.UI_PAUSE_DOWNLOADS,btnPause.isSelected()));
btnPause.setIcon(new ImageIcon(JDUtilities.getImage(getPauseImage())));
break;
case JDAction.APP_CLIPBOARD:
logger.finer("String_Node_Str");
ClipboardHandler.getClipboard().toggleActivation();
break;
case JDAction.APP_START_STOP_DOWNLOADS:
logger.finer("String_Node_Str");
startStopDownloads();
btnStartStop.setIcon(new ImageIcon(JDUtilities.getImage(getStartStopDownloadImage())));
btnPause.setIcon(new ImageIcon(JDUtilities.getImage(getPauseImage())));
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));
if (fc.showOpenDialog(frame) == JDFileChooser.APPROVE_OPTION) {
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_RESTART:
frame.setVisible(false);
frame.dispose();
fireUIEvent(new UIEvent(this,UIEvent.UI_RESTART));
break;
case JDAction.APP_LOG:
logDialog.setVisible(!logDialog.isVisible());
menViewLog.setSelected(!logDialog.isVisible());
break;
case JDAction.APP_RECONNECT:
new Thread(){
@Override public void run(){
doReconnect();
}
}
.start();
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 (showConfirmDialog(JDLocale.L("String_Node_Str","String_Node_Str"))) {
linkListPane.removeSelectedLinks();
}
}
 else {
linkListPane.removeSelectedLinks();
}
break;
case JDAction.APP_OPEN_OPT_CONFIG:
SimpleGUI.showConfigDialog(frame,new ConfigPanelAddons(JDUtilities.getConfiguration()));
break;
case JDAction.ITEMS_REMOVE_PACKAGES:
if (!guiConfig.getBooleanProperty(PARAM_DISABLE_CONFIRM_DIALOGS,false)) {
if (showConfirmDialog(JDLocale.L("String_Node_Str","String_Node_Str"))) {
JDUtilities.getController().removeCompletedPackages();
}
}
 else {
JDUtilities.getController().removeCompletedPackages();
}
break;
case JDAction.ITEMS_REMOVE_LINKS:
if (!guiConfig.getBooleanProperty(PARAM_DISABLE_CONFIRM_DIALOGS,false)) {
if (showConfirmDialog(JDLocale.L("String_Node_Str","String_Node_Str"))) {
JDUtilities.getController().removeCompletedDownloadLinks();
}
}
 else {
JDUtilities.getController().removeCompletedDownloadLinks();
}
break;
case JDAction.ITEMS_DND:
toggleDnD();
break;
case JDAction.ABOUT:
JDAboutDialog.getDialog().setVisible(true);
break;
case JDAction.CHANGES:
showChangelogDialog();
break;
case JDAction.ITEMS_ADD:
String cb="String_Node_Str";
try {
cb=(String)Toolkit.getDefaultToolkit().getSystemClipboard().getData(DataFlavor.stringFlavor);
}
 catch (Exception e1) {
}
String data=LinkInputDialog.showDialog(frame,cb.trim());
if (data != null && data.length() > 0) {
fireUIEvent(new UIEvent(this,UIEvent.UI_LINKS_TO_PROCESS,data));
}
break;
case JDAction.HELP:
try {
JLinkButton.openURL(JDLocale.L("String_Node_Str","String_Node_Str"));
}
 catch (Exception e1) {
e1.printStackTrace();
}
break;
case JDAction.WIKI:
try {
JLinkButton.openURL(JDLocale.L("String_Node_Str","String_Node_Str"));
}
 catch (Exception e1) {
e1.printStackTrace();
}
break;
case JDAction.APP_CONFIGURATION:
showConfig();
break;
}
}