@Test(expected = IllegalArgumentException.class) public void testRegisterAvailableLocalesNull() { AbstractI18nCodeList impl = new AbstractI18nCodeList() { @Override protected Set<Locale> registerCodeListLocales() { return null; } @Override protected Map<String, String> obtainMap(Locale locale) { return null; } }; impl.afterPropertiesSet(); }
@Override public void afterPropertiesSet() { codeListLocales = registerCodeListLocales(); Assert.notNull(codeListLocales, "codeListLocales must not null."); if (fallbackTo == null) { Locale defaultLocale = Locale.getDefault(); fallbackTo = resolveLocale(defaultLocale); Assert.notNull(fallbackTo, "No codelist for default locale ('" + defaultLocale + "' and '" + defaultLocale.getLanguage() + "'). Please define codelist for default locale or set locale already defined in codelist to fallbackTo."); } else { Assert.isTrue(codeListLocales.contains(fallbackTo), "No codelist found for fallback locale '" + fallbackTo + "', it must be defined."); } }
AbstractI18nCodeList extends AbstractCodeList implements
                                           I18nCodeList, InitializingBean { @Override public void afterPropertiesSet() { codeListLocales = registerCodeListLocales(); Assert.notNull(codeListLocales, "codeListLocales must not null."); if (fallbackTo == null) { Locale defaultLocale = Locale.getDefault(); fallbackTo = resolveLocale(defaultLocale); Assert.notNull(fallbackTo, "No codelist for default locale ('" + defaultLocale + "' and '" + defaultLocale.getLanguage() + "'). Please define codelist for default locale or set locale already defined in codelist to fallbackTo."); } else { Assert.isTrue(codeListLocales.contains(fallbackTo), "No codelist found for fallback locale '" + fallbackTo + "', it must be defined."); } } }
AbstractI18nCodeList extends AbstractCodeList implements
                                           I18nCodeList, InitializingBean { @Override public void afterPropertiesSet() { codeListLocales = registerCodeListLocales(); Assert.notNull(codeListLocales, "codeListLocales must not null."); if (fallbackTo == null) { Locale defaultLocale = Locale.getDefault(); fallbackTo = resolveLocale(defaultLocale); Assert.notNull(fallbackTo, "No codelist for default locale ('" + defaultLocale + "' and '" + defaultLocale.getLanguage() + "'). Please define codelist for default locale or set locale already defined in codelist to fallbackTo."); } else { Assert.isTrue(codeListLocales.contains(fallbackTo), "No codelist found for fallback locale '" + fallbackTo + "', it must be defined."); } }  }
AbstractI18nCodeList extends AbstractCodeList implements
                                           I18nCodeList, InitializingBean { @Override public void afterPropertiesSet() { codeListLocales = registerCodeListLocales(); Assert.notNull(codeListLocales, "codeListLocales must not null."); if (fallbackTo == null) { Locale defaultLocale = Locale.getDefault(); fallbackTo = resolveLocale(defaultLocale); Assert.notNull(fallbackTo, "No codelist for default locale ('" + defaultLocale + "' and '" + defaultLocale.getLanguage() + "'). Please define codelist for default locale or set locale already defined in codelist to fallbackTo."); } else { Assert.isTrue(codeListLocales.contains(fallbackTo), "No codelist found for fallback locale '" + fallbackTo + "', it must be defined."); } }  void setFallbackTo(Locale fallbackTo); @Override Map<String, String> asMap(); @Override Map<String, String> asMap(Locale locale); @Override void afterPropertiesSet(); }
AbstractI18nCodeList extends AbstractCodeList implements
                                           I18nCodeList, InitializingBean { @Override public void afterPropertiesSet() { codeListLocales = registerCodeListLocales(); Assert.notNull(codeListLocales, "codeListLocales must not null."); if (fallbackTo == null) { Locale defaultLocale = Locale.getDefault(); fallbackTo = resolveLocale(defaultLocale); Assert.notNull(fallbackTo, "No codelist for default locale ('" + defaultLocale + "' and '" + defaultLocale.getLanguage() + "'). Please define codelist for default locale or set locale already defined in codelist to fallbackTo."); } else { Assert.isTrue(codeListLocales.contains(fallbackTo), "No codelist found for fallback locale '" + fallbackTo + "', it must be defined."); } }  void setFallbackTo(Locale fallbackTo); @Override Map<String, String> asMap(); @Override Map<String, String> asMap(Locale locale); @Override void afterPropertiesSet();  }