docs: @SuppressWarnings("unchecked")
      private <T extends BaseTopicWrapper<T>> void doSpecTopicFirstPass(final BuildData buildData,
              final Map<SpecTopic, Set<String>> usedIdAttributes, final List<Entity> entities) throws BuildProcessingException {
          final List<SpecTopic> specTopics = buildData.getBuildDatabase().getAllSpecTopics();
  
          for (final SpecTopic specTopic : specTopics) {
              // Check if the app should be shutdown
              if (isShuttingDown.get()) {
                  return;
              }
  
              if (log.isDebugEnabled()) log.debug("\tProcessing SpecTopic " + specTopic.getId() + (specTopic.getRevision() != null ? (", " +
                      "Revision " + specTopic.getRevision()) : ""));
  
              final BaseTopicWrapper<?> topic = specTopic.getTopic();
              final Document doc = specTopic.getXMLDocument();
  
              assert doc != null;
              assert topic != null;
  
              if (doc != null) {
                  // Set the root element ID
                  DocBookBuildUtilities.processTopicID(buildData, specTopic, doc);
  
                  // Resolve the entities if required
                  if (buildData.getBuildOptions().isResolveEntities()) {
                      try {
                          TranslationUtilities.resolveCustomTopicEntities(entities, doc);
                      } catch (Exception e) {
                          // Do Nothing
                      }
                  }
  
                  // Process the conditional statements
                  processConditions(buildData, specTopic, doc);
  
                  /*
                   * If the topic is a translated topic then check to see if the translated topic hasn't been pushed for
                   * translation, is untranslated, has incomplete translations or contains fuzzy text.
                   */
                  if (topic instanceof TranslatedTopicWrapper) {
                      // Check the topic itself isn't a dummy topic
                      if (EntityUtilities.isDummyTopic(topic) && EntityUtilities.hasBeenPushedForTranslation(
                              (TranslatedTopicWrapper) topic)) {
                          buildData.getErrorDatabase().addWarning(topic, ErrorType.UNTRANSLATED, BuilderConstants.WARNING_UNTRANSLATED_TOPIC);
                      } else if (EntityUtilities.isDummyTopic(topic)) {
                          buildData.getErrorDatabase().addWarning(topic, ErrorType.NOT_PUSHED_FOR_TRANSLATION,
                                  BuilderConstants.WARNING_NONPUSHED_TOPIC);
                      } else {
                          // Check if the topic's content isn't fully translated
                          if (((TranslatedTopicWrapper) topic).getTranslationPercentage() < 100) {
                              buildData.getErrorDatabase().addWarning(topic, ErrorType.INCOMPLETE_TRANSLATION,
                                      BuilderConstants.WARNING_INCOMPLETE_TRANSLATION);
                          }
  
                          if (((TranslatedTopicWrapper) topic).getContainsFuzzyTranslations()) {
                              buildData.getErrorDatabase().addWarning(topic, ErrorType.FUZZY_TRANSLATION,
                                      BuilderConstants.WARNING_FUZZY_TRANSLATION);
                          }
                      }
                  }
  
                  // Check if the app should be shutdown
                  if (isShuttingDown.get()) {
                      return;
                  }
  
                  // Check to see if the translated topic revision is an older topic than the topic revision specified in the map
                  if (topic instanceof TranslatedTopicWrapper) {
                      final TranslatedTopicWrapper pushedTranslatedTopic = EntityUtilities.returnPushedTranslatedTopic(
                              (TranslatedTopicWrapper) topic);
                      if (pushedTranslatedTopic != null && specTopic.getRevision() != null && !pushedTranslatedTopic.getTopicRevision()
                              .equals(specTopic.getRevision())) {
                          if (EntityUtilities.isDummyTopic(topic)) {
                              buildData.getErrorDatabase().addWarning(topic, ErrorType.OLD_UNTRANSLATED,
                                      BuilderConstants.WARNING_OLD_UNTRANSLATED_TOPIC);
                          } else {
                              buildData.getErrorDatabase().addWarning(topic, ErrorType.OLD_TRANSLATION,
                                      BuilderConstants.WARNING_OLD_TRANSLATED_TOPIC);
                          }
                      }
                  }
  
                  /*
                   * Extract the id attributes used in this topic. We'll use this data in the second pass to make sure that
                   * individual topics don't repeat id attributes.
                   */
                  DocBookBuildUtilities.collectIdAttributes(buildData.getDocBookVersion(), specTopic, doc, usedIdAttributes);
              }
          }
      }