code: private static String format(final Locale aLocale, final String aBundleName, final String aMessageKey,
              final Object... aVarargs) {
          Objects.requireNonNull(aBundleName, LOGGER.getI18n(MessageCodes.UTIL_016));
          Objects.requireNonNull(aMessageKey, LOGGER.getI18n(MessageCodes.UTIL_018));
          LOGGER.debug(MessageCodes.UTIL_017, aBundleName);
  
          final XMLResourceBundle bundle;
  
          if (aLocale != null) {
              LOGGER.debug(MessageCodes.UTIL_019, aLocale.toString());
              bundle = (XMLResourceBundle) ResourceBundle.getBundle(aBundleName, aLocale, new XMLBundleControl());
          } else {
              bundle = (XMLResourceBundle) ResourceBundle.getBundle(aBundleName, new XMLBundleControl());
          }
  
          if (aVarargs != null && aVarargs.length > 0) {
              LOGGER.debug(MessageCodes.UTIL_020, aMessageKey, aVarargs, aVarargs.getClass().getSimpleName());
  
              if (bundle.containsKey(aMessageKey)) {
                  return bundle.get(aMessageKey, aVarargs);
              } else {
                  return StringUtils.format(aMessageKey, aVarargs);
              }
          } else {
              if (bundle.containsKey(aMessageKey)) {
                  LOGGER.debug(MessageCodes.UTIL_021, aMessageKey);
                  return bundle.get(aMessageKey);
              } else {
                  return aMessageKey;
              }
          }
      }
docs: Constructs our I18n exception message using the supplied {@link Locale} and bundle name.
  
  @param aLocale A locale that should be used for the lookup of the message key.
  @param aBundleName A name of a bundle in which to look up the supplied key.
  @param aMessageKey A key value to look up in the <code>ResourceBundle</code>.
  @param aVarargs Additional details to use in formatting the message.
  @return A formatted exception message