code: protected String getMessageInternal(String code, Object[] args, Locale locale) {
          if (code == null) {
              return null;
          }
          if (locale == null) {
              locale = Locale.getDefault();
          }
          if (!isAlwaysUseMessageFormat() && (args == null || args.length == 0)) {
              // Optimized resolution: no arguments to apply,
              // therefore no MessageFormat needs to be involved.
              // Note that the default implementation still uses MessageFormat;
              // this can be overridden in specific subclasses.
              String message = resolveCodeWithoutArguments(code, locale);
              if (message != null) {
                  return message;
              }
          } else {
              if (args == null) {
                  args = new Object[0];
              }
  
              MessageFormat messageFormat = resolveCode(code, locale);
              if (messageFormat != null) {
                  synchronized (messageFormat) {
                      return messageFormat.format(args);
                  }
              }
          }
  
          // Check locale-independent common messages for the given message code.
          Properties commonMessages = getCommonMessages();
          if (commonMessages != null) {
              String commonMessage = commonMessages.getProperty(code);
              if (commonMessage != null) {
                  return formatMessage(commonMessage, args, locale);
              }
          }
  
          // Not found -> check parent, if any.
          return getMessageFromParent(code, args, locale);
      }
docs: Resolve the given code and arguments as message in the given Locale,
  returning {@code null} if not found. Does <i>not</i> fall back to
  the code as default message. Invoked by {@code getMessage} methods.
  
  @param code the code to lookup up, such as 'calculator.noRateSet'
  @param args array of arguments that will be filled in for params within the message
  @param locale the Locale in which to do the lookup
  @return the resolved message, or {@code null} if not found
  @see #getMessage(String, Object[], String, Locale) #getMessage(String, Object[], String, Locale)
  @see #getMessage(String, Object[], Locale) #getMessage(String, Object[], Locale)
  @see #setUseCodeAsDefaultMessage #setUseCodeAsDefaultMessage