Program: 96964
Project: 96964
Buggy source:
@Override public void runOperation(VariableMap variableMap,IProgressMonitor monitor) throws Exception {
  populateTemplateList();
  boolean useArtifactNameInLinks=variableMap.getBoolean(USE_ARTIFACT_NAMES);
  boolean useParagraphNumbersInLinks=variableMap.getBoolean(USE_PARAGRAPH_NUMBERS);
  variableMap.getBoolean(INCLUDE_ARTIFACT_UUIDS);
  if (!useParagraphNumbersInLinks && !useArtifactNameInLinks) {
    throw new OseeArgumentException("String_Node_Str");
  }
  LinkType linkType;
  if (useArtifactNameInLinks && useParagraphNumbersInLinks) {
    linkType=LinkType.INTERNAL_DOC_REFERENCE_USE_PARAGRAPH_NUMBER_AND_NAME;
  }
 else   if (useParagraphNumbersInLinks) {
    linkType=LinkType.INTERNAL_DOC_REFERENCE_USE_PARAGRAPH_NUMBER;
  }
 else {
    linkType=LinkType.INTERNAL_DOC_REFERENCE_USE_NAME;
  }
  Artifact master=getTemplate(variableMap.getString(MASTER_TEMPLATE));
  if (master == null) {
    throw new OseeArgumentException("String_Node_Str");
  }
  Artifact slave=getTemplate(variableMap.getString(SLAVE_TEMPLATE));
  List<Artifact> artifacts=null;
  try {
    if (!isSRSPublishing) {
      if (orcsQueryWidget.getText().isEmpty()) {
        artifacts=variableMap.getArtifacts(IS_ARTIFACTS);
      }
 else {
        artifacts=getArtifactsFromOrcsQuery();
      }
    }
  }
 catch (  NullPointerException e) {
    throw new OseeArgumentException("String_Node_Str");
  }
  if (artifacts != null && !artifacts.isEmpty()) {
    branch=artifacts.get(0).getBranch();
  }
 else   if (!isSRSPublishing) {
    throw new OseeArgumentException("String_Node_Str");
  }
  if (branch == null) {
    throw new OseeArgumentException("String_Node_Str");
  }
  WordTemplateRenderer renderer=new WordTemplateRenderer();
  SkynetTransaction transaction=TransactionManager.createTransaction(branch,"String_Node_Str");
  Object[] options=new Object[]{"String_Node_Str",branch,"String_Node_Str",variableMap.getBranch(WAS_BRANCH),"String_Node_Str",variableMap.getValue(PUBLISH_AS_DIFF),"String_Node_Str",variableMap.getValue(INCLUDE_ARTIFACT_UUIDS),"String_Node_Str",linkType,WordTemplateRenderer.UPDATE_PARAGRAPH_NUMBER_OPTION,variableMap.getBoolean(UPDATE_PARAGRAPH_NUMBERS),"String_Node_Str",variableMap.getArtifactTypes(EXCLUDE_ARTIFACT_TYPES),ITemplateRenderer.TRANSACTION_OPTION,transaction,IRenderer.SKIP_ERRORS,true,"String_Node_Str",true,"String_Node_Str",true,"String_Node_Str",true,"String_Node_Str",monitor,ITemplateRenderer.USE_TEMPLATE_ONCE,true,WordTemplateRenderer.FIRST_TIME,true};
  renderer.publish(master,slave,artifacts,options);
  transaction.execute();
}

Fixed version (ground truth):
@Override public void runOperation(VariableMap variableMap,IProgressMonitor monitor) throws Exception {
  populateTemplateList();
  boolean useArtifactNameInLinks=variableMap.getBoolean(USE_ARTIFACT_NAMES);
  boolean useParagraphNumbersInLinks=variableMap.getBoolean(USE_PARAGRAPH_NUMBERS);
  variableMap.getBoolean(INCLUDE_ARTIFACT_UUIDS);
  if (!useParagraphNumbersInLinks && !useArtifactNameInLinks) {
    throw new OseeArgumentException("String_Node_Str");
  }
  LinkType linkType;
  if (useArtifactNameInLinks && useParagraphNumbersInLinks) {
    linkType=LinkType.INTERNAL_DOC_REFERENCE_USE_PARAGRAPH_NUMBER_AND_NAME;
  }
 else   if (useParagraphNumbersInLinks) {
    linkType=LinkType.INTERNAL_DOC_REFERENCE_USE_PARAGRAPH_NUMBER;
  }
 else {
    linkType=LinkType.INTERNAL_DOC_REFERENCE_USE_NAME;
  }
  Artifact master=getTemplate(variableMap.getString(MASTER_TEMPLATE));
  if (master == null) {
    throw new OseeArgumentException("String_Node_Str");
  }
  Artifact slave=getTemplate(variableMap.getString(SLAVE_TEMPLATE));
  List<Artifact> artifacts=null;
  try {
    if (orcsQueryWidget.getText().isEmpty()) {
      artifacts=variableMap.getArtifacts(IS_ARTIFACTS);
    }
 else {
      artifacts=getArtifactsFromOrcsQuery();
    }
  }
 catch (  NullPointerException e) {
    throw new OseeArgumentException("String_Node_Str");
  }
  if (artifacts != null && !artifacts.isEmpty()) {
    branch=artifacts.get(0).getBranch();
  }
 else {
    throw new OseeArgumentException("String_Node_Str");
  }
  if (branch == null) {
    throw new OseeArgumentException("String_Node_Str");
  }
  WordTemplateRenderer renderer=new WordTemplateRenderer();
  SkynetTransaction transaction=TransactionManager.createTransaction(branch,"String_Node_Str");
  Object[] options=new Object[]{"String_Node_Str",branch,"String_Node_Str",variableMap.getBranch(WAS_BRANCH),"String_Node_Str",variableMap.getValue(PUBLISH_AS_DIFF),"String_Node_Str",variableMap.getValue(INCLUDE_ARTIFACT_UUIDS),"String_Node_Str",linkType,WordTemplateRenderer.UPDATE_PARAGRAPH_NUMBER_OPTION,variableMap.getBoolean(UPDATE_PARAGRAPH_NUMBERS),"String_Node_Str",variableMap.getArtifactTypes(EXCLUDE_ARTIFACT_TYPES),ITemplateRenderer.TRANSACTION_OPTION,transaction,IRenderer.SKIP_ERRORS,true,"String_Node_Str",true,"String_Node_Str",true,"String_Node_Str",true,"String_Node_Str",monitor,ITemplateRenderer.USE_TEMPLATE_ONCE,true,WordTemplateRenderer.FIRST_TIME,true};
  renderer.publish(master,slave,artifacts,options);
  transaction.execute();
}