Program: 21129
Project: 21129
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();
((JRendererLabel)co).setIcon(dLink.getIcon());
((JRendererLabel)co).setText(dLink.getName());
((JRendererLabel)co).setBorder(leftGap);
return co;
case DownloadTreeTableModel.COL_HOSTER:
co=super.getTableCellRendererComponent(table,value,isSelected,hasFocus,row,column);
clearSB();
((JRendererLabel)co).setBorder(null);
sb.append(dLink.getPlugin().getHost());
sb.append(dLink.getPlugin().getSessionInfo());
((JRendererLabel)co).setText(sb.toString());
return co;
case DownloadTreeTableModel.COL_PROGRESS:
if (dLink.getPlugin() == null) {
co=super.getTableCellRendererComponent(table,value,isSelected,hasFocus,row,column);
((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);
((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());
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=((TableColumnExt)table.getColumnModel().getColumn(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());
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(JDUtilities.formatBytesToMB(dLink.getDownloadCurrent())).append('/').append(JDUtilities.formatBytesToMB(Math.max(1,dLink.getDownloadSize()))).append(')');
}
progress.setString(sb.toString());
}
 else {
progress.setString("String_Node_Str");
}
}
 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(JDUtilities.formatBytesToMB(dLink.getDownloadCurrent())).append('/').append(JDUtilities.formatBytesToMB(Math.max(1,dLink.getDownloadSize()))).append(')');
}
progress.setString(sb.toString());
}
}
progress.setMaximum(10000);
progress.setValue(dLink.getPercent());
return progress;
}
co=super.getTableCellRendererComponent(table,value,isSelected,hasFocus,row,column);
((JRendererLabel)co).setIcon(null);
((JRendererLabel)co).setText("String_Node_Str");
((JRendererLabel)co).setBorder(null);
return co;
case DownloadTreeTableModel.COL_STATUS_ICON:
co=super.getTableCellRendererComponent(table,value,isSelected,hasFocus,row,column);
((JRendererLabel)co).setText("String_Node_Str");
if (dLink.getPluginProgress() != null && dLink.getPluginProgress().getPercent() > 0.0 && dLink.getPluginProgress().getPercent() < 100.0) {
((JRendererLabel)co).setIcon(imgExtract);
}
 else if (dLink.getLinkStatus().hasStatus(LinkStatus.FINISHED)) {
((JRendererLabel)co).setIcon(imgFinished);
}
 else if (dLink.getLinkStatus().isFailed()) {
((JRendererLabel)co).setIcon(imgFailed);
}
 else {
((JRendererLabel)co).setIcon(null);
}
((JRendererLabel)co).setBorder(null);
return co;
case DownloadTreeTableModel.COL_STATUS:
co=super.getTableCellRendererComponent(table,value,isSelected,hasFocus,row,column);
((JRendererLabel)co).setIcon(null);
if (dLink.getPluginProgress() != null && dLink.getPluginProgress().getPercent() > 0.0 && dLink.getPluginProgress().getPercent() < 100.0) {
((JRendererLabel)co).setText(dLink.getLinkStatus().getStatusString());
}
 else if (dLink.getLinkStatus().hasStatus(LinkStatus.FINISHED)) {
((JRendererLabel)co).setText("String_Node_Str");
}
 else if (dLink.getLinkStatus().isFailed()) {
((JRendererLabel)co).setText("String_Node_Str");
}
 else {
((JRendererLabel)co).setText(dLink.getLinkStatus().getStatusString());
}
((JRendererLabel)co).setBorder(null);
return co;
}
co=super.getTableCellRendererComponent(table,value,isSelected,hasFocus,row,column);
((JRendererLabel)co).setBorder(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();
((JRendererLabel)co).setIcon(dLink.getIcon());
((JRendererLabel)co).setText(dLink.getName());
((JRendererLabel)co).setBorder(leftGap);
return co;
case DownloadTreeTableModel.COL_HOSTER:
co=super.getTableCellRendererComponent(table,value,isSelected,hasFocus,row,column);
clearSB();
((JRendererLabel)co).setBorder(null);
sb.append(dLink.getPlugin().getHost());
sb.append(dLink.getPlugin().getSessionInfo());
((JRendererLabel)co).setText(sb.toString());
return co;
case DownloadTreeTableModel.COL_PROGRESS:
if (dLink.getPlugin() == null) {
co=super.getTableCellRendererComponent(table,value,isSelected,hasFocus,row,column);
((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);
((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());
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());
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(JDUtilities.formatBytesToMB(dLink.getDownloadCurrent())).append('/').append(JDUtilities.formatBytesToMB(Math.max(1,dLink.getDownloadSize()))).append(')');
}
progress.setString(sb.toString());
}
 else {
progress.setString("String_Node_Str");
}
}
 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(JDUtilities.formatBytesToMB(dLink.getDownloadCurrent())).append('/').append(JDUtilities.formatBytesToMB(Math.max(1,dLink.getDownloadSize()))).append(')');
}
progress.setString(sb.toString());
}
}
progress.setMaximum(10000);
progress.setValue(dLink.getPercent());
return progress;
}
co=super.getTableCellRendererComponent(table,value,isSelected,hasFocus,row,column);
((JRendererLabel)co).setIcon(null);
((JRendererLabel)co).setText("String_Node_Str");
((JRendererLabel)co).setBorder(null);
return co;
case DownloadTreeTableModel.COL_STATUS_ICON:
co=super.getTableCellRendererComponent(table,value,isSelected,hasFocus,row,column);
((JRendererLabel)co).setText("String_Node_Str");
if (dLink.getPluginProgress() != null && dLink.getPluginProgress().getPercent() > 0.0 && dLink.getPluginProgress().getPercent() < 100.0) {
((JRendererLabel)co).setIcon(imgExtract);
}
 else if (dLink.getLinkStatus().hasStatus(LinkStatus.FINISHED)) {
((JRendererLabel)co).setIcon(imgFinished);
}
 else if (dLink.getLinkStatus().isFailed()) {
((JRendererLabel)co).setIcon(imgFailed);
}
 else {
((JRendererLabel)co).setIcon(null);
}
((JRendererLabel)co).setBorder(null);
return co;
case DownloadTreeTableModel.COL_STATUS:
co=super.getTableCellRendererComponent(table,value,isSelected,hasFocus,row,column);
((JRendererLabel)co).setIcon(null);
if (dLink.getPluginProgress() != null && dLink.getPluginProgress().getPercent() > 0.0 && dLink.getPluginProgress().getPercent() < 100.0) {
((JRendererLabel)co).setText(dLink.getLinkStatus().getStatusString());
}
 else if (dLink.getLinkStatus().hasStatus(LinkStatus.FINISHED)) {
((JRendererLabel)co).setText("String_Node_Str");
}
 else if (dLink.getLinkStatus().isFailed()) {
((JRendererLabel)co).setText("String_Node_Str");
}
 else {
((JRendererLabel)co).setText(dLink.getLinkStatus().getStatusString());
}
((JRendererLabel)co).setBorder(null);
return co;
}
co=super.getTableCellRendererComponent(table,value,isSelected,hasFocus,row,column);
((JRendererLabel)co).setBorder(null);
return co;
}