Program: 188216
Project: 188216
Buggy source:
public ShowJobReport(IndexedReport jobReport){
  this.jobReport=jobReport;
  initWidget(uiBinder.createAndBindUi(this));
  job.setText(jobReport.getJobName());
  job.setHref(HistoryUtils.createHistoryHashLink(ShowJob.RESOLVER,jobReport.getJobId()));
  outcomeObjectState.setVisible(false);
  boolean hasSource=!jobReport.getSourceObjectOriginalIds().isEmpty() || !jobReport.getSourceObjectId().isEmpty();
  if (hasSource) {
    String idText=!jobReport.getSourceObjectOriginalIds().isEmpty() ? "String_Node_Str" + StringUtils.prettyPrint(jobReport.getSourceObjectOriginalIds()) + "String_Node_Str" : "String_Node_Str";
    if (StringUtils.isNotBlank(jobReport.getSourceObjectOriginalName())) {
      sourceObject.setText(jobReport.getSourceObjectOriginalName() + idText);
    }
 else     if (StringUtils.isNotBlank(jobReport.getSourceObjectLabel())) {
      sourceObject.setText(jobReport.getSourceObjectLabel() + idText);
    }
 else     if (StringUtils.isNotBlank(jobReport.getSourceObjectId())) {
      sourceObject.setText(jobReport.getSourceObjectId() + idText);
    }
 else {
      hasSource=false;
    }
    sourceObject.setHref(HistoryUtils.createHistoryHashLink(HistoryUtils.getHistoryUuidResolver(jobReport.getSourceObjectClass(),jobReport.getSourceObjectId())));
    sourceObjectLabel.setText(messages.jobReportSource(jobReport.getSourceObjectClass()));
  }
  sourceObjectLabel.setVisible(hasSource);
  sourceObject.setVisible(hasSource);
  boolean hasOutcome=StringUtils.isNotBlank(jobReport.getOutcomeObjectId()) && !jobReport.getOutcomeObjectId().equals(jobReport.getSourceObjectId());
  if (hasOutcome) {
    if (jobReport.getOutcomeObjectLabel() != null) {
      outcomeObject.setText(jobReport.getOutcomeObjectLabel());
    }
 else     if (jobReport.getOutcomeObjectId() != null) {
      outcomeObject.setText(jobReport.getOutcomeObjectId());
    }
 else {
      hasOutcome=false;
    }
    outcomeObject.setHref(HistoryUtils.createHistoryHashLink(HistoryUtils.getHistoryUuidResolver(jobReport.getOutcomeObjectClass(),jobReport.getOutcomeObjectId())));
    outcomeObjectLabel.setText(messages.jobReportOutcome(jobReport.getOutcomeObjectClass()));
    outcomeObjectState.setHTML(HtmlSnippetUtils.getAIPStateHTML(jobReport.getOutcomeObjectState()));
  }
  outcomeObject.setVisible(hasOutcome);
  outcomeObjectState.setVisible(hasOutcome);
  outcomeObjectLabel.setVisible(hasOutcome);
  DateTimeFormat dateTimeFormat=DateTimeFormat.getFormat(RodaConstants.DEFAULT_DATETIME_FORMAT);
  dateCreated.setText(dateTimeFormat.format(jobReport.getDateCreated()));
  dateUpdated.setText(dateTimeFormat.format(jobReport.getDateUpdated()));
  duration.setText(Humanize.durationInDHMS(jobReport.getDateCreated(),jobReport.getDateUpdated(),DHMSFormat.LONG));
  status.setHTML(HtmlSnippetUtils.getPluginStateHTML(jobReport.getPluginState()));
  progress.setText(messages.showJobReportProgress(jobReport.getCompletionPercentage(),jobReport.getStepsCompleted(),jobReport.getTotalSteps()));
  ListSelectionUtils.bindLayout(jobReport,searchPrevious,searchNext,keyboardFocus,true,false,false);
  for (  Report reportItem : jobReport.getReports()) {
    FlowPanel panel=new FlowPanel();
    panel.setStyleName("String_Node_Str");
    panel.addStyleName("String_Node_Str");
    reportItems.add(panel);
    FlowPanel panelHeading=new FlowPanel();
    panelHeading.setStyleName("String_Node_Str");
    Label panelTitle=new Label(reportItem.getTitle());
    panelTitle.setStyleName("String_Node_Str");
    panelHeading.add(panelTitle);
    panel.add(panelHeading);
    FlowPanel panelBody=new FlowPanel();
    panelBody.addStyleName("String_Node_Str");
    panel.add(panelBody);
    Label attributeLabel=new Label(messages.reportAgent());
    attributeLabel.setStyleName("String_Node_Str");
    panelBody.add(attributeLabel);
    String text;
    if (StringUtils.isNotBlank(reportItem.getPluginVersion())) {
      text=messages.pluginLabelWithVersion(reportItem.getPlugin(),reportItem.getPluginVersion());
    }
 else {
      text=messages.pluginLabel(reportItem.getPlugin());
    }
    Label attributeValue=new Label(text);
    attributeValue.setStyleName("String_Node_Str");
    panelBody.add(attributeValue);
    attributeLabel=new Label(messages.reportStartDatetime());
    attributeLabel.setStyleName("String_Node_Str");
    panelBody.add(attributeLabel);
    attributeValue=new Label(dateTimeFormat.format(reportItem.getDateCreated()));
    attributeValue.setStyleName("String_Node_Str");
    panelBody.add(attributeValue);
    attributeLabel=new Label(messages.reportEndDatetime());
    attributeLabel.setStyleName("String_Node_Str");
    panelBody.add(attributeLabel);
    attributeValue=new Label(dateTimeFormat.format(reportItem.getDateUpdated()));
    attributeValue.setStyleName("String_Node_Str");
    panelBody.add(attributeValue);
    attributeLabel=new Label(messages.reportOutcome());
    attributeLabel.setStyleName("String_Node_Str");
    panelBody.add(attributeLabel);
    HTML outcomeHTML=new HTML(HtmlSnippetUtils.getPluginStateHTML(reportItem.getPluginState()));
    panelBody.add(outcomeHTML);
    if (reportItem.getPluginDetails() != null && !"String_Node_Str".equals(reportItem.getPluginDetails())) {
      attributeLabel=new Label(messages.reportOutcomeDetails());
      attributeLabel.setStyleName("String_Node_Str");
      panelBody.add(attributeLabel);
      if (reportItem.isHtmlPluginDetails()) {
        attributeValue=new HTML(SafeHtmlUtils.fromTrustedString(reportItem.getPluginDetails()));
      }
 else {
        attributeValue=new Label(reportItem.getPluginDetails());
      }
      attributeValue.addStyleName("String_Node_Str");
      panelBody.add(attributeValue);
    }
  }
  Element firstElement=this.getElement().getFirstChildElement();
  if ("String_Node_Str".equalsIgnoreCase(firstElement.getTagName())) {
    firstElement.removeFromParent();
  }
}

Fixed version (ground truth):
public ShowJobReport(IndexedReport jobReport){
  this.jobReport=jobReport;
  initWidget(uiBinder.createAndBindUi(this));
  job.setText(jobReport.getJobName());
  job.setHref(HistoryUtils.createHistoryHashLink(ShowJob.RESOLVER,jobReport.getJobId()));
  outcomeObjectState.setVisible(false);
  boolean hasSource=!jobReport.getSourceObjectOriginalIds().isEmpty() || !jobReport.getSourceObjectId().isEmpty();
  if (hasSource) {
    String idText=!jobReport.getSourceObjectOriginalIds().isEmpty() ? "String_Node_Str" + StringUtils.prettyPrint(jobReport.getSourceObjectOriginalIds()) + "String_Node_Str" : "String_Node_Str";
    if (StringUtils.isNotBlank(jobReport.getSourceObjectOriginalName())) {
      sourceObject.setText(jobReport.getSourceObjectOriginalName() + idText);
    }
 else     if (StringUtils.isNotBlank(jobReport.getSourceObjectLabel())) {
      sourceObject.setText(jobReport.getSourceObjectLabel() + idText);
    }
 else     if (StringUtils.isNotBlank(jobReport.getSourceObjectId())) {
      sourceObject.setText(jobReport.getSourceObjectId() + idText);
    }
 else {
      hasSource=false;
    }
    sourceObject.setHref(HistoryUtils.createHistoryHashLink(HistoryUtils.getHistoryUuidResolver(jobReport.getSourceObjectClass(),jobReport.getSourceObjectId())));
    sourceObjectLabel.setText(messages.jobReportSource(jobReport.getSourceObjectClass()));
  }
  sourceObjectLabel.setVisible(hasSource);
  sourceObject.setVisible(hasSource);
  boolean hasOutcome=StringUtils.isNotBlank(jobReport.getOutcomeObjectId()) && !jobReport.getOutcomeObjectId().equals(jobReport.getSourceObjectId());
  if (hasOutcome) {
    if (jobReport.getOutcomeObjectLabel() != null) {
      outcomeObject.setText(jobReport.getOutcomeObjectLabel());
    }
 else     if (jobReport.getOutcomeObjectId() != null) {
      outcomeObject.setText(jobReport.getOutcomeObjectId());
    }
 else {
      hasOutcome=false;
    }
    outcomeObject.setHref(HistoryUtils.createHistoryHashLink(HistoryUtils.getHistoryUuidResolver(jobReport.getOutcomeObjectClass(),jobReport.getOutcomeObjectId())));
    outcomeObjectLabel.setText(messages.jobReportOutcome(jobReport.getOutcomeObjectClass()));
    outcomeObjectState.setHTML(HtmlSnippetUtils.getAIPStateHTML(jobReport.getOutcomeObjectState()));
  }
  outcomeObject.setVisible(hasOutcome);
  outcomeObjectState.setVisible(hasOutcome);
  outcomeObjectLabel.setVisible(hasOutcome);
  dateCreated.setText(Humanize.formatDateTime(jobReport.getDateCreated()));
  dateUpdated.setText(Humanize.formatDateTime(jobReport.getDateUpdated()));
  duration.setText(Humanize.durationInDHMS(jobReport.getDateCreated(),jobReport.getDateUpdated(),DHMSFormat.LONG));
  status.setHTML(HtmlSnippetUtils.getPluginStateHTML(jobReport.getPluginState()));
  progress.setText(messages.showJobReportProgress(jobReport.getCompletionPercentage(),jobReport.getStepsCompleted(),jobReport.getTotalSteps()));
  ListSelectionUtils.bindLayout(jobReport,searchPrevious,searchNext,keyboardFocus,true,false,false);
  for (  Report reportItem : jobReport.getReports()) {
    FlowPanel panel=new FlowPanel();
    panel.setStyleName("String_Node_Str");
    panel.addStyleName("String_Node_Str");
    reportItems.add(panel);
    FlowPanel panelHeading=new FlowPanel();
    panelHeading.setStyleName("String_Node_Str");
    Label panelTitle=new Label(reportItem.getTitle());
    panelTitle.setStyleName("String_Node_Str");
    panelHeading.add(panelTitle);
    panel.add(panelHeading);
    FlowPanel panelBody=new FlowPanel();
    panelBody.addStyleName("String_Node_Str");
    panel.add(panelBody);
    Label attributeLabel=new Label(messages.reportAgent());
    attributeLabel.setStyleName("String_Node_Str");
    panelBody.add(attributeLabel);
    String text;
    if (StringUtils.isNotBlank(reportItem.getPluginVersion())) {
      text=messages.pluginLabelWithVersion(reportItem.getPlugin(),reportItem.getPluginVersion());
    }
 else {
      text=messages.pluginLabel(reportItem.getPlugin());
    }
    Label attributeValue=new Label(text);
    attributeValue.setStyleName("String_Node_Str");
    panelBody.add(attributeValue);
    attributeLabel=new Label(messages.reportStartDatetime());
    attributeLabel.setStyleName("String_Node_Str");
    panelBody.add(attributeLabel);
    attributeValue=new Label(Humanize.formatDateTime(reportItem.getDateCreated()));
    attributeValue.setStyleName("String_Node_Str");
    panelBody.add(attributeValue);
    attributeLabel=new Label(messages.reportEndDatetime());
    attributeLabel.setStyleName("String_Node_Str");
    panelBody.add(attributeLabel);
    attributeValue=new Label(Humanize.formatDateTime(reportItem.getDateUpdated()));
    attributeValue.setStyleName("String_Node_Str");
    panelBody.add(attributeValue);
    attributeLabel=new Label(messages.reportOutcome());
    attributeLabel.setStyleName("String_Node_Str");
    panelBody.add(attributeLabel);
    HTML outcomeHTML=new HTML(HtmlSnippetUtils.getPluginStateHTML(reportItem.getPluginState()));
    panelBody.add(outcomeHTML);
    if (reportItem.getPluginDetails() != null && !"String_Node_Str".equals(reportItem.getPluginDetails())) {
      attributeLabel=new Label(messages.reportOutcomeDetails());
      attributeLabel.setStyleName("String_Node_Str");
      panelBody.add(attributeLabel);
      if (reportItem.isHtmlPluginDetails()) {
        attributeValue=new HTML(SafeHtmlUtils.fromTrustedString(reportItem.getPluginDetails()));
      }
 else {
        attributeValue=new Label(reportItem.getPluginDetails());
      }
      attributeValue.addStyleName("String_Node_Str");
      panelBody.add(attributeValue);
    }
  }
  Element firstElement=this.getElement().getFirstChildElement();
  if ("String_Node_Str".equalsIgnoreCase(firstElement.getTagName())) {
    firstElement.removeFromParent();
  }
}