@Test void testResolveCodeWithoutArgumentsMessageNotFound() { assertNull(messageSource.resolveCodeWithoutArguments("MISSING", new Locale("en"))); }
@Override protected String resolveCodeWithoutArguments(String code, @Nullable @CheckForNull Locale locale) { Stream<Locale> candidates = Stream.of(locale, tryGetFallbackLocale(), DEFAULT_LOCALE); return candidates .filter(Objects::nonNull) .map(candidate -> messageRepository.resolveCodeWithoutArguments(code, candidate)) .filter(Objects::nonNull) .findFirst() .orElse(null); }
LocalizationMessageSource extends AbstractMessageSource { @Override protected String resolveCodeWithoutArguments(String code, @Nullable @CheckForNull Locale locale) { Stream<Locale> candidates = Stream.of(locale, tryGetFallbackLocale(), DEFAULT_LOCALE); return candidates .filter(Objects::nonNull) .map(candidate -> messageRepository.resolveCodeWithoutArguments(code, candidate)) .filter(Objects::nonNull) .findFirst() .orElse(null); } }
LocalizationMessageSource extends AbstractMessageSource { @Override protected String resolveCodeWithoutArguments(String code, @Nullable @CheckForNull Locale locale) { Stream<Locale> candidates = Stream.of(locale, tryGetFallbackLocale(), DEFAULT_LOCALE); return candidates .filter(Objects::nonNull) .map(candidate -> messageRepository.resolveCodeWithoutArguments(code, candidate)) .filter(Objects::nonNull) .findFirst() .orElse(null); } LocalizationMessageSource(
      MessageFormatFactory messageFormatFactory,
      MessageResolution messageRepository,
      Supplier<Locale> fallbackLocaleSupplier); }
LocalizationMessageSource extends AbstractMessageSource { @Override protected String resolveCodeWithoutArguments(String code, @Nullable @CheckForNull Locale locale) { Stream<Locale> candidates = Stream.of(locale, tryGetFallbackLocale(), DEFAULT_LOCALE); return candidates .filter(Objects::nonNull) .map(candidate -> messageRepository.resolveCodeWithoutArguments(code, candidate)) .filter(Objects::nonNull) .findFirst() .orElse(null); } LocalizationMessageSource(
      MessageFormatFactory messageFormatFactory,
      MessageResolution messageRepository,
      Supplier<Locale> fallbackLocaleSupplier); @Override String getDefaultMessage(String code); @Override MessageFormat resolveCode(String code, Locale locale); }
LocalizationMessageSource extends AbstractMessageSource { @Override protected String resolveCodeWithoutArguments(String code, @Nullable @CheckForNull Locale locale) { Stream<Locale> candidates = Stream.of(locale, tryGetFallbackLocale(), DEFAULT_LOCALE); return candidates .filter(Objects::nonNull) .map(candidate -> messageRepository.resolveCodeWithoutArguments(code, candidate)) .filter(Objects::nonNull) .findFirst() .orElse(null); } LocalizationMessageSource(
      MessageFormatFactory messageFormatFactory,
      MessageResolution messageRepository,
      Supplier<Locale> fallbackLocaleSupplier); @Override String getDefaultMessage(String code); @Override MessageFormat resolveCode(String code, Locale locale);  }