Program: 21121
Project: 21121
Buggy source:
private Component getDownloadLinkCell(JTable table,Object value,boolean isSelected,boolean hasFocus,int row,int column){
  dLink=(DownloadLink)value;
switch (column) {
case DownloadTreeTableModel.COL_PART:
    co=super.getTableCellRendererComponent(table,value,isSelected,hasFocus,row,column);
  clearSB();
if (dLink.getLinkStatus().isFailed()) {
  ((JRendererLabel)co).setIcon(this.imgFileFailed);
}
 else {
  ((JRendererLabel)co).setIcon(dLink.getIcon());
}
((JRendererLabel)co).setText(dLink.getName());
((JRendererLabel)co).setToolTipText(dLink.getName() + "String_Node_Str" + dLink.getFileInfomationString());
((JRendererLabel)co).setBorder(leftGap);
return co;
case DownloadTreeTableModel.COL_HOSTER:
co=super.getTableCellRendererComponent(table,value,isSelected,hasFocus,row,column);
clearSB();
((JRendererLabel)co).setBorder(null);
if (dLink.getPlugin() == null) {
((JComponent)co).setToolTipText(null);
((JRendererLabel)co).setText("String_Node_Str");
}
 else {
if (dLink.getPlugin().useIcon()) {
sb.append(dLink.getPlugin().getHost());
sb.append(dLink.getPlugin().getSessionInfo());
((JRendererLabel)co).setText(dLink.getPlugin().getSessionInfo());
((JRendererLabel)co).setIcon(dLink.getPlugin().getHosterIcon());
((JComponent)co).setToolTipText(sb.toString());
}
 else {
sb.append(dLink.getPlugin().getHost());
sb.append(dLink.getPlugin().getSessionInfo());
((JRendererLabel)co).setText(sb.toString());
((JComponent)co).setToolTipText(sb.toString());
}
}
return co;
case DownloadTreeTableModel.COL_PROGRESS:
if (dLink.getPlugin() == null) {
co=super.getTableCellRendererComponent(table,value,isSelected,hasFocus,row,column);
((JComponent)co).setToolTipText(null);
((JRendererLabel)co).setIcon(null);
((JRendererLabel)co).setText(strPluginError);
((JRendererLabel)co).setBorder(null);
return co;
}
 else if (!dLink.getPlugin().getWrapper().usePlugin()) {
co=super.getTableCellRendererComponent(table,value,isSelected,hasFocus,row,column);
((JComponent)co).setToolTipText(null);
((JRendererLabel)co).setIcon(null);
((JRendererLabel)co).setText(strPluginDisabled);
((JRendererLabel)co).setBorder(null);
return co;
}
 else if (dLink.getPluginProgress() != null) {
col=this.table.getCols()[column];
if (col.getWidth() < 40) {
}
 else if (col.getWidth() < 170) {
progress.setString(dLink.getPluginProgress().getPercent() + "String_Node_Str");
}
 else {
progress.setString(dLink.getPluginProgress().getPercent() + "String_Node_Str");
}
progress.setMaximum(dLink.getPluginProgress().getTotal());
progress.setValue(dLink.getPluginProgress().getCurrent());
progress.setToolTipText(null);
return progress;
}
 else if ((dLink.getLinkStatus().hasStatus(LinkStatus.ERROR_IP_BLOCKED) && dLink.getPlugin().getRemainingHosterWaittime() > 0) || (dLink.getLinkStatus().hasStatus(LinkStatus.ERROR_TEMPORARILY_UNAVAILABLE) && dLink.getLinkStatus().getRemainingWaittime() > 0)) {
progress.setMaximum(dLink.getLinkStatus().getTotalWaitTime());
progress.setForeground(COL_PROGRESS_ERROR);
progress.setValue(dLink.getLinkStatus().getRemainingWaittime());
clearSB();
col=this.table.getCols()[column];
if (col.getWidth() < 60) {
}
 else if (col.getWidth() < 170) {
sb.append(c.format(10000 * progress.getPercentComplete() / 100.0)).append('%');
}
 else {
sb.append(c.format(10000 * progress.getPercentComplete() / 100.0)).append("String_Node_Str").append(progress.getValue() / 1000).append('/').append(progress.getMaximum() / 1000).append(strSecondsAbrv).append(')');
}
progress.setString(sb.toString());
progress.setToolTipText(null);
return progress;
}
 else if (dLink.getDownloadCurrent() > 0) {
if (!dLink.getLinkStatus().isPluginActive()) {
if (dLink.getLinkStatus().hasStatus(LinkStatus.FINISHED)) {
clearSB();
col=this.table.getCols()[column];
if (col.getWidth() < 40) {
}
 else if (col.getWidth() < 170) {
sb.append("String_Node_Str");
}
 else {
sb.append("String_Node_Str").append(Formatter.formatReadable(Math.max(0,dLink.getDownloadSize()))).append(')');
}
progress.setString(sb.toString());
}
 else {
clearSB();
col=this.table.getCols()[column];
if (col.getWidth() < 60) {
}
 else if (col.getWidth() < 170) {
sb.append(c.format(dLink.getPercent() / 100.0)).append('%');
}
 else {
sb.append(c.format(dLink.getPercent() / 100.0)).append("String_Node_Str").append(Formatter.formatReadable(dLink.getDownloadCurrent())).append('/').append(Formatter.formatReadable(Math.max(0,dLink.getDownloadSize()))).append(')');
}
progress.setString(sb.toString());
}
}
 else {
if (dLink.getLinkStatus().hasStatus(LinkStatus.WAITING_USERIO)) {
progress.setString(strWaitIO);
}
 else {
clearSB();
col=this.table.getCols()[column];
if (col.getWidth() < 60) {
}
 else if (col.getWidth() < 170) {
sb.append(c.format(dLink.getPercent() / 100.0)).append('%');
}
 else {
sb.append(c.format(dLink.getPercent() / 100.0)).append("String_Node_Str").append(Formatter.formatReadable(dLink.getDownloadCurrent())).append('/').append(Formatter.formatReadable(Math.max(0,dLink.getDownloadSize()))).append(')');
}
progress.setString(sb.toString());
}
}
progress.setMaximum(10000);
progress.setToolTipText(null);
progress.setValue(dLink.getPercent());
return progress;
}
progress.setMaximum(10000);
progress.setValue(0);
if (dLink.getDownloadSize() > 1) {
clearSB();
col=this.table.getCols()[column];
if (col.getWidth() < 60) {
}
 else if (col.getWidth() < 170) {
sb.append(c.format(dLink.getPercent() / 100.0)).append('%');
}
 else {
sb.append(c.format(dLink.getPercent() / 100.0)).append("String_Node_Str").append(Formatter.formatReadable(dLink.getDownloadCurrent())).append('/').append(Formatter.formatReadable(Math.max(0,dLink.getDownloadSize()))).append(')');
}
progress.setString(sb.toString());
}
 else {
progress.setString("String_Node_Str");
}
progress.setToolTipText(null);
return progress;
case DownloadTreeTableModel.COL_STATUS:
co=super.getTableCellRendererComponent(table,value,isSelected,hasFocus,row,column);
this.statuspanel.setBackground(co.getBackground());
statuspanel.setPainter(((JRendererLabel)co).getPainter());
if (dLink.getPluginProgress() != null && dLink.getPluginProgress().getPercent() > 0.0 && dLink.getPluginProgress().getPercent() < 100.0) {
statuspanel.left.setText(dLink.getLinkStatus().getStatusString());
}
 else if (dLink.getLinkStatus().hasStatus(LinkStatus.FINISHED)) {
statuspanel.left.setText(dLink.getLinkStatus().getStatusString());
}
 else if (dLink.getLinkStatus().isFailed()) {
statuspanel.left.setText(dLink.getLinkStatus().getStatusString());
}
 else {
statuspanel.left.setText(dLink.getLinkStatus().getStatusString());
}
counter=0;
this.clearSB();
if (JDController.getInstance().getWatchdog() != null && JDController.getInstance().getWatchdog().isStopMark(value)) {
statuspanel.rights[counter].setIcon(imgStopMark);
if (counter > 0) sb.append("String_Node_Str");
sb.append(strTTStopMark);
counter++;
}
if (dLink.getLinkStatus().hasStatus(LinkStatus.FINISHED)) {
statuspanel.rights[counter].setIcon(imgFinished);
if (counter > 0) sb.append("String_Node_Str");
sb.append(strTTFinished);
counter++;
}
 else if (dLink.getLinkStatus().isFailed()) {
statuspanel.rights[counter].setIcon(imgFailed);
if (counter > 0) sb.append("String_Node_Str");
sb.append(strTTFailed);
counter++;
}
if (counter <= StatusLabel.ICONCOUNT && dLink.getPluginProgress() != null && dLink.getPluginProgress().getPercent() > 0.0 && dLink.getPluginProgress().getPercent() < 100.0) {
statuspanel.rights[counter].setIcon(imgExtract);
if (counter > 0) sb.append("String_Node_Str");
sb.append(strTTExtract);
counter++;
}
if (counter <= StatusLabel.ICONCOUNT) {
switch (dLink.getPriority()) {
case 0:
default :
break;
case -1:
statuspanel.rights[counter].setIcon(imgPriorityS);
if (counter > 0) sb.append("String_Node_Str");
sb.append(strTTPriorityS);
counter++;
break;
case 1:
statuspanel.rights[counter].setIcon(imgPriority1);
if (counter > 0) sb.append("String_Node_Str");
sb.append(strTTPriority1);
counter++;
break;
case 2:
statuspanel.rights[counter].setIcon(imgPriority2);
if (counter > 0) sb.append("String_Node_Str");
sb.append(strTTPriority2);
counter++;
break;
case 3:
statuspanel.rights[counter].setIcon(imgPriority3);
if (counter > 0) sb.append("String_Node_Str");
sb.append(strTTPriority3);
counter++;
break;
}
}
statuspanel.setToolTipText(sb.toString());
statuspanel.clearIcons(counter);
statuspanel.setBorder(null);
return statuspanel;
}
co=super.getTableCellRendererComponent(table,value,isSelected,hasFocus,row,column);
((JRendererLabel)co).setBorder(null);
((JRendererLabel)co).setToolTipText(null);
return co;
}

Fixed version (ground truth):
private Component getDownloadLinkCell(JTable table,Object value,boolean isSelected,boolean hasFocus,int row,int column){
  dLink=(DownloadLink)value;
switch (column) {
case DownloadTreeTableModel.COL_PART:
    co=super.getTableCellRendererComponent(table,value,isSelected,hasFocus,row,column);
  clearSB();
if (dLink.getLinkStatus().isFailed()) {
  ((JRendererLabel)co).setIcon(this.imgFileFailed);
}
 else {
  ((JRendererLabel)co).setIcon(dLink.getIcon());
}
((JRendererLabel)co).setText(dLink.getName());
((JRendererLabel)co).setToolTipText(dLink.getName() + "String_Node_Str" + dLink.getFileInfomationString());
((JRendererLabel)co).setBorder(leftGap);
return co;
case DownloadTreeTableModel.COL_HOSTER:
co=super.getTableCellRendererComponent(table,value,isSelected,hasFocus,row,column);
clearSB();
((JRendererLabel)co).setBorder(null);
if (dLink.getPlugin() == null) {
((JComponent)co).setToolTipText(null);
((JRendererLabel)co).setText("String_Node_Str");
}
 else {
if (dLink.getPlugin().useIcon()) {
sb.append(dLink.getPlugin().getHost());
sb.append(dLink.getPlugin().getSessionInfo());
((JRendererLabel)co).setText(dLink.getPlugin().getSessionInfo());
((JRendererLabel)co).setIcon(dLink.getPlugin().getHosterIcon());
((JComponent)co).setToolTipText(sb.toString());
}
 else {
sb.append(dLink.getPlugin().getHost());
sb.append(dLink.getPlugin().getSessionInfo());
((JRendererLabel)co).setText(sb.toString());
((JComponent)co).setToolTipText(sb.toString());
}
}
return co;
case DownloadTreeTableModel.COL_PROGRESS:
if (dLink.getPlugin() == null) {
co=super.getTableCellRendererComponent(table,value,isSelected,hasFocus,row,column);
((JComponent)co).setToolTipText(null);
((JRendererLabel)co).setIcon(null);
((JRendererLabel)co).setText(strPluginError);
((JRendererLabel)co).setBorder(null);
return co;
}
 else if (!dLink.getPlugin().getWrapper().usePlugin()) {
co=super.getTableCellRendererComponent(table,value,isSelected,hasFocus,row,column);
((JComponent)co).setToolTipText(null);
((JRendererLabel)co).setIcon(null);
((JRendererLabel)co).setText(strPluginDisabled);
((JRendererLabel)co).setBorder(null);
return co;
}
 else if (dLink.getPluginProgress() != null) {
col=this.table.getCols()[column];
if (col.getWidth() < 40) {
}
 else if (col.getWidth() < 170) {
progress.setString(dLink.getPluginProgress().getPercent() + "String_Node_Str");
}
 else {
progress.setString(dLink.getPluginProgress().getPercent() + "String_Node_Str");
}
progress.setMaximum(dLink.getPluginProgress().getTotal());
progress.setValue(dLink.getPluginProgress().getCurrent());
progress.setToolTipText(null);
progress.setForeground(null);
return progress;
}
 else if ((dLink.getLinkStatus().hasStatus(LinkStatus.ERROR_IP_BLOCKED) && dLink.getPlugin().getRemainingHosterWaittime() > 0) || (dLink.getLinkStatus().hasStatus(LinkStatus.ERROR_TEMPORARILY_UNAVAILABLE) && dLink.getLinkStatus().getRemainingWaittime() > 0)) {
progress.setMaximum(dLink.getLinkStatus().getTotalWaitTime());
progress.setForeground(COL_PROGRESS_ERROR);
progress.setValue(dLink.getLinkStatus().getRemainingWaittime());
clearSB();
col=this.table.getCols()[column];
if (col.getWidth() < 60) {
}
 else if (col.getWidth() < 170) {
sb.append(c.format(10000 * progress.getPercentComplete() / 100.0)).append('%');
}
 else {
sb.append(c.format(10000 * progress.getPercentComplete() / 100.0)).append("String_Node_Str").append(progress.getValue() / 1000).append('/').append(progress.getMaximum() / 1000).append(strSecondsAbrv).append(')');
}
progress.setString(sb.toString());
progress.setToolTipText(null);
return progress;
}
 else if (dLink.getDownloadCurrent() > 0) {
if (!dLink.getLinkStatus().isPluginActive()) {
if (dLink.getLinkStatus().hasStatus(LinkStatus.FINISHED)) {
clearSB();
col=this.table.getCols()[column];
if (col.getWidth() < 40) {
}
 else if (col.getWidth() < 170) {
sb.append("String_Node_Str");
}
 else {
sb.append("String_Node_Str").append(Formatter.formatReadable(Math.max(0,dLink.getDownloadSize()))).append(')');
}
progress.setString(sb.toString());
}
 else {
clearSB();
col=this.table.getCols()[column];
if (col.getWidth() < 60) {
}
 else if (col.getWidth() < 170) {
sb.append(c.format(dLink.getPercent() / 100.0)).append('%');
}
 else {
sb.append(c.format(dLink.getPercent() / 100.0)).append("String_Node_Str").append(Formatter.formatReadable(dLink.getDownloadCurrent())).append('/').append(Formatter.formatReadable(Math.max(0,dLink.getDownloadSize()))).append(')');
}
progress.setString(sb.toString());
}
}
 else {
if (dLink.getLinkStatus().hasStatus(LinkStatus.WAITING_USERIO)) {
progress.setString(strWaitIO);
}
 else {
clearSB();
col=this.table.getCols()[column];
if (col.getWidth() < 60) {
}
 else if (col.getWidth() < 170) {
sb.append(c.format(dLink.getPercent() / 100.0)).append('%');
}
 else {
sb.append(c.format(dLink.getPercent() / 100.0)).append("String_Node_Str").append(Formatter.formatReadable(dLink.getDownloadCurrent())).append('/').append(Formatter.formatReadable(Math.max(0,dLink.getDownloadSize()))).append(')');
}
progress.setString(sb.toString());
}
}
progress.setMaximum(10000);
progress.setToolTipText(null);
progress.setValue(dLink.getPercent());
progress.setForeground(null);
return progress;
}
progress.setMaximum(10000);
progress.setValue(0);
if (dLink.getDownloadSize() > 1) {
clearSB();
col=this.table.getCols()[column];
if (col.getWidth() < 60) {
}
 else if (col.getWidth() < 170) {
sb.append(c.format(dLink.getPercent() / 100.0)).append('%');
}
 else {
sb.append(c.format(dLink.getPercent() / 100.0)).append("String_Node_Str").append(Formatter.formatReadable(dLink.getDownloadCurrent())).append('/').append(Formatter.formatReadable(Math.max(0,dLink.getDownloadSize()))).append(')');
}
progress.setString(sb.toString());
}
 else {
progress.setString("String_Node_Str");
}
progress.setToolTipText(null);
progress.setForeground(null);
return progress;
case DownloadTreeTableModel.COL_STATUS:
co=super.getTableCellRendererComponent(table,value,isSelected,hasFocus,row,column);
this.statuspanel.setBackground(co.getBackground());
statuspanel.setPainter(((JRendererLabel)co).getPainter());
if (dLink.getPluginProgress() != null && dLink.getPluginProgress().getPercent() > 0.0 && dLink.getPluginProgress().getPercent() < 100.0) {
statuspanel.left.setText(dLink.getLinkStatus().getStatusString());
}
 else if (dLink.getLinkStatus().hasStatus(LinkStatus.FINISHED)) {
statuspanel.left.setText(dLink.getLinkStatus().getStatusString());
}
 else if (dLink.getLinkStatus().isFailed()) {
statuspanel.left.setText(dLink.getLinkStatus().getStatusString());
}
 else {
statuspanel.left.setText(dLink.getLinkStatus().getStatusString());
}
counter=0;
this.clearSB();
if (JDController.getInstance().getWatchdog() != null && JDController.getInstance().getWatchdog().isStopMark(value)) {
statuspanel.rights[counter].setIcon(imgStopMark);
if (counter > 0) sb.append("String_Node_Str");
sb.append(strTTStopMark);
counter++;
}
if (dLink.getLinkStatus().hasStatus(LinkStatus.FINISHED)) {
statuspanel.rights[counter].setIcon(imgFinished);
if (counter > 0) sb.append("String_Node_Str");
sb.append(strTTFinished);
counter++;
}
 else if (dLink.getLinkStatus().isFailed()) {
statuspanel.rights[counter].setIcon(imgFailed);
if (counter > 0) sb.append("String_Node_Str");
sb.append(strTTFailed);
counter++;
}
if (counter <= StatusLabel.ICONCOUNT && dLink.getPluginProgress() != null && dLink.getPluginProgress().getPercent() > 0.0 && dLink.getPluginProgress().getPercent() < 100.0) {
statuspanel.rights[counter].setIcon(imgExtract);
if (counter > 0) sb.append("String_Node_Str");
sb.append(strTTExtract);
counter++;
}
if (counter <= StatusLabel.ICONCOUNT) {
switch (dLink.getPriority()) {
case 0:
default :
break;
case -1:
statuspanel.rights[counter].setIcon(imgPriorityS);
if (counter > 0) sb.append("String_Node_Str");
sb.append(strTTPriorityS);
counter++;
break;
case 1:
statuspanel.rights[counter].setIcon(imgPriority1);
if (counter > 0) sb.append("String_Node_Str");
sb.append(strTTPriority1);
counter++;
break;
case 2:
statuspanel.rights[counter].setIcon(imgPriority2);
if (counter > 0) sb.append("String_Node_Str");
sb.append(strTTPriority2);
counter++;
break;
case 3:
statuspanel.rights[counter].setIcon(imgPriority3);
if (counter > 0) sb.append("String_Node_Str");
sb.append(strTTPriority3);
counter++;
break;
}
}
statuspanel.setToolTipText(sb.toString());
statuspanel.clearIcons(counter);
statuspanel.setBorder(null);
return statuspanel;
}
co=super.getTableCellRendererComponent(table,value,isSelected,hasFocus,row,column);
((JRendererLabel)co).setBorder(null);
((JRendererLabel)co).setToolTipText(null);
return co;
}