You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@struts.apache.org by lu...@apache.org on 2017/03/14 18:35:57 UTC

[04/24] struts git commit: Marks static methods as deprecated

Marks static methods as deprecated


Project: http://git-wip-us.apache.org/repos/asf/struts/repo
Commit: http://git-wip-us.apache.org/repos/asf/struts/commit/239327ea
Tree: http://git-wip-us.apache.org/repos/asf/struts/tree/239327ea
Diff: http://git-wip-us.apache.org/repos/asf/struts/diff/239327ea

Branch: refs/heads/master
Commit: 239327ea363e020af0a0de2669bc2e991bfe6bfb
Parents: fa1a5f9
Author: Lukasz Lenart <lu...@apache.org>
Authored: Wed Mar 8 17:42:42 2017 +0100
Committer: Lukasz Lenart <lu...@apache.org>
Committed: Wed Mar 8 17:42:42 2017 +0100

----------------------------------------------------------------------
 .../opensymphony/xwork2/util/LocalizedTextUtil.java  | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/struts/blob/239327ea/core/src/main/java/com/opensymphony/xwork2/util/LocalizedTextUtil.java
----------------------------------------------------------------------
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 d69300f..1334cad 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<String> 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();