Program: 96680
Project: 96680
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 (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");
  }
  Object view=variableMap.getValue(VIEW);
  ArtifactId viewId=ArtifactId.SENTINEL;
  for (  Entry<Long,String> entry : branchViews.entrySet()) {
    if (entry.getValue().equals(view)) {
      viewId=ArtifactId.valueOf(entry.getKey());
    }
  }
  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,"String_Node_Str",viewId};
  Boolean isDiff=(Boolean)variableMap.getValue(PUBLISH_AS_DIFF);
  int toProcessSize=0;
  if (isDiff) {
    for (    Artifact art : artifacts) {
      toProcessSize+=art.getDescendants().size();
    }
  }
  final int totalSize=toProcessSize;
  final AtomicReference<Boolean> result=new AtomicReference<>();
  final int maxArtsForQuickDiff=900;
  Display.getDefault().syncExec(new Runnable(){
    @Override public void run(){
      double secPerArt=2;
      double minutes=(totalSize * secPerArt) / 60;
      if (isDiff && totalSize > maxArtsForQuickDiff && !MessageDialog.openConfirm(Display.getDefault().getActiveShell(),"String_Node_Str","String_Node_Str" + totalSize + "String_Node_Str"+ "String_Node_Str"+ minutes+ "String_Node_Str")) {
        result.set(false);
      }
 else {
        result.set(true);
      }
    }
  }
);
  if (result.get()) {
    renderer.publish(master,slave,artifacts,options);
    transaction.execute();
    monitor.done();
  }
}

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");
  }
  Object view=variableMap.getValue(VIEW);
  ArtifactId viewId=ArtifactId.SENTINEL;
  if (branchViews != null && !branchViews.isEmpty()) {
    for (    Entry<Long,String> entry : branchViews.entrySet()) {
      if (entry.getValue().equals(view)) {
        viewId=ArtifactId.valueOf(entry.getKey());
      }
    }
  }
  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,"String_Node_Str",viewId};
  Boolean isDiff=(Boolean)variableMap.getValue(PUBLISH_AS_DIFF);
  int toProcessSize=0;
  if (isDiff) {
    for (    Artifact art : artifacts) {
      toProcessSize+=art.getDescendants().size();
    }
  }
  final int totalSize=toProcessSize;
  final AtomicReference<Boolean> result=new AtomicReference<>();
  final int maxArtsForQuickDiff=900;
  Display.getDefault().syncExec(new Runnable(){
    @Override public void run(){
      double secPerArt=2;
      double minutes=(totalSize * secPerArt) / 60;
      if (isDiff && totalSize > maxArtsForQuickDiff && !MessageDialog.openConfirm(Display.getDefault().getActiveShell(),"String_Node_Str","String_Node_Str" + totalSize + "String_Node_Str"+ "String_Node_Str"+ minutes+ "String_Node_Str")) {
        result.set(false);
      }
 else {
        result.set(true);
      }
    }
  }
);
  if (result.get()) {
    renderer.publish(master,slave,artifacts,options);
    transaction.execute();
    monitor.done();
  }
}