From 239327ea363e020af0a0de2669bc2e991bfe6bfb Mon Sep 17 00:00:00 2001 From: Lukasz Lenart Date: Wed, 8 Mar 2017 17:42:42 +0100 Subject: [PATCH] Marks static methods as deprecated --- .../xwork2/util/LocalizedTextUtil.java | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/core/src/main/java/com/opensymphony/xwork2/util/LocalizedTextUtil.java b/core/src/main/java/com/opensymphony/xwork2/util/LocalizedTextUtil.java index d69300f5c..1334cadf9 100644 --- a/core/src/main/java/com/opensymphony/xwork2/util/LocalizedTextUtil.java +++ b/core/src/main/java/com/opensymphony/xwork2/util/LocalizedTextUtil.java @@ -113,7 +113,10 @@ public class LocalizedTextUtil { /** * Clears the internal list of resource bundles. + * + * @deprecated used only in tests */ + @Deprecated public static void clearDefaultResourceBundles() { ClassLoader ccl = getCurrentThreadContextClassLoader(); List bundles = new ArrayList<>(); @@ -121,17 +124,20 @@ public class LocalizedTextUtil { bundles.add(0, XWORK_MESSAGES_BUNDLE); } + public LocalizedTextUtil() { + } + /** * Should resorce bundles be reloaded. * * @param reloadBundles reload bundles? */ - @Inject(StrutsConstants.STRUTS_I18N_RELOAD) + @Inject(value = StrutsConstants.STRUTS_I18N_RELOAD, required = false) public void setReloadBundles(String reloadBundles) { this.reloadBundles = Boolean.parseBoolean(reloadBundles); } - @Inject(StrutsConstants.STRUTS_DEVMODE) + @Inject(value = StrutsConstants.STRUTS_DEVMODE, required = false) public void setDevMode(String devMode) { this.devMode = Boolean.parseBoolean(devMode); } @@ -937,8 +943,11 @@ public class LocalizedTextUtil { /** * Clears all the internal lists. + * + * @deprecated used only in tests */ - public static void reset() { + @Deprecated + public void reset() { clearDefaultResourceBundles(); bundlesMap.clear(); messageFormats.clear();