docs: private void checkDestinationType(DestinationType expectedDestType,
                                        SIDestinationAddress destAddr,
                                        DestinationHandler destination,
                                        boolean system)
                      throws SINotPossibleInCurrentConfigurationException
      {
          if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
              SibTr.entry(tc, "checkDestinationType",
                          new Object[] { expectedDestType, destAddr, destination, destination.getDestinationType(), system });
  
          boolean correctType = true;
  
          // 178865 Check that the destination type is the expected type
          if (expectedDestType != null)
          {
              correctType = false;
  
              // If the destination is foreign or a foreign bus, then skip the check
              if (destination.isForeign() || destination.isForeignBus() ||
                  (destination.isAlias() && destination.getDestinationType() == DestinationType.UNKNOWN))
              {
                  correctType = true;
                  if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                      SibTr.debug(tc, "Correct Type as destination is Foreign");
              }
              else
              {
                  // For Remote Temporary topicspaces we send to the _PSIMP.TDRECEIVER queue.  This means that
                  // remote topicspaces drop through this code.
                  if (expectedDestType == destination.getDestinationType())
                      correctType = true;
                  // If we're sending to a remote temporary topic space then we
                  // can't rely on the type of the destination (as it's the _PSIMP.TDRECEIVER queue)
                  // so check the prefix on the original name instead
                  else if ((expectedDestType == DestinationType.TOPICSPACE) &&
                           (destAddr.getDestinationName().startsWith(SIMPConstants.TEMPORARY_PUBSUB_DESTINATION_PREFIX)))
                      correctType = true;
              }
          }
  
          // Irrespective of type checking, system queues can only be accessed
          // by system SPI users and vice versa.
          if (system ^ destination.isSystem())
          {
              if (destination.isSystem())
              {
                  // The exception to this rule is when we use the TDRECEIVER queue to
                  // send messages remotely (which is a system queue being used for
                  // normal messages).
                  SIBUuid8 encodedME = SIMPUtils.parseME(destAddr.getDestinationName());
  
                  if ((encodedME != null) && !(encodedME.equals(_messageProcessor.getMessagingEngineUuid())))
                      correctType = true;
              }
          }
  
          if (!correctType)
          {
  
              String type = "SYSTEM";
              if (expectedDestType != null)
              {
                  type = expectedDestType.toString();
              }
  
              if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
                  SibTr.exit(
                             tc,
                             "checkDestinationType",
                             "Destination is of wrong type " + type + ":" + destination.getDestinationType().toString());
              // Get the string for the message inserts
              String msg = locateCorrectMessage(destination.getDestinationType(), expectedDestType);
              SIMPNotPossibleInCurrentConfigurationException e = null;
              if (!msg.equals("DELIVERY_ERROR_SIRC_14"))
              {
                  e = new SIMPNotPossibleInCurrentConfigurationException(
                                  nls_cwsik.getFormattedMessage(
                                                                msg,
                                                                new Object[] { destination.getName(),
                                                                              _messageProcessor.getMessagingEngineName() },
                                                                null));
  
                  e.setExceptionReason(Integer.parseInt(msg.replaceFirst("DELIVERY_ERROR_SIRC_", "")));
                  e.setExceptionInserts(new String[] { destination.getName(),
                                                      _messageProcessor.getMessagingEngineName() });
              }
              else
              {
                  e = new SIMPNotPossibleInCurrentConfigurationException(
                                  nls_cwsik.getFormattedMessage(
                                                                msg,
                                                                new Object[] { destination.getName(),
                                                                              _messageProcessor.getMessagingEngineName(),
                                                                              destination.getDestinationType().toString(),
                                                                              type },
                                                                null));
  
                  e.setExceptionReason(SIRCConstants.SIRC0014_INCORRECT_DESTINATION_USAGE_ERROR);
                  e.setExceptionInserts(new String[] { destination.getName(),
                                                      _messageProcessor.getMessagingEngineName(),
                                                      destination.getDestinationType().toString(),
                                                      type });
              }
  
              throw e;
          }
  
          if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
              SibTr.exit(tc, "checkDestinationType");
      }