Program: 86094
Project: 86094
Buggy source:
public void setMDoc(final MasterDocumentDTO mdoc,int it){
  m_mainPanel.setMDocAuthor(mdoc.getAuthor().toString());
  int iteration=0;
  String revision="String_Node_Str";
  if (it == mdoc.getIterations().size() - 1) {
    if (mdoc.getLastIteration() != null) {
      iteration=mdoc.getLastIteration().getIteration();
      revision=mdoc.getLastIteration().getRevisionNote();
    }
  }
 else {
    iteration=it + 1;
    revision=mdoc.getIterations().get(it).getRevisionNote();
  }
  String webappContext=HTMLUtil.getWebContext();
  String htmlLink="String_Node_Str" + webappContext + "String_Node_Str"+ mdoc.getWorkspaceId()+ "String_Node_Str"+ mdoc.getId()+ "String_Node_Str"+ mdoc.getVersion()+ "String_Node_Str"+ i18n.permaLink()+ "String_Node_Str";
  m_mainPanel.setPermaLink(htmlLink);
  m_mainPanel.setDocID(mdoc.getId() + "String_Node_Str" + mdoc.getVersion()+ "String_Node_Str"+ iteration);
  m_mainPanel.setCreationDate(mdoc.getCreationDate());
  m_mainPanel.setModificationDate(mdoc.getCheckOutDate());
  m_mainPanel.setCheckOutUser(mdoc.getCheckOutUser());
  m_mainPanel.setMDocType(mdoc.getType());
  m_mainPanel.setMDocTitle(mdoc.getTitle());
  m_mainPanel.setLifeCycleState(mdoc.getLifeCycleState());
  m_mainPanel.setRevisionNote(revision);
  m_mainPanel.setTags(mdoc.getTags() == null ? "String_Node_Str" : Arrays.toString(mdoc.getTags()));
  m_iterationNavigator.setIterationsNumber(it,mdoc.getIterations().size() - 1);
  m_iterationNavigator.setVisible(mdoc.getIterations().size() != 1);
  if (mdoc.getWorkflow() != null) {
    m_mainPanel.setWorkflow(mdoc.getWorkflow());
  }
}

Fixed version (ground truth):
public void setMDoc(final MasterDocumentDTO mdoc,int it){
  m_mainPanel.setMDocAuthor(mdoc.getAuthor().toString());
  int iteration=0;
  String revision="String_Node_Str";
  if (it == mdoc.getIterations().size() - 1) {
    if (mdoc.getLastIteration() != null) {
      iteration=mdoc.getLastIteration().getIteration();
      revision=mdoc.getLastIteration().getRevisionNote();
    }
  }
 else {
    iteration=it + 1;
    revision=mdoc.getIterations().get(it).getRevisionNote();
  }
  String webappContext=HTMLUtil.getWebContext();
  String htmlLink="String_Node_Str" + (webappContext == null ? "String_Node_Str" : webappContext + "String_Node_Str") + "String_Node_Str"+ mdoc.getWorkspaceId()+ "String_Node_Str"+ mdoc.getId()+ "String_Node_Str"+ mdoc.getVersion()+ "String_Node_Str"+ i18n.permaLink()+ "String_Node_Str";
  m_mainPanel.setPermaLink(htmlLink);
  m_mainPanel.setDocID(mdoc.getId() + "String_Node_Str" + mdoc.getVersion()+ "String_Node_Str"+ iteration);
  m_mainPanel.setCreationDate(mdoc.getCreationDate());
  m_mainPanel.setModificationDate(mdoc.getCheckOutDate());
  m_mainPanel.setCheckOutUser(mdoc.getCheckOutUser());
  m_mainPanel.setMDocType(mdoc.getType());
  m_mainPanel.setMDocTitle(mdoc.getTitle());
  m_mainPanel.setLifeCycleState(mdoc.getLifeCycleState());
  m_mainPanel.setRevisionNote(revision);
  m_mainPanel.setTags(mdoc.getTags() == null ? "String_Node_Str" : Arrays.toString(mdoc.getTags()));
  m_iterationNavigator.setIterationsNumber(it,mdoc.getIterations().size() - 1);
  m_iterationNavigator.setVisible(mdoc.getIterations().size() != 1);
  if (mdoc.getWorkflow() != null) {
    m_mainPanel.setWorkflow(mdoc.getWorkflow());
  }
}