Program: 21137
Project: 21137
Buggy source:
@SuppressWarnings("String_Node_Str") public void actionPerformed(ActionEvent arg0){
  if (arg0.getSource() == this.Update_Async) {
    fireTableChanged(1,null);
    return;
  }
  if (arg0.getSource() == this.gathertimer) {
    gathertimer.stop();
    gathertimer.removeActionListener(this);
    gathertimer=null;
    if (waitingList.size() > 0) {
      startLinkGatherer();
    }
    return;
  }
  Vector<LinkGrabberFilePackage> selected_packages=new Vector<LinkGrabberFilePackage>();
  Vector<DownloadLink> selected_links=new Vector<DownloadLink>();
  int prio=0;
  String pw="String_Node_Str";
  HashMap<String,Object> prop=new HashMap<String,Object>();
  LinkGrabberFilePackage fp;
  Set<String> hoster=null;
  JDFileChooser fc;
  int col=0;
  boolean b=false;
synchronized (packages) {
    if (arg0.getSource() instanceof LinkGrabberTaskPane) {
switch (arg0.getID()) {
case LinkGrabberTreeTableAction.ADD_ALL:
        selected_packages=new Vector<LinkGrabberFilePackage>(packages);
      break;
case LinkGrabberTreeTableAction.CLEAR:
    stopLinkGatherer();
  selected_packages=new Vector<LinkGrabberFilePackage>(packages);
break;
case LinkGrabberTreeTableAction.ADD_SELECTED:
selected_packages=new Vector<LinkGrabberFilePackage>(this.internalTreeTable.getSelectedFilePackages());
break;
case LinkGrabberTreeTableAction.GUI_ADD:
String cb="String_Node_Str";
try {
cb=(String)Toolkit.getDefaultToolkit().getSystemClipboard().getData(DataFlavor.stringFlavor);
}
 catch (Exception e1) {
}
String data=LinkInputDialog.showDialog(null,cb);
if (data != null && data.length() > 0) {
JDUtilities.getController().distributeLinks(data);
}
return;
case LinkGrabberTreeTableAction.GUI_LOAD:
}
}
 else if (arg0.getSource() instanceof JMenuItem) {
switch (arg0.getID()) {
case LinkGrabberTreeTableAction.SELECT_HOSTER:
hoster=(Set<String>)((LinkGrabberTreeTableAction)((JMenuItem)arg0.getSource()).getAction()).getProperty().getProperty("String_Node_Str");
selected_packages=new Vector<LinkGrabberFilePackage>(packages);
break;
case LinkGrabberTreeTableAction.ADD_ALL:
case LinkGrabberTreeTableAction.DELETE_OFFLINE:
selected_packages=new Vector<LinkGrabberFilePackage>(packages);
break;
case LinkGrabberTreeTableAction.ADD_SELECTED:
case LinkGrabberTreeTableAction.EDIT_DIR:
selected_packages=new Vector<LinkGrabberFilePackage>(this.internalTreeTable.getSelectedFilePackages());
break;
case LinkGrabberTreeTableAction.SORT:
col=(Integer)((LinkGrabberTreeTableAction)((JMenuItem)arg0.getSource()).getAction()).getProperty().getProperty("String_Node_Str");
selected_packages=new Vector<LinkGrabberFilePackage>(this.internalTreeTable.getSelectedFilePackages());
break;
case LinkGrabberTreeTableAction.DOWNLOAD_PRIO:
case LinkGrabberTreeTableAction.DE_ACTIVATE:
prop=(HashMap<String,Object>)((LinkGrabberTreeTableAction)((JMenuItem)arg0.getSource()).getAction()).getProperty().getProperty("String_Node_Str");
selected_links=(Vector<DownloadLink>)prop.get("String_Node_Str");
break;
case LinkGrabberTreeTableAction.DELETE:
case LinkGrabberTreeTableAction.SET_PW:
case LinkGrabberTreeTableAction.NEW_PACKAGE:
selected_links=(Vector<DownloadLink>)((LinkGrabberTreeTableAction)((JMenuItem)arg0.getSource()).getAction()).getProperty().getProperty("String_Node_Str");
break;
}
}
 else if (arg0.getSource() instanceof LinkGrabberTreeTableAction) {
switch (arg0.getID()) {
case LinkGrabberTreeTableAction.SORT_ALL:
col=(Integer)((LinkGrabberTreeTableAction)arg0.getSource()).getProperty().getProperty("String_Node_Str");
break;
}
}
switch (arg0.getID()) {
case LinkGrabberTreeTableAction.DELETE_OFFLINE:
for (LinkGrabberFilePackage fp2 : selected_packages) {
fp2.removeOffline();
}
Update_Async.restart();
break;
case LinkGrabberTreeTableAction.SORT:
for (LinkGrabberFilePackage fp2 : selected_packages) {
fp2.sort(col);
}
Update_Async.restart();
break;
case LinkGrabberTreeTableAction.SORT_ALL:
sort(col);
Update_Async.restart();
break;
case LinkGrabberTreeTableAction.SELECT_HOSTER:
for (LinkGrabberFilePackage fp2 : selected_packages) {
fp2.keepHostersOnly(hoster);
}
Update_Async.restart();
break;
case LinkGrabberTreeTableAction.EDIT_DIR:
fc=new JDFileChooser();
fc.setApproveButtonText(JDLocale.L("String_Node_Str","String_Node_Str"));
fc.setFileSelectionMode(JDFileChooser.DIRECTORIES_ONLY);
fc.setCurrentDirectory(new File(selected_packages.get(0).getDownloadDirectory()));
if (fc.showOpenDialog(this) == JDFileChooser.APPROVE_OPTION) {
if (fc.getSelectedFile() != null) {
for (LinkGrabberFilePackage fp2 : selected_packages) {
fp2.setDownloadDirectory(fc.getSelectedFile().getAbsolutePath());
}
}
}
break;
case LinkGrabberTreeTableAction.NEW_PACKAGE:
fp=this.getFPwithLink(selected_links.get(0));
String name=SimpleGUI.CURRENTGUI.showUserInputDialog(JDLocale.L("String_Node_Str","String_Node_Str"),fp.getName());
if (name != null) {
LinkGrabberFilePackage nfp=new LinkGrabberFilePackage(name,this);
for (DownloadLink link : selected_links) {
removeFromPackages(link);
addToPackages(nfp,link);
}
Update_Async.restart();
}
return;
case LinkGrabberTreeTableAction.SET_PW:
pw=SimpleGUI.CURRENTGUI.showUserInputDialog(JDLocale.L("String_Node_Str","String_Node_Str"),null);
for (int i=0; i < selected_links.size(); i++) {
fp=this.getFPwithLink(selected_links.elementAt(i));
selected_links.elementAt(i).setProperty("String_Node_Str",pw);
if (fp != null) fp.getBroadcaster().fireEvent(new LinkGrabberFilePackageEvent(fp,LinkGrabberFilePackageEvent.UPDATE_EVENT));
}
return;
case LinkGrabberTreeTableAction.DE_ACTIVATE:
b=(Boolean)prop.get("String_Node_Str");
for (int i=0; i < selected_links.size(); i++) {
selected_links.get(i).setEnabled(b);
}
Update_Async.restart();
return;
case LinkGrabberTreeTableAction.ADD_ALL:
case LinkGrabberTreeTableAction.ADD_SELECTED:
confirmPackages(selected_packages);
Update_Async.restart();
return;
case LinkGrabberTreeTableAction.DELETE:
for (DownloadLink link : selected_links) {
link.setProperty("String_Node_Str",true);
removeFromPackages(link);
}
Update_Async.restart();
return;
case LinkGrabberTreeTableAction.CLEAR:
for (LinkGrabberFilePackage fp2 : selected_packages) {
fp2.setDownloadLinks(new Vector<DownloadLink>());
}
Update_Async.restart();
return;
case LinkGrabberTreeTableAction.DOWNLOAD_PRIO:
prio=(Integer)prop.get("String_Node_Str");
for (int i=0; i < selected_links.size(); i++) {
selected_links.elementAt(i).setPriority(prio);
}
return;
}
}
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public void actionPerformed(ActionEvent arg0){
  if (arg0.getSource() == this.Update_Async) {
    fireTableChanged(1,null);
    return;
  }
  if (arg0.getSource() == this.gathertimer) {
    gathertimer.stop();
    if (waitingList.size() > 0) {
      startLinkGatherer();
    }
    return;
  }
  Vector<LinkGrabberFilePackage> selected_packages=new Vector<LinkGrabberFilePackage>();
  Vector<DownloadLink> selected_links=new Vector<DownloadLink>();
  int prio=0;
  String pw="String_Node_Str";
  HashMap<String,Object> prop=new HashMap<String,Object>();
  LinkGrabberFilePackage fp;
  Set<String> hoster=null;
  JDFileChooser fc;
  int col=0;
  boolean b=false;
synchronized (packages) {
    if (arg0.getSource() instanceof LinkGrabberTaskPane) {
switch (arg0.getID()) {
case LinkGrabberTreeTableAction.ADD_ALL:
        selected_packages=new Vector<LinkGrabberFilePackage>(packages);
      break;
case LinkGrabberTreeTableAction.CLEAR:
    stopLinkGatherer();
  selected_packages=new Vector<LinkGrabberFilePackage>(packages);
break;
case LinkGrabberTreeTableAction.ADD_SELECTED:
selected_packages=new Vector<LinkGrabberFilePackage>(this.internalTreeTable.getSelectedFilePackages());
break;
case LinkGrabberTreeTableAction.GUI_ADD:
String cb="String_Node_Str";
try {
cb=(String)Toolkit.getDefaultToolkit().getSystemClipboard().getData(DataFlavor.stringFlavor);
}
 catch (Exception e1) {
}
String data=LinkInputDialog.showDialog(null,cb);
if (data != null && data.length() > 0) {
JDUtilities.getController().distributeLinks(data);
}
return;
case LinkGrabberTreeTableAction.GUI_LOAD:
fc=new JDFileChooser("String_Node_Str");
fc.setDialogTitle(JDLocale.L("String_Node_Str","String_Node_Str"));
fc.setFileFilter(new JDFileFilter(null,"String_Node_Str",true));
if (fc.showOpenDialog(null) == JDFileChooser.APPROVE_OPTION) {
File ret2=fc.getSelectedFile();
if (ret2 != null) {
JDUtilities.getController().loadContainerFile(ret2);
}
}
return;
}
}
 else if (arg0.getSource() instanceof JMenuItem) {
switch (arg0.getID()) {
case LinkGrabberTreeTableAction.SELECT_HOSTER:
hoster=(Set<String>)((LinkGrabberTreeTableAction)((JMenuItem)arg0.getSource()).getAction()).getProperty().getProperty("String_Node_Str");
selected_packages=new Vector<LinkGrabberFilePackage>(packages);
break;
case LinkGrabberTreeTableAction.ADD_ALL:
case LinkGrabberTreeTableAction.DELETE_OFFLINE:
selected_packages=new Vector<LinkGrabberFilePackage>(packages);
break;
case LinkGrabberTreeTableAction.ADD_SELECTED:
case LinkGrabberTreeTableAction.EDIT_DIR:
selected_packages=new Vector<LinkGrabberFilePackage>(this.internalTreeTable.getSelectedFilePackages());
break;
case LinkGrabberTreeTableAction.SORT:
col=(Integer)((LinkGrabberTreeTableAction)((JMenuItem)arg0.getSource()).getAction()).getProperty().getProperty("String_Node_Str");
selected_packages=new Vector<LinkGrabberFilePackage>(this.internalTreeTable.getSelectedFilePackages());
break;
case LinkGrabberTreeTableAction.DOWNLOAD_PRIO:
case LinkGrabberTreeTableAction.DE_ACTIVATE:
prop=(HashMap<String,Object>)((LinkGrabberTreeTableAction)((JMenuItem)arg0.getSource()).getAction()).getProperty().getProperty("String_Node_Str");
selected_links=(Vector<DownloadLink>)prop.get("String_Node_Str");
break;
case LinkGrabberTreeTableAction.DELETE:
case LinkGrabberTreeTableAction.SET_PW:
case LinkGrabberTreeTableAction.NEW_PACKAGE:
selected_links=(Vector<DownloadLink>)((LinkGrabberTreeTableAction)((JMenuItem)arg0.getSource()).getAction()).getProperty().getProperty("String_Node_Str");
break;
}
}
 else if (arg0.getSource() instanceof LinkGrabberTreeTableAction) {
switch (arg0.getID()) {
case LinkGrabberTreeTableAction.SORT_ALL:
col=(Integer)((LinkGrabberTreeTableAction)arg0.getSource()).getProperty().getProperty("String_Node_Str");
break;
}
}
switch (arg0.getID()) {
case LinkGrabberTreeTableAction.DELETE_OFFLINE:
for (LinkGrabberFilePackage fp2 : selected_packages) {
fp2.removeOffline();
}
Update_Async.restart();
break;
case LinkGrabberTreeTableAction.SORT:
for (LinkGrabberFilePackage fp2 : selected_packages) {
fp2.sort(col);
}
Update_Async.restart();
break;
case LinkGrabberTreeTableAction.SORT_ALL:
sort(col);
Update_Async.restart();
break;
case LinkGrabberTreeTableAction.SELECT_HOSTER:
for (LinkGrabberFilePackage fp2 : selected_packages) {
fp2.keepHostersOnly(hoster);
}
Update_Async.restart();
break;
case LinkGrabberTreeTableAction.EDIT_DIR:
fc=new JDFileChooser();
fc.setApproveButtonText(JDLocale.L("String_Node_Str","String_Node_Str"));
fc.setFileSelectionMode(JDFileChooser.DIRECTORIES_ONLY);
fc.setCurrentDirectory(new File(selected_packages.get(0).getDownloadDirectory()));
if (fc.showOpenDialog(this) == JDFileChooser.APPROVE_OPTION) {
if (fc.getSelectedFile() != null) {
for (LinkGrabberFilePackage fp2 : selected_packages) {
fp2.setDownloadDirectory(fc.getSelectedFile().getAbsolutePath());
}
}
}
break;
case LinkGrabberTreeTableAction.NEW_PACKAGE:
fp=this.getFPwithLink(selected_links.get(0));
String name=SimpleGUI.CURRENTGUI.showUserInputDialog(JDLocale.L("String_Node_Str","String_Node_Str"),fp.getName());
if (name != null) {
LinkGrabberFilePackage nfp=new LinkGrabberFilePackage(name,this);
for (DownloadLink link : selected_links) {
removeFromPackages(link);
addToPackages(nfp,link);
}
Update_Async.restart();
}
return;
case LinkGrabberTreeTableAction.SET_PW:
pw=SimpleGUI.CURRENTGUI.showUserInputDialog(JDLocale.L("String_Node_Str","String_Node_Str"),null);
for (int i=0; i < selected_links.size(); i++) {
fp=this.getFPwithLink(selected_links.elementAt(i));
selected_links.elementAt(i).setProperty("String_Node_Str",pw);
if (fp != null) fp.getBroadcaster().fireEvent(new LinkGrabberFilePackageEvent(fp,LinkGrabberFilePackageEvent.UPDATE_EVENT));
}
return;
case LinkGrabberTreeTableAction.DE_ACTIVATE:
b=(Boolean)prop.get("String_Node_Str");
for (int i=0; i < selected_links.size(); i++) {
selected_links.get(i).setEnabled(b);
}
Update_Async.restart();
return;
case LinkGrabberTreeTableAction.ADD_ALL:
case LinkGrabberTreeTableAction.ADD_SELECTED:
confirmPackages(selected_packages);
Update_Async.restart();
return;
case LinkGrabberTreeTableAction.DELETE:
for (DownloadLink link : selected_links) {
link.setProperty("String_Node_Str",true);
removeFromPackages(link);
}
Update_Async.restart();
return;
case LinkGrabberTreeTableAction.CLEAR:
for (LinkGrabberFilePackage fp2 : selected_packages) {
fp2.setDownloadLinks(new Vector<DownloadLink>());
}
Update_Async.restart();
return;
case LinkGrabberTreeTableAction.DOWNLOAD_PRIO:
prio=(Integer)prop.get("String_Node_Str");
for (int i=0; i < selected_links.size(); i++) {
selected_links.elementAt(i).setPriority(prio);
}
return;
}
}
}