Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
Refactor LocaleServiceImpl.getByLocaleId(String) for brevity.
Browse files Browse the repository at this point in the history
  • Loading branch information
davidmason committed Jun 4, 2015
1 parent 0a4e2c5 commit f643587
Showing 1 changed file with 1 addition and 3 deletions.
Expand Up @@ -266,14 +266,12 @@ public HLocale getByLocaleId(@Nonnull LocaleId locale) {
@Override
@Nullable
public HLocale getByLocaleId(@Nonnull String localeId) {
final LocaleId locale;
try {
locale = new LocaleId(localeId);
return this.getByLocaleId(new LocaleId(localeId));
} catch (IllegalArgumentException e) {
log.warn("Tried to look up a locale with a malformed id", e);
return null;
}
return this.getByLocaleId(locale);
}

@Override
Expand Down

0 comments on commit f643587

Please sign in to comment.