docs: static Throwable newThrowable(Class throwableClass
                                    , String messageKey
                                    , Object[] messageInserts
                                    , Throwable caughtThrowable
                                    , String probeId
                                    , Object caller
                                    , TraceComponent traceComponent
                      ) {
          if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
              SibTr.entry(tc, "newThrowable",
                          new Object[] { throwableClass
                                        , messageKey
                                        , caughtThrowable
                                        , probeId
                                        , caller, });
          Throwable t = null;
  
          try {
  
              // If test environment is enabled then take this opportunity to check
              // the the message exists in the file. Note that this is not called in
              // the mainline product codepath.
              if (UTEHelperFactory.jmsTestEnvironmentEnabled) {
                  String defaultIfMissing = "XXX_MISSING_XXX";
                  String msg = nls.getFormattedMessage(messageKey, messageInserts, defaultIfMissing);
  
                  if (defaultIfMissing.equals(msg)) {
                      // NB. NLS translation is not required since this only occurs in the test environment.
                      throw new IllegalArgumentException("The message key " + messageKey + " does not exist.");
                  }
  
                  // Now check that the correct number of inserts have been provided.
                  // This call gets the number of inserts in the message.
                  int numInserts = getNumberOfInserts(messageKey);
                  int gotInserts = 0;
                  if (messageInserts != null) {
                      gotInserts = messageInserts.length;
                  }
                  if (numInserts != gotInserts) {
                      //NB. NLS translation is not required since this only occurs in the test environment.
                      throw new IllegalArgumentException("Expected " + numInserts + " for " + messageKey + " but got " + gotInserts);
                  }
              }
  
              // If an invalid throwable class was supplied throw a runtime exception.
              if (!Throwable.class.isAssignableFrom(throwableClass)) {
                  RuntimeException re = new RuntimeException("JmsErrorUtils.newThrowable#1");
                  FFDCFilter.processException(re, "JmsErrorUtils.newThrowable", "JmsErrorUtils.newThrowable#1");
                  if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                      SibTr.debug(tc, "exception : ", re);
                  throw re;
              }
  
              // First note if the throwable to be constructed is a JMSException
              // or subclass of JMSException.
              boolean wantJMSExceptionOrSubclass = JMSException.class.isAssignableFrom(throwableClass);
  
              // If a JMSException constructor is required, get the two String arg
              // constructor, else get a one String arg constructor.
              Constructor throwableConstructor = null;
              try {
                  if (wantJMSExceptionOrSubclass) {
                      throwableConstructor = throwableClass.getConstructor(new Class[] { String.class, String.class });
                  }
                  else {
                      throwableConstructor = throwableClass.getConstructor(new Class[] { String.class });
                  }
              } catch (Exception e) {
                  // No FFDC code needed
                  RuntimeException re = new RuntimeException("JmsErrorUtils.newThrowable#2");
                  re.initCause(e);
                  FFDCFilter.processException(re, "JmsErrorUtils.newThrowable", "JmsErrorUtils.newThrowable#2");
                  if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                      SibTr.debug(tc, "exception : ", re);
                  throw re;
              }
  
              // Get the nls text for the message. 'messageInserts' may be null.
              String reason = nls.getFormattedMessage(messageKey, messageInserts, null);
  
              // Get the error code for the throwable, 'messageKey' is assumed to have
              // the form "...CWSIAxxxx".
              String errorCode = null;
              if (messageKey.length() >= 9) {
                  errorCode = messageKey.substring(messageKey.length() - 9);
              }
  
              // Construct the throwable.
              try {
                  if (wantJMSExceptionOrSubclass) {
                      t = (Throwable) throwableConstructor.newInstance(new Object[] { reason, errorCode });
                  }
                  else {
                      t = (Throwable) throwableConstructor.newInstance(new Object[] { reason });
                  }
              } catch (Exception e) {
                  // No FFDC code needed
                  RuntimeException re = new RuntimeException("JmsErrorUtils.newThrowable#3");
                  re.initCause(e);
                  FFDCFilter.processException(re, "JmsErrorUtils.newThrowable", "JmsErrorUtils.newThrowable#3");
                  if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                      SibTr.debug(tc, "exception : ", re);
                  throw re;
              }
  
              // If 'caughtThrowable' refers to an exception, and if a JMSException is
              // being constructed, set the linked exception in the new JMSException to
              // refer to the previously caught exception.
              if ((caughtThrowable instanceof Exception) && wantJMSExceptionOrSubclass) {
                  Exception caughtException = (Exception) caughtThrowable;
                  ((JMSException) t).setLinkedException(caughtException);
              }
  
              // If 'caughtThrowable' is non-null, set the cause in the Throwable
              // being constructed.
              if (caughtThrowable != null) {
                  t.initCause(caughtThrowable);
              }
  
              // This method removes all trace of the newThrowable method and
              // associated reflection calls.
              if (filterStack) {
                  filterThrowable(t);
              }
  
              // If a trace component was supplied and is debug enabled, trace
              // the newly constructed throwable.
              if ((traceComponent != null) && TraceComponent.isAnyTracingEnabled() && (traceComponent.isDebugEnabled())) {
                  SibTr.debug(traceComponent, "throwable : ", t);
              }
  
              // If probeId is non-null, generate an FFDC
              if (probeId != null) {
                  // 'probeId' is assumed to
                  // have the form "className.methodName#...", usually with a number after
                  // the '#'. If the invoking method is static, 'caller' will be null.
                  // d238447 FFDC review. A null probeId is used to indicate that FFDC is not required.
                  String sourceId = "";
  
                  int index = probeId.indexOf('#');
                  if (index == -1) {
                      // no seperator, so we can't make any assumptions about the format
                      sourceId = probeId;
                  }
                  else {
                      sourceId = probeId.substring(0, index);
                  }
  
                  // If caughtThrowable is non-null we FFDC that. Otherwise we FFDC the newly generated exception.
                  Throwable foo;
                  if (caughtThrowable != null) {
                      foo = caughtThrowable;
                  }
                  else {
                      foo = t;
                  }
  
                  if (caller != null) {
                      FFDCFilter.processException(foo, sourceId, probeId, caller);
                  }
                  else {
                      FFDCFilter.processException(foo, sourceId, probeId);
                  }
              }
  
              // Return the newly created exception.
  
          } catch (RuntimeException re) {
              // No FFDC code needed
              // d238447 FFDC review. This is an internal error, we should FFDC the RE.
              if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                  SibTr.debug(tc, "caught : ", re);
              FFDCFilter.processException(re, "JmsErrorUtils.newThrowable", "newThrowable#4");
              throw re;
          }
  
          if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
              SibTr.exit(tc, "newThrowable", t);
          return t;
      }