Miscellaneous minor refactoring

This commit is contained in:
ryounes 2011-06-24 19:27:54 +00:00
parent 76fc86abc4
commit 95679dbed7
3 changed files with 13 additions and 8 deletions

View file

@ -60,12 +60,18 @@ public class FreemarkerConfigurationLoader {
} }
protected String getThemeDir(ApplicationBean appBean) { protected String getThemeDir(ApplicationBean appBean) {
String themeDir = null;
if (appBean == null) { if (appBean == null) {
log.error("Cannot get themeDir from null application bean"); log.error("Cannot get themeDir from null application bean");
} else if (appBean.getThemeDir() == null) { return null;
} else {
themeDir = appBean.getThemeDir();
if (themeDir == null) {
log.error("themeDir is null"); log.error("themeDir is null");
return null;
} }
return appBean.getThemeDir().replaceAll("/$", ""); }
return themeDir.replaceAll("/$", "");
} }

View file

@ -119,7 +119,6 @@ public class FreemarkerHttpServlet extends VitroHttpServlet {
* the subclass method. For the same reason, it can't refer to a static or instance field * the subclass method. For the same reason, it can't refer to a static or instance field
* REQUIRED_ACTIONS which is overridden in the subclass. * REQUIRED_ACTIONS which is overridden in the subclass.
*/ */
@SuppressWarnings("unused")
protected Actions requiredActions(VitroRequest vreq) { protected Actions requiredActions(VitroRequest vreq) {
return Actions.AUTHORIZED; return Actions.AUTHORIZED;
} }

View file

@ -34,7 +34,7 @@ public class ThemeUtils {
} }
// File.list() does not guarantee a specific order, so sort alphabetically // File.list() does not guarantee a specific order, so sort alphabetically
if (doSort == true) { if (doSort) {
Collections.sort(themeNames); Collections.sort(themeNames);
} }