Program: 61587
Project: 61587
Buggy source:
@Override public void actionPerformed(ActionEvent e){
switch (e.getActionCommand()) {
case ACTION_DEBUGGER_SWITCH:
    if (debuggerSwitchGroup.getSelected() == null || View.showConfirmDialog(mainFrame,translate("String_Node_Str"),translate("String_Node_Str"),JOptionPane.OK_CANCEL_OPTION,JOptionPane.INFORMATION_MESSAGE,Configuration.displayDebuggerInfo,JOptionPane.OK_OPTION) == JOptionPane.OK_OPTION) {
      switchDebugger();
      mainFrame.getPanel().refreshDecompiled();
    }
 else {
      if (debuggerSwitchGroup.getSelected() == debuggerSwitchCommandButton) {
        debuggerSwitchGroup.setSelected(debuggerSwitchCommandButton,false);
      }
    }
  debuggerReplaceTraceCommandButton.setEnabled(debuggerSwitchGroup.getSelected() == debuggerSwitchCommandButton);
break;
case ACTION_DEBUGGER_LOG:
debuggerShowLog();
break;
case ACTION_DEBUGGER_REPLACE_TRACE:
ReplaceTraceDialog rtd=new ReplaceTraceDialog(mainFrame,Configuration.lastDebuggerReplaceFunction.get());
rtd.setVisible(true);
if (rtd.getValue() != null) {
replaceTraceCalls(rtd.getValue());
mainFrame.getPanel().refreshDecompiled();
Configuration.lastDebuggerReplaceFunction.set(rtd.getValue());
}
break;
case ACTION_RELOAD:
reload();
break;
case ACTION_ADVANCED_SETTINGS:
advancedSettings();
break;
case ACTION_LOAD_MEMORY:
loadFromMemory();
break;
case ACTION_LOAD_CACHE:
loadFromCache();
break;
case ACTION_GOTO_DOCUMENT_CLASS_ON_STARTUP:
Configuration.gotoMainClassOnStartup.set(miGotoMainClassOnStartup.isSelected());
break;
case ACTION_AUTO_RENAME_IDENTIFIERS:
Configuration.autoRenameIdentifiers.set(miAutoRenameIdentifiers.isSelected());
break;
case ACTION_CACHE_ON_DISK:
Configuration.cacheOnDisk.set(miCacheDisk.isSelected());
if (miCacheDisk.isSelected()) {
Cache.setStorageType(Cache.STORAGE_FILES);
}
 else {
Cache.setStorageType(Cache.STORAGE_MEMORY);
}
break;
case ACTION_SET_LANGUAGE:
setLanguage();
break;
case ACTION_DISABLE_DECOMPILATION:
Configuration.decompile.set(!miDecompile.isSelected());
mainFrame.getPanel().disableDecompilationChanged();
break;
case ACTION_ASSOCIATE:
if (miAssociate.isSelected() == ContextMenuTools.isAddedToContextMenu()) {
return;
}
ContextMenuTools.addToContextMenu(miAssociate.isSelected(),false);
new Timer().schedule(new TimerTask(){
@Override public void run(){
miAssociate.setSelected(ContextMenuTools.isAddedToContextMenu());
}
}
,1000);
break;
case ACTION_GOTO_DOCUMENT_CLASS:
mainFrame.getPanel().gotoDocumentClass(mainFrame.getPanel().getCurrentSwf());
break;
case ACTION_PARALLEL_SPEED_UP:
String confStr=translate("String_Node_Str") + "String_Node_Str";
if (miParallelSpeedUp.isSelected()) {
confStr+="String_Node_Str" + translate("String_Node_Str");
}
 else {
confStr+="String_Node_Str" + translate("String_Node_Str");
}
if (View.showConfirmDialog(null,confStr,translate("String_Node_Str"),JOptionPane.OK_CANCEL_OPTION) == JOptionPane.OK_OPTION) {
Configuration.parallelSpeedUp.set((Boolean)miParallelSpeedUp.isSelected());
}
 else {
miParallelSpeedUp.setSelected(!miParallelSpeedUp.isSelected());
}
break;
case ACTION_INTERNAL_VIEWER_SWITCH:
Configuration.internalFlashViewer.set(miInternalViewer.isSelected());
mainFrame.getPanel().reload(true);
break;
case ACTION_VIEWMODE_RESOURCES:
Configuration.dumpView.set(false);
mainFrame.getPanel().showView(MainPanel.VIEW_RESOURCES);
timeLineToggleGroup.setSelected(timeLineToggleButton,false);
viewModeToggleGroup.setSelected(viewModeResourcesToggleButton,true);
break;
case ACTION_VIEWMODE_HEX_DUMP:
Configuration.dumpView.set(true);
mainFrame.getPanel().showView(MainPanel.VIEW_DUMP);
timeLineToggleGroup.setSelected(timeLineToggleButton,false);
viewModeToggleGroup.setSelected(viewModeHexToggleButton,true);
break;
case ACTION_DEOBFUSCATION_MODE_OLD:
Configuration.deobfuscationMode.set(0);
mainFrame.getPanel().autoDeobfuscateChanged();
break;
case ACTION_DEOBFUSCATION_MODE_NEW:
Configuration.deobfuscationMode.set(1);
mainFrame.getPanel().autoDeobfuscateChanged();
break;
case ACTION_SEARCH:
search(null);
break;
case ACTION_REPLACE:
replace();
break;
case ACTION_TIMELINE:
timeLineToggleGroup.setSelected(timeLineToggleButton,timeLineToggleGroup.getSelected() == timeLineToggleButton);
if (timeLineToggleGroup.getSelected() == timeLineToggleButton) {
if (!mainFrame.getPanel().showView(MainPanel.VIEW_TIMELINE)) {
timeLineToggleGroup.setSelected(timeLineToggleButton,false);
}
 else {
viewModeToggleGroup.setSelected(viewModeHexToggleButton,false);
viewModeToggleGroup.setSelected(viewModeResourcesToggleButton,false);
}
}
 else {
if (Configuration.dumpView.get()) {
viewModeToggleGroup.setSelected(viewModeHexToggleButton,true);
mainFrame.getPanel().showView(MainPanel.VIEW_DUMP);
}
 else {
viewModeToggleGroup.setSelected(viewModeResourcesToggleButton,true);
mainFrame.getPanel().showView(MainPanel.VIEW_RESOURCES);
}
}
break;
case ACTION_AUTO_DEOBFUSCATE:
if (View.showConfirmDialog(mainFrame.getPanel(),translate("String_Node_Str") + "String_Node_Str" + (miAutoDeobfuscation.isSelected() ? translate("String_Node_Str") : translate("String_Node_Str")),translate("String_Node_Str"),JOptionPane.OK_CANCEL_OPTION) == JOptionPane.OK_OPTION) {
Configuration.autoDeobfuscate.set(miAutoDeobfuscation.isSelected());
mainFrame.getPanel().autoDeobfuscateChanged();
}
 else {
miAutoDeobfuscation.setSelected(!miAutoDeobfuscation.isSelected());
}
break;
case ACTION_CLEAR_RECENT_FILES:
Configuration.recentFiles.set(null);
break;
case ACTION_EXIT:
exit();
break;
}
if (Main.isWorking()) {
return;
}
switch (e.getActionCommand()) {
case ACTION_RENAME_ONE_IDENTIFIER:
renameOneIdentifier();
break;
case ACTION_SHOW_PROXY:
showProxy();
break;
case ACTION_SUB_LIMITER:
setSubLimiter(((JCheckBox)e.getSource()).isSelected());
break;
case ACTION_SAVE:
save();
break;
case ACTION_SAVE_AS:
saveAs();
break;
case ACTION_SAVE_AS_EXE:
saveAsExe();
break;
case ACTION_OPEN:
open();
break;
case ACTION_CLOSE:
close();
break;
case ACTION_CLOSE_ALL:
closeAll();
break;
case ACTION_IMPORT_TEXT:
importText();
break;
case ACTION_IMPORT_SYMBOL_CLASS:
importSymbolClass();
break;
case ACTION_EXPORT_SWF_XML:
mainFrame.getPanel().exportSwfXml();
break;
case ACTION_IMPORT_SWF_XML:
mainFrame.getPanel().importSwfXml();
break;
case ACTION_EXPORT_SEL:
case ACTION_EXPORT:
boolean onlySel=e.getActionCommand().equals(ACTION_EXPORT_SEL);
export(onlySel);
break;
case ACTION_EXPORT_FLA:
exportFla();
break;
case ACTION_CHECK_UPDATES:
checkUpdates();
break;
case ACTION_HELP_US:
helpUs();
break;
case ACTION_HOMEPAGE:
homePage();
break;
case ACTION_ABOUT:
about();
break;
case ACTION_RESTORE_CONTROL_FLOW:
case ACTION_RESTORE_CONTROL_FLOW_ALL:
boolean all=e.getActionCommand().equals(ACTION_RESTORE_CONTROL_FLOW_ALL);
restoreControlFlow(all);
break;
case ACTION_RENAME_IDENTIFIERS:
renameIdentifiers();
break;
case ACTION_DEOBFUSCATE:
case ACTION_DEOBFUSCATE_ALL:
deobfuscate();
break;
case ACTION_REMOVE_NON_SCRIPTS:
removeNonScripts();
break;
case ACTION_REFRESH_DECOMPILED:
refreshDecompiled();
break;
case ACTION_CHECK_RESOURCES:
checkResources();
break;
}
}

Fixed version (ground truth):
@Override public void actionPerformed(ActionEvent e){
switch (e.getActionCommand()) {
case ACTION_DEBUGGER_SWITCH:
    if (debuggerSwitchGroup.getSelected() == null || View.showConfirmDialog(mainFrame,translate("String_Node_Str"),translate("String_Node_Str"),JOptionPane.OK_CANCEL_OPTION,JOptionPane.INFORMATION_MESSAGE,Configuration.displayDebuggerInfo,JOptionPane.OK_OPTION) == JOptionPane.OK_OPTION) {
      switchDebugger();
      mainFrame.getPanel().refreshDecompiled();
    }
 else {
      if (debuggerSwitchGroup.getSelected() == debuggerSwitchCommandButton) {
        debuggerSwitchGroup.setSelected(debuggerSwitchCommandButton,false);
      }
    }
  debuggerReplaceTraceCommandButton.setEnabled(debuggerSwitchGroup.getSelected() == debuggerSwitchCommandButton);
break;
case ACTION_DEBUGGER_LOG:
debuggerShowLog();
break;
case ACTION_DEBUGGER_REPLACE_TRACE:
ReplaceTraceDialog rtd=new ReplaceTraceDialog(mainFrame,Configuration.lastDebuggerReplaceFunction.get());
rtd.setVisible(true);
if (rtd.getValue() != null) {
replaceTraceCalls(rtd.getValue());
mainFrame.getPanel().refreshDecompiled();
Configuration.lastDebuggerReplaceFunction.set(rtd.getValue());
}
break;
case ACTION_RELOAD:
reload();
break;
case ACTION_ADVANCED_SETTINGS:
advancedSettings();
break;
case ACTION_LOAD_MEMORY:
loadFromMemory();
break;
case ACTION_LOAD_CACHE:
loadFromCache();
break;
case ACTION_GOTO_DOCUMENT_CLASS_ON_STARTUP:
Configuration.gotoMainClassOnStartup.set(miGotoMainClassOnStartup.isSelected());
break;
case ACTION_AUTO_RENAME_IDENTIFIERS:
Configuration.autoRenameIdentifiers.set(miAutoRenameIdentifiers.isSelected());
break;
case ACTION_CACHE_ON_DISK:
Configuration.cacheOnDisk.set(miCacheDisk.isSelected());
if (miCacheDisk.isSelected()) {
Cache.setStorageType(Cache.STORAGE_FILES);
}
 else {
Cache.setStorageType(Cache.STORAGE_MEMORY);
}
break;
case ACTION_SET_LANGUAGE:
setLanguage();
break;
case ACTION_DISABLE_DECOMPILATION:
Configuration.decompile.set(!miDecompile.isSelected());
mainFrame.getPanel().disableDecompilationChanged();
break;
case ACTION_ASSOCIATE:
if (miAssociate.isSelected() == ContextMenuTools.isAddedToContextMenu()) {
return;
}
ContextMenuTools.addToContextMenu(miAssociate.isSelected(),false);
new Timer().schedule(new TimerTask(){
@Override public void run(){
miAssociate.setSelected(ContextMenuTools.isAddedToContextMenu());
}
}
,1000);
break;
case ACTION_GOTO_DOCUMENT_CLASS:
mainFrame.getPanel().gotoDocumentClass(mainFrame.getPanel().getCurrentSwf());
break;
case ACTION_PARALLEL_SPEED_UP:
String confStr=translate("String_Node_Str") + "String_Node_Str";
if (miParallelSpeedUp.isSelected()) {
confStr+="String_Node_Str" + translate("String_Node_Str");
}
 else {
confStr+="String_Node_Str" + translate("String_Node_Str");
}
if (View.showConfirmDialog(null,confStr,translate("String_Node_Str"),JOptionPane.OK_CANCEL_OPTION) == JOptionPane.OK_OPTION) {
Configuration.parallelSpeedUp.set((Boolean)miParallelSpeedUp.isSelected());
}
 else {
miParallelSpeedUp.setSelected(!miParallelSpeedUp.isSelected());
}
break;
case ACTION_INTERNAL_VIEWER_SWITCH:
Configuration.internalFlashViewer.set(miInternalViewer.isSelected());
mainFrame.getPanel().reload(true);
break;
case ACTION_VIEWMODE_RESOURCES:
Configuration.dumpView.set(false);
mainFrame.getPanel().showView(MainPanel.VIEW_RESOURCES);
timeLineToggleGroup.setSelected(timeLineToggleButton,false);
viewModeToggleGroup.setSelected(viewModeResourcesToggleButton,true);
break;
case ACTION_VIEWMODE_HEX_DUMP:
Configuration.dumpView.set(true);
mainFrame.getPanel().showView(MainPanel.VIEW_DUMP);
timeLineToggleGroup.setSelected(timeLineToggleButton,false);
viewModeToggleGroup.setSelected(viewModeHexToggleButton,true);
break;
case ACTION_DEOBFUSCATION_MODE_OLD:
Configuration.deobfuscationMode.set(0);
mainFrame.getPanel().autoDeobfuscateChanged();
break;
case ACTION_DEOBFUSCATION_MODE_NEW:
Configuration.deobfuscationMode.set(1);
mainFrame.getPanel().autoDeobfuscateChanged();
break;
case ACTION_SEARCH:
search(null);
break;
case ACTION_REPLACE:
replace();
break;
case ACTION_TIMELINE:
timeLineToggleGroup.setSelected(timeLineToggleButton,timeLineToggleGroup.getSelected() == timeLineToggleButton);
if (timeLineToggleGroup.getSelected() == timeLineToggleButton) {
if (!mainFrame.getPanel().showView(MainPanel.VIEW_TIMELINE)) {
timeLineToggleGroup.setSelected(timeLineToggleButton,false);
}
 else {
viewModeToggleGroup.setSelected(viewModeHexToggleButton,false);
viewModeToggleGroup.setSelected(viewModeResourcesToggleButton,false);
}
}
 else {
if (Configuration.dumpView.get()) {
viewModeToggleGroup.setSelected(viewModeHexToggleButton,true);
mainFrame.getPanel().showView(MainPanel.VIEW_DUMP);
}
 else {
viewModeToggleGroup.setSelected(viewModeResourcesToggleButton,true);
mainFrame.getPanel().showView(MainPanel.VIEW_RESOURCES);
}
}
break;
case ACTION_AUTO_DEOBFUSCATE:
if (View.showConfirmDialog(mainFrame.getPanel(),translate("String_Node_Str") + "String_Node_Str" + (miAutoDeobfuscation.isSelected() ? translate("String_Node_Str") : translate("String_Node_Str")),translate("String_Node_Str"),JOptionPane.OK_CANCEL_OPTION) == JOptionPane.OK_OPTION) {
Configuration.autoDeobfuscate.set(miAutoDeobfuscation.isSelected());
mainFrame.getPanel().autoDeobfuscateChanged();
}
 else {
miAutoDeobfuscation.setSelected(!miAutoDeobfuscation.isSelected());
}
break;
case ACTION_CLEAR_RECENT_FILES:
Configuration.recentFiles.set(null);
break;
case ACTION_EXIT:
exit();
break;
}
if (Main.isWorking()) {
return;
}
switch (e.getActionCommand()) {
case ACTION_RENAME_ONE_IDENTIFIER:
renameOneIdentifier();
break;
case ACTION_SHOW_PROXY:
showProxy();
break;
case ACTION_SUB_LIMITER:
setSubLimiter(((JCheckBox)e.getSource()).isSelected());
break;
case ACTION_SAVE:
save();
break;
case ACTION_SAVE_AS:
saveAs();
break;
case ACTION_SAVE_AS_EXE:
saveAsExe();
break;
case ACTION_OPEN:
open();
break;
case ACTION_CLOSE:
close();
break;
case ACTION_CLOSE_ALL:
closeAll();
break;
case ACTION_IMPORT_TEXT:
importText();
break;
case ACTION_IMPORT_SYMBOL_CLASS:
importSymbolClass();
break;
case ACTION_EXPORT_SWF_XML:
mainFrame.getPanel().exportSwfXml();
break;
case ACTION_IMPORT_SWF_XML:
mainFrame.getPanel().importSwfXml();
break;
case ACTION_EXPORT_SEL:
case ACTION_EXPORT:
boolean onlySel=e.getActionCommand().equals(ACTION_EXPORT_SEL);
export(onlySel);
break;
case ACTION_EXPORT_FLA:
exportFla();
break;
case ACTION_CHECK_UPDATES:
checkUpdates();
break;
case ACTION_HELP_US:
helpUs();
break;
case ACTION_HOMEPAGE:
homePage();
break;
case ACTION_ABOUT:
about();
break;
case ACTION_RESTORE_CONTROL_FLOW:
case ACTION_RESTORE_CONTROL_FLOW_ALL:
boolean all=e.getActionCommand().equals(ACTION_RESTORE_CONTROL_FLOW_ALL);
restoreControlFlow(all);
break;
case ACTION_RENAME_IDENTIFIERS:
renameIdentifiers();
break;
case ACTION_DEOBFUSCATE:
case ACTION_DEOBFUSCATE_ALL:
deobfuscate();
break;
}
}