I feel like there is a code smell in this. Can someone help me to refactor/optimize it?
protected TimeZone resolveTimeZone() {
IUserPreferences preferences = userProfileService.getCurrentUserPreferences();
if (preferences != null) {
String timeZone = preferences.getPreferredTimeZone();
if (timeZone != null && !"".equals(timeZone))
return TimeZone.getTimeZone(timeZone);
else return defaultTimeZone();
}
else return defaultTimeZone();
}
public TimeZone defaultTimeZone() {
Locale defaultLocale = new Locale(appConfiguration.getDefaultLocale());
Calendar calendar = Calendar.getInstance(defaultLocale);
return calendar.getTimeZone();
}