Program: 21130
Project: 21130
Buggy source:
public void mousePressed(MouseEvent e){
  if (e.getSource() != this)   return;
  Point point=e.getPoint();
  int row=rowAtPoint(point);
  int col=getRealcolumnAtPoint(e.getX());
  JMenuItem tmp;
  if (!isRowSelected(row) && e.getButton() == MouseEvent.BUTTON3) {
    getTreeSelectionModel().clearSelection();
    getTreeSelectionModel().addSelectionPath(getPathForRow(row));
  }
  if (e.isPopupTrigger() || e.getButton() == MouseEvent.BUTTON3) {
    if (getPathForRow(row) == null) {
      return;
    }
    Vector<DownloadLink> alllinks=getAllSelectedDownloadLinks();
    Vector<DownloadLink> resumlinks=getAllSelectedDownloadLinks();
    Vector<DownloadLink> allnoncon=new Vector<DownloadLink>();
    int links_enabled=0;
    for (    DownloadLink next : alllinks) {
      if (next.getLinkType() == DownloadLink.LINKTYPE_NORMAL) {
        allnoncon.add(next);
      }
      if (next.isEnabled()) {
        links_enabled++;
      }
      if (!next.getLinkStatus().isPluginActive() && next.getLinkStatus().isFailed()) {
        resumlinks.add(next);
      }
    }
    int links_disabled=alllinks.size() - links_enabled;
    Vector<FilePackage> sfp=getSelectedFilePackages();
    Object obj=getPathForRow(row).getLastPathComponent();
    JPopupMenu popup=new JPopupMenu();
    if (obj instanceof FilePackage || obj instanceof DownloadLink) {
      popup.add(new JMenuItem(new TreeTableAction(panel,JDLocale.L("String_Node_Str","String_Node_Str") + "String_Node_Str" + alllinks.size()+ "String_Node_Str",TreeTableAction.DELETE,new Property("String_Node_Str",alllinks))));
      popup.add(new JSeparator());
    }
    popup.add(createExtrasMenu(obj));
    if (obj instanceof FilePackage) {
      popup.add(new JMenuItem(new TreeTableAction(panel,JDLocale.L("String_Node_Str","String_Node_Str"),TreeTableAction.DOWNLOAD_DIR,new Property("String_Node_Str",new File(((FilePackage)obj).getDownloadDirectory())))));
      popup.add(new JMenuItem(new TreeTableAction(panel,JDLocale.L("String_Node_Str","String_Node_Str") + "String_Node_Str" + sfp.size()+ "String_Node_Str"+ this.getModel().getColumnName(col)+ "String_Node_Str",TreeTableAction.SORT,new Property("String_Node_Str",col))));
      popup.add(new JMenuItem(new TreeTableAction(panel,JDLocale.L("String_Node_Str","String_Node_Str") + "String_Node_Str" + sfp.size()+ "String_Node_Str",TreeTableAction.EDIT_NAME,new Property("String_Node_Str",sfp))));
      popup.add(new JMenuItem(new TreeTableAction(panel,JDLocale.L("String_Node_Str","String_Node_Str") + "String_Node_Str" + sfp.size()+ "String_Node_Str",TreeTableAction.EDIT_DIR,new Property("String_Node_Str",sfp))));
      popup.add(new JSeparator());
    }
    if (obj instanceof DownloadLink) {
      popup.add(new JMenuItem(new TreeTableAction(panel,JDLocale.L("String_Node_Str","String_Node_Str"),TreeTableAction.DOWNLOAD_DIR,new Property("String_Node_Str",new File(((DownloadLink)obj).getFileOutput()).getParentFile()))));
      popup.add(tmp=new JMenuItem(new TreeTableAction(panel,JDLocale.L("String_Node_Str","String_Node_Str"),TreeTableAction.DOWNLOAD_BROWSE_LINK,new Property("String_Node_Str",obj))));
      if (((DownloadLink)obj).getLinkType() != DownloadLink.LINKTYPE_NORMAL)       tmp.setEnabled(false);
    }
    if (obj instanceof FilePackage || obj instanceof DownloadLink) {
      popup.add(new JMenuItem(new TreeTableAction(panel,JDLocale.L("String_Node_Str","String_Node_Str") + "String_Node_Str" + alllinks.size()+ "String_Node_Str",TreeTableAction.DOWNLOAD_DLC,new Property("String_Node_Str",alllinks))));
      popup.add(buildpriomenu(alllinks));
      popup.add(new JMenuItem(new TreeTableAction(panel,JDLocale.L("String_Node_Str","String_Node_Str") + "String_Node_Str" + alllinks.size()+ "String_Node_Str",TreeTableAction.DOWNLOAD_COPY_PASSWORD,new Property("String_Node_Str",alllinks))));
      popup.add(tmp=new JMenuItem(new TreeTableAction(panel,JDLocale.L("String_Node_Str","String_Node_Str") + "String_Node_Str" + allnoncon.size()+ "String_Node_Str",TreeTableAction.DOWNLOAD_COPY_URL,new Property("String_Node_Str",allnoncon))));
      if (allnoncon.size() == 0)       tmp.setEnabled(false);
      popup.add(new JMenuItem(new TreeTableAction(panel,JDLocale.L("String_Node_Str","String_Node_Str") + "String_Node_Str" + alllinks.size()+ "String_Node_Str",TreeTableAction.CHECK,new Property("String_Node_Str",alllinks))));
      popup.add(new JMenuItem(new TreeTableAction(panel,JDLocale.L("String_Node_Str","String_Node_Str") + "String_Node_Str" + alllinks.size()+ "String_Node_Str",TreeTableAction.NEW_PACKAGE,new Property("String_Node_Str",alllinks))));
      popup.add(new JMenuItem(new TreeTableAction(panel,JDLocale.L("String_Node_Str","String_Node_Str") + "String_Node_Str" + alllinks.size()+ "String_Node_Str",TreeTableAction.SET_PW,new Property("String_Node_Str",alllinks))));
      popup.add(new JSeparator());
      HashMap<String,Object> prop=new HashMap<String,Object>();
      prop.put("String_Node_Str",alllinks);
      prop.put("String_Node_Str",true);
      popup.add(tmp=new JMenuItem(new TreeTableAction(panel,JDLocale.L("String_Node_Str","String_Node_Str") + "String_Node_Str" + links_disabled+ "String_Node_Str",TreeTableAction.DE_ACTIVATE,new Property("String_Node_Str",prop))));
      if (links_disabled == 0)       tmp.setEnabled(false);
      prop=new HashMap<String,Object>();
      prop.put("String_Node_Str",alllinks);
      prop.put("String_Node_Str",false);
      popup.add(tmp=new JMenuItem(new TreeTableAction(panel,JDLocale.L("String_Node_Str","String_Node_Str") + "String_Node_Str" + links_enabled+ "String_Node_Str",TreeTableAction.DE_ACTIVATE,new Property("String_Node_Str",prop))));
      if (links_enabled == 0)       tmp.setEnabled(false);
      popup.add(tmp=new JMenuItem(new TreeTableAction(panel,JDLocale.L("String_Node_Str","String_Node_Str") + "String_Node_Str" + resumlinks.size()+ "String_Node_Str",TreeTableAction.DOWNLOAD_RESUME,new Property("String_Node_Str",resumlinks))));
      if (resumlinks.size() == 0)       tmp.setEnabled(false);
      popup.add(new JMenuItem(new TreeTableAction(panel,JDLocale.L("String_Node_Str","String_Node_Str") + "String_Node_Str" + alllinks.size()+ "String_Node_Str",TreeTableAction.DOWNLOAD_RESET,new Property("String_Node_Str",alllinks))));
    }
    if (popup.getComponentCount() != 0)     popup.show(this,point.x,point.y);
  }
}

Fixed version (ground truth):
public void mousePressed(MouseEvent e){
  if (e.getSource() != this)   return;
  Point point=e.getPoint();
  int row=rowAtPoint(point);
  int col=getRealcolumnAtPoint(e.getX());
  JMenuItem tmp;
  if (!isRowSelected(row) && e.getButton() == MouseEvent.BUTTON3) {
    getTreeSelectionModel().clearSelection();
    getTreeSelectionModel().addSelectionPath(getPathForRow(row));
  }
  if (e.isPopupTrigger() || e.getButton() == MouseEvent.BUTTON3) {
    if (getPathForRow(row) == null) {
      return;
    }
    Vector<DownloadLink> alllinks=getAllSelectedDownloadLinks();
    Vector<DownloadLink> resumlinks=new Vector<DownloadLink>();
    Vector<DownloadLink> allnoncon=new Vector<DownloadLink>();
    int links_enabled=0;
    for (    DownloadLink next : alllinks) {
      if (next.getLinkType() == DownloadLink.LINKTYPE_NORMAL) {
        allnoncon.add(next);
      }
      if (next.isEnabled()) {
        links_enabled++;
      }
      if (!next.getLinkStatus().isPluginActive() && next.getLinkStatus().isFailed()) {
        resumlinks.add(next);
      }
    }
    int links_disabled=alllinks.size() - links_enabled;
    Vector<FilePackage> sfp=getSelectedFilePackages();
    Object obj=getPathForRow(row).getLastPathComponent();
    JPopupMenu popup=new JPopupMenu();
    if (obj instanceof FilePackage || obj instanceof DownloadLink) {
      popup.add(new JMenuItem(new TreeTableAction(panel,JDLocale.L("String_Node_Str","String_Node_Str") + "String_Node_Str" + alllinks.size()+ "String_Node_Str",TreeTableAction.DELETE,new Property("String_Node_Str",alllinks))));
      popup.add(new JSeparator());
    }
    popup.add(createExtrasMenu(obj));
    if (obj instanceof FilePackage) {
      popup.add(new JMenuItem(new TreeTableAction(panel,JDLocale.L("String_Node_Str","String_Node_Str"),TreeTableAction.DOWNLOAD_DIR,new Property("String_Node_Str",new File(((FilePackage)obj).getDownloadDirectory())))));
      popup.add(new JMenuItem(new TreeTableAction(panel,JDLocale.L("String_Node_Str","String_Node_Str") + "String_Node_Str" + sfp.size()+ "String_Node_Str"+ this.getModel().getColumnName(col)+ "String_Node_Str",TreeTableAction.SORT,new Property("String_Node_Str",col))));
      popup.add(new JMenuItem(new TreeTableAction(panel,JDLocale.L("String_Node_Str","String_Node_Str") + "String_Node_Str" + sfp.size()+ "String_Node_Str",TreeTableAction.EDIT_NAME,new Property("String_Node_Str",sfp))));
      popup.add(new JMenuItem(new TreeTableAction(panel,JDLocale.L("String_Node_Str","String_Node_Str") + "String_Node_Str" + sfp.size()+ "String_Node_Str",TreeTableAction.EDIT_DIR,new Property("String_Node_Str",sfp))));
      popup.add(new JSeparator());
    }
    if (obj instanceof DownloadLink) {
      popup.add(new JMenuItem(new TreeTableAction(panel,JDLocale.L("String_Node_Str","String_Node_Str"),TreeTableAction.DOWNLOAD_DIR,new Property("String_Node_Str",new File(((DownloadLink)obj).getFileOutput()).getParentFile()))));
      popup.add(tmp=new JMenuItem(new TreeTableAction(panel,JDLocale.L("String_Node_Str","String_Node_Str"),TreeTableAction.DOWNLOAD_BROWSE_LINK,new Property("String_Node_Str",obj))));
      if (((DownloadLink)obj).getLinkType() != DownloadLink.LINKTYPE_NORMAL)       tmp.setEnabled(false);
    }
    if (obj instanceof FilePackage || obj instanceof DownloadLink) {
      popup.add(new JMenuItem(new TreeTableAction(panel,JDLocale.L("String_Node_Str","String_Node_Str") + "String_Node_Str" + alllinks.size()+ "String_Node_Str",TreeTableAction.DOWNLOAD_DLC,new Property("String_Node_Str",alllinks))));
      popup.add(buildpriomenu(alllinks));
      popup.add(new JMenuItem(new TreeTableAction(panel,JDLocale.L("String_Node_Str","String_Node_Str") + "String_Node_Str" + alllinks.size()+ "String_Node_Str",TreeTableAction.DOWNLOAD_COPY_PASSWORD,new Property("String_Node_Str",alllinks))));
      popup.add(tmp=new JMenuItem(new TreeTableAction(panel,JDLocale.L("String_Node_Str","String_Node_Str") + "String_Node_Str" + allnoncon.size()+ "String_Node_Str",TreeTableAction.DOWNLOAD_COPY_URL,new Property("String_Node_Str",allnoncon))));
      if (allnoncon.size() == 0)       tmp.setEnabled(false);
      popup.add(new JMenuItem(new TreeTableAction(panel,JDLocale.L("String_Node_Str","String_Node_Str") + "String_Node_Str" + alllinks.size()+ "String_Node_Str",TreeTableAction.CHECK,new Property("String_Node_Str",alllinks))));
      popup.add(new JMenuItem(new TreeTableAction(panel,JDLocale.L("String_Node_Str","String_Node_Str") + "String_Node_Str" + alllinks.size()+ "String_Node_Str",TreeTableAction.NEW_PACKAGE,new Property("String_Node_Str",alllinks))));
      popup.add(new JMenuItem(new TreeTableAction(panel,JDLocale.L("String_Node_Str","String_Node_Str") + "String_Node_Str" + alllinks.size()+ "String_Node_Str",TreeTableAction.SET_PW,new Property("String_Node_Str",alllinks))));
      popup.add(new JSeparator());
      HashMap<String,Object> prop=new HashMap<String,Object>();
      prop.put("String_Node_Str",alllinks);
      prop.put("String_Node_Str",true);
      popup.add(tmp=new JMenuItem(new TreeTableAction(panel,JDLocale.L("String_Node_Str","String_Node_Str") + "String_Node_Str" + links_disabled+ "String_Node_Str",TreeTableAction.DE_ACTIVATE,new Property("String_Node_Str",prop))));
      if (links_disabled == 0)       tmp.setEnabled(false);
      prop=new HashMap<String,Object>();
      prop.put("String_Node_Str",alllinks);
      prop.put("String_Node_Str",false);
      popup.add(tmp=new JMenuItem(new TreeTableAction(panel,JDLocale.L("String_Node_Str","String_Node_Str") + "String_Node_Str" + links_enabled+ "String_Node_Str",TreeTableAction.DE_ACTIVATE,new Property("String_Node_Str",prop))));
      if (links_enabled == 0)       tmp.setEnabled(false);
      popup.add(tmp=new JMenuItem(new TreeTableAction(panel,JDLocale.L("String_Node_Str","String_Node_Str") + "String_Node_Str" + resumlinks.size()+ "String_Node_Str",TreeTableAction.DOWNLOAD_RESUME,new Property("String_Node_Str",resumlinks))));
      if (resumlinks.size() == 0)       tmp.setEnabled(false);
      popup.add(new JMenuItem(new TreeTableAction(panel,JDLocale.L("String_Node_Str","String_Node_Str") + "String_Node_Str" + alllinks.size()+ "String_Node_Str",TreeTableAction.DOWNLOAD_RESET,new Property("String_Node_Str",alllinks))));
    }
    if (popup.getComponentCount() != 0)     popup.show(this,point.x,point.y);
  }
}