Program: 96674
Project: 96674
Buggy source:
private void processObjectArtifact(Artifact artifact,WordMLProducer wordMl,String outlineType,PresentationType presentationType,DataRightResult data) throws OseeCoreException {
  if (!artifact.isAttributeTypeValid(CoreAttributeTypes.WholeWordContent) && !artifact.isAttributeTypeValid(CoreAttributeTypes.NativeContent)) {
    if (!processedArtifacts.contains(artifact)) {
      boolean ignoreArtifact=excludeFolders && artifact.isOfType(CoreArtifactTypes.Folder) && !artifactsToExclude.containsKey(artifact.getId());
      boolean ignoreArtType=excludeArtifactTypes != null && artifact.isOfType(excludeArtifactTypes);
      boolean publishInline=artifact.getSoleAttributeValue(CoreAttributeTypes.PublishInline,false);
      boolean startedSection=false;
      boolean templateOnly=renderer.getBooleanOption("String_Node_Str");
      boolean includeUUIDs=renderer.getBooleanOption("String_Node_Str");
      if (!ignoreArtifact && !ignoreArtType) {
        if (outlining && !templateOnly) {
          String headingText=artifact.getSoleAttributeValue(headingAttributeType,"String_Node_Str");
          if (includeUUIDs) {
            String UUIDtext=String.format("String_Node_Str",artifact.getArtId());
            headingText=headingText.concat(UUIDtext);
          }
          Boolean mergeTag=(Boolean)renderer.getOption(ITemplateRenderer.ADD_MERGE_TAG);
          if (mergeTag != null && mergeTag) {
            headingText=headingText.concat("String_Node_Str");
          }
          if (!publishInline && !templateOnly) {
            paragraphNumber=wordMl.startOutlineSubSection("String_Node_Str",headingText,outlineType);
            startedSection=true;
          }
          if (paragraphNumber == null) {
            paragraphNumber=wordMl.startOutlineSubSection();
            startedSection=true;
          }
          if (renderer.getBooleanOption(WordTemplateRenderer.UPDATE_PARAGRAPH_NUMBER_OPTION) && !publishInline) {
            if (artifact.isAttributeTypeValid(CoreAttributeTypes.ParagraphNumber)) {
              artifact.setSoleAttributeValue(CoreAttributeTypes.ParagraphNumber,paragraphNumber.toString());
              SkynetTransaction transaction=(SkynetTransaction)renderer.getOption(ITemplateRenderer.TRANSACTION_OPTION);
              if (transaction != null) {
                artifact.persist(transaction);
              }
 else {
                artifact.persist(getClass().getSimpleName());
              }
            }
          }
        }
        PageOrientation orientation=WordRendererUtil.getPageOrientation(artifact);
        String footer=data.getContent(artifact.getGuid(),orientation);
        processMetadata(artifact,wordMl);
        processAttributes(artifact,wordMl,presentationType,publishInline,footer);
      }
      if (recurseChildren && !renderer.getBooleanOption(RECURSE_ON_LOAD) || renderer.getBooleanOption(RECURSE_ON_LOAD) && !renderer.getBooleanOption("String_Node_Str")) {
        for (        Artifact childArtifact : artifact.getChildren()) {
          processObjectArtifact(childArtifact,wordMl,outlineType,presentationType,data);
        }
      }
      if (startedSection) {
        wordMl.endOutlineSubSection();
      }
      processedArtifacts.add(artifact);
    }
  }
 else {
    nonTemplateArtifacts.add(artifact);
  }
}

Fixed version (ground truth):
private void processObjectArtifact(Artifact artifact,WordMLProducer wordMl,String outlineType,PresentationType presentationType,DataRightResult data) throws OseeCoreException {
  if (!artifact.isAttributeTypeValid(CoreAttributeTypes.WholeWordContent) && !artifact.isAttributeTypeValid(CoreAttributeTypes.NativeContent)) {
    if (!processedArtifacts.contains(artifact)) {
      boolean ignoreArtifact=(excludeFolders && artifact.isOfType(CoreArtifactTypes.Folder)) || artifactsToExclude.containsKey(ArtifactId.valueOf(artifact.getId()));
      boolean ignoreArtType=excludeArtifactTypes != null && artifact.isOfType(excludeArtifactTypes);
      boolean publishInline=artifact.getSoleAttributeValue(CoreAttributeTypes.PublishInline,false);
      boolean startedSection=false;
      boolean templateOnly=renderer.getBooleanOption("String_Node_Str");
      boolean includeUUIDs=renderer.getBooleanOption("String_Node_Str");
      if (!ignoreArtifact && !ignoreArtType) {
        if (outlining && !templateOnly) {
          String headingText=artifact.getSoleAttributeValue(headingAttributeType,"String_Node_Str");
          if (includeUUIDs) {
            String UUIDtext=String.format("String_Node_Str",artifact.getArtId());
            headingText=headingText.concat(UUIDtext);
          }
          Boolean mergeTag=(Boolean)renderer.getOption(ITemplateRenderer.ADD_MERGE_TAG);
          if (mergeTag != null && mergeTag) {
            headingText=headingText.concat("String_Node_Str");
          }
          if (!publishInline && !templateOnly) {
            paragraphNumber=wordMl.startOutlineSubSection("String_Node_Str",headingText,outlineType);
            startedSection=true;
          }
          if (paragraphNumber == null) {
            paragraphNumber=wordMl.startOutlineSubSection();
            startedSection=true;
          }
          if (renderer.getBooleanOption(WordTemplateRenderer.UPDATE_PARAGRAPH_NUMBER_OPTION) && !publishInline) {
            if (artifact.isAttributeTypeValid(CoreAttributeTypes.ParagraphNumber)) {
              artifact.setSoleAttributeValue(CoreAttributeTypes.ParagraphNumber,paragraphNumber.toString());
              SkynetTransaction transaction=(SkynetTransaction)renderer.getOption(ITemplateRenderer.TRANSACTION_OPTION);
              if (transaction != null) {
                artifact.persist(transaction);
              }
 else {
                artifact.persist(getClass().getSimpleName());
              }
            }
          }
        }
        PageOrientation orientation=WordRendererUtil.getPageOrientation(artifact);
        String footer=data.getContent(artifact.getGuid(),orientation);
        processMetadata(artifact,wordMl);
        processAttributes(artifact,wordMl,presentationType,publishInline,footer);
      }
      if (recurseChildren && !renderer.getBooleanOption(RECURSE_ON_LOAD) || renderer.getBooleanOption(RECURSE_ON_LOAD) && !renderer.getBooleanOption("String_Node_Str")) {
        for (        Artifact childArtifact : artifact.getChildren()) {
          processObjectArtifact(childArtifact,wordMl,outlineType,presentationType,data);
        }
      }
      if (startedSection) {
        wordMl.endOutlineSubSection();
      }
      processedArtifacts.add(artifact);
    }
  }
 else {
    nonTemplateArtifacts.add(artifact);
  }
}