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:58 UTC

[05/24] struts git commit: Injects instead of static reference

Injects instead of static reference


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

Branch: refs/heads/master
Commit: 4ef641850539557ffbc9412ff1d6627a8e08fd32
Parents: 239327e
Author: Lukasz Lenart <lu...@apache.org>
Authored: Wed Mar 8 17:43:20 2017 +0100
Committer: Lukasz Lenart <lu...@apache.org>
Committed: Wed Mar 8 17:43:20 2017 +0100

----------------------------------------------------------------------
 .../opensymphony/xwork2/DefaultActionProxy.java | 13 +++++++---
 .../xwork2/DefaultTextProvider.java             | 16 +++++++++---
 .../xwork2/TextProviderSupport.java             | 27 ++++++++++++--------
 .../xwork2/conversion/impl/XWorkConverter.java  |  3 ++-
 .../xwork2/interceptor/AliasInterceptor.java    | 14 +++++++---
 .../interceptor/ParametersInterceptor.java      | 19 +++++++++-----
 .../StaticParametersInterceptor.java            | 11 ++++++--
 .../org/apache/struts2/components/Date.java     | 22 ++++++++--------
 .../org/apache/struts2/components/I18n.java     |  2 +-
 .../apache/struts2/dispatcher/Dispatcher.java   | 10 +-------
 .../multipart/JakartaMultiPartRequest.java      |  6 +----
 .../struts2/factory/StrutsActionProxy.java      |  2 +-
 .../org/apache/struts2/util/TokenHelper.java    |  3 ++-
 .../multipart/PellMultiPartRequest.java         |  6 +----
 14 files changed, 90 insertions(+), 64 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/struts/blob/4ef64185/core/src/main/java/com/opensymphony/xwork2/DefaultActionProxy.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/com/opensymphony/xwork2/DefaultActionProxy.java b/core/src/main/java/com/opensymphony/xwork2/DefaultActionProxy.java
index 2d8bc38..39a484d 100644
--- a/core/src/main/java/com/opensymphony/xwork2/DefaultActionProxy.java
+++ b/core/src/main/java/com/opensymphony/xwork2/DefaultActionProxy.java
@@ -53,6 +53,8 @@ public class DefaultActionProxy implements ActionProxy, Serializable {
     protected ActionConfig config;
     protected ActionInvocation invocation;
     protected UnknownHandlerManager unknownHandlerManager;
+    protected LocalizedTextUtil localizedTextUtil;
+
     protected String actionName;
     protected String namespace;
     protected String method;
@@ -113,6 +115,11 @@ public class DefaultActionProxy implements ActionProxy, Serializable {
         this.actionEventListener = listener;
     }
 
+    @Inject
+    public void setLocalizedTextUtil(LocalizedTextUtil localizedTextUtil) {
+        this.localizedTextUtil = localizedTextUtil;
+    }
+
     public Object getAction() {
         return invocation.getAction();
     }
@@ -205,7 +212,7 @@ public class DefaultActionProxy implements ActionProxy, Serializable {
     }
 
     protected String prepareNotAllowedErrorMessage() {
-        return LocalizedTextUtil.findDefaultText(
+        return localizedTextUtil.findDefaultText(
                 "struts.exception.method-not-allowed",
                 Locale.getDefault(),
                 new String[]{method, actionName}
@@ -214,12 +221,12 @@ public class DefaultActionProxy implements ActionProxy, Serializable {
 
     protected String getErrorMessage() {
         if ((namespace != null) && (namespace.trim().length() > 0)) {
-            return LocalizedTextUtil.findDefaultText(
+            return localizedTextUtil.findDefaultText(
                     "xwork.exception.missing-package-action",
                     Locale.getDefault(),
                     new String[]{namespace, actionName});
         } else {
-            return LocalizedTextUtil.findDefaultText(
+            return localizedTextUtil.findDefaultText(
                     "xwork.exception.missing-action",
                     Locale.getDefault(),
                     new String[]{actionName});

http://git-wip-us.apache.org/repos/asf/struts/blob/4ef64185/core/src/main/java/com/opensymphony/xwork2/DefaultTextProvider.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/com/opensymphony/xwork2/DefaultTextProvider.java b/core/src/main/java/com/opensymphony/xwork2/DefaultTextProvider.java
index 1d72161..0e3f5b1 100644
--- a/core/src/main/java/com/opensymphony/xwork2/DefaultTextProvider.java
+++ b/core/src/main/java/com/opensymphony/xwork2/DefaultTextProvider.java
@@ -15,6 +15,7 @@
  */
 package com.opensymphony.xwork2;
 
+import com.opensymphony.xwork2.inject.Inject;
 import com.opensymphony.xwork2.util.LocalizedTextUtil;
 import com.opensymphony.xwork2.util.ValueStack;
 
@@ -37,15 +38,22 @@ public class DefaultTextProvider implements TextProvider, Serializable, Unchaina
 
     private static final Object[] EMPTY_ARGS = new Object[0];
 
+    protected LocalizedTextUtil localizedTextUtil;
+
     public DefaultTextProvider() {
     }
 
+    @Inject
+    public void setLocalizedTextUtil(LocalizedTextUtil localizedTextUtil) {
+        this.localizedTextUtil = localizedTextUtil;
+    }
+
     public boolean hasKey(String key) {
         return getText(key) != null;
     }
 
     public String getText(String key) {
-        return LocalizedTextUtil.findDefaultText(key, ActionContext.getContext().getLocale());
+        return localizedTextUtil.findDefaultText(key, ActionContext.getContext().getLocale());
     }
 
     public String getText(String key, String defaultValue) {
@@ -64,7 +72,7 @@ public class DefaultTextProvider implements TextProvider, Serializable, Unchaina
             params = EMPTY_ARGS;
         }
 
-        return LocalizedTextUtil.findDefaultText(key, ActionContext.getContext().getLocale(), params);
+        return localizedTextUtil.findDefaultText(key, ActionContext.getContext().getLocale(), params);
     }
 
     public String getText(String key, String[] args) {
@@ -75,7 +83,7 @@ public class DefaultTextProvider implements TextProvider, Serializable, Unchaina
             params = EMPTY_ARGS;
         }
 
-        return LocalizedTextUtil.findDefaultText(key, ActionContext.getContext().getLocale(), params);
+        return localizedTextUtil.findDefaultText(key, ActionContext.getContext().getLocale(), params);
     }
 
     public String getText(String key, String defaultValue, List<?> args) {
@@ -136,7 +144,7 @@ public class DefaultTextProvider implements TextProvider, Serializable, Unchaina
     }
 
     public ResourceBundle getTexts(String bundleName) {
-        return LocalizedTextUtil.findResourceBundle(bundleName, ActionContext.getContext().getLocale());
+        return localizedTextUtil.findResourceBundle(bundleName, ActionContext.getContext().getLocale());
     }
 
     public ResourceBundle getTexts() {

http://git-wip-us.apache.org/repos/asf/struts/blob/4ef64185/core/src/main/java/com/opensymphony/xwork2/TextProviderSupport.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/com/opensymphony/xwork2/TextProviderSupport.java b/core/src/main/java/com/opensymphony/xwork2/TextProviderSupport.java
index 3f20902..ab37e92 100644
--- a/core/src/main/java/com/opensymphony/xwork2/TextProviderSupport.java
+++ b/core/src/main/java/com/opensymphony/xwork2/TextProviderSupport.java
@@ -33,6 +33,7 @@ public class TextProviderSupport implements ResourceBundleTextProvider {
     private Class clazz;
     private LocaleProvider localeProvider;
     private ResourceBundle bundle;
+    private LocalizedTextUtil localizedTextUtil;
 
     /**
      * Default constructor
@@ -85,6 +86,10 @@ public class TextProviderSupport implements ResourceBundleTextProvider {
         this.localeProvider = localeProvider;
     }
 
+    @Inject
+    public void setLocalizedTextUtil(LocalizedTextUtil localizedTextUtil) {
+        this.localizedTextUtil = localizedTextUtil;
+    }
 
     /**
      * Checks if a key is available in the resource bundles associated with this action.
@@ -97,9 +102,9 @@ public class TextProviderSupport implements ResourceBundleTextProvider {
     public boolean hasKey(String key) {
     	String message;
     	if (clazz != null) {
-            message =  LocalizedTextUtil.findText(clazz, key, getLocale(), null, new Object[0] );
+            message = localizedTextUtil.findText(clazz, key, getLocale(), null, new Object[0] );
         } else {
-            message = LocalizedTextUtil.findText(bundle, key, getLocale(), null, new Object[0]);
+            message = localizedTextUtil.findText(bundle, key, getLocale(), null, new Object[0]);
         }
     	return message != null;
     }
@@ -201,9 +206,9 @@ public class TextProviderSupport implements ResourceBundleTextProvider {
     public String getText(String key, String defaultValue, List<?> args) {
         Object[] argsArray = ((args != null && !args.equals(Collections.emptyList())) ? args.toArray() : null);
         if (clazz != null) {
-            return LocalizedTextUtil.findText(clazz, key, getLocale(), defaultValue, argsArray);
+            return localizedTextUtil.findText(clazz, key, getLocale(), defaultValue, argsArray);
         } else {
-            return LocalizedTextUtil.findText(bundle, key, getLocale(), defaultValue, argsArray);
+            return localizedTextUtil.findText(bundle, key, getLocale(), defaultValue, argsArray);
         }
     }
 
@@ -222,9 +227,9 @@ public class TextProviderSupport implements ResourceBundleTextProvider {
      */
     public String getText(String key, String defaultValue, String[] args) {
         if (clazz != null) {
-            return LocalizedTextUtil.findText(clazz, key, getLocale(), defaultValue, args);
+            return localizedTextUtil.findText(clazz, key, getLocale(), defaultValue, args);
         } else {
-            return LocalizedTextUtil.findText(bundle, key, getLocale(), defaultValue, args);
+            return localizedTextUtil.findText(bundle, key, getLocale(), defaultValue, args);
         }
     }
 
@@ -252,9 +257,9 @@ public class TextProviderSupport implements ResourceBundleTextProvider {
             locale = getLocale();
         }
         if (clazz != null) {
-            return LocalizedTextUtil.findText(clazz, key, locale, defaultValue, argsArray, stack);
+            return localizedTextUtil.findText(clazz, key, locale, defaultValue, argsArray, stack);
         } else {
-            return LocalizedTextUtil.findText(bundle, key, locale, defaultValue, argsArray, stack);
+            return localizedTextUtil.findText(bundle, key, locale, defaultValue, argsArray, stack);
         }
     }
 
@@ -282,9 +287,9 @@ public class TextProviderSupport implements ResourceBundleTextProvider {
             locale = getLocale();
         }
         if (clazz != null) {
-            return LocalizedTextUtil.findText(clazz, key, locale, defaultValue, args, stack);
+            return localizedTextUtil.findText(clazz, key, locale, defaultValue, args, stack);
         } else {
-            return LocalizedTextUtil.findText(bundle, key, locale, defaultValue, args, stack);
+            return localizedTextUtil.findText(bundle, key, locale, defaultValue, args, stack);
         }
 
     }
@@ -304,7 +309,7 @@ public class TextProviderSupport implements ResourceBundleTextProvider {
      * @return a resource bundle
      */
     public ResourceBundle getTexts(String aBundleName) {
-        return LocalizedTextUtil.findResourceBundle(aBundleName, getLocale());
+        return localizedTextUtil.findResourceBundle(aBundleName, getLocale());
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/struts/blob/4ef64185/core/src/main/java/com/opensymphony/xwork2/conversion/impl/XWorkConverter.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/com/opensymphony/xwork2/conversion/impl/XWorkConverter.java b/core/src/main/java/com/opensymphony/xwork2/conversion/impl/XWorkConverter.java
index 9dfcd4d..771fc36 100644
--- a/core/src/main/java/com/opensymphony/xwork2/conversion/impl/XWorkConverter.java
+++ b/core/src/main/java/com/opensymphony/xwork2/conversion/impl/XWorkConverter.java
@@ -194,7 +194,8 @@ public class XWorkConverter extends DefaultTypeConverter {
     }
 
     public static String getConversionErrorMessage(String propertyName, ValueStack stack) {
-        String defaultMessage = LocalizedTextUtil.findDefaultText("xwork.default.invalid.fieldvalue",
+        LocalizedTextUtil localizedTextUtil = ActionContext.getContext().getContainer().getInstance(LocalizedTextUtil.class);
+        String defaultMessage = localizedTextUtil.findDefaultText("xwork.default.invalid.fieldvalue",
                 ActionContext.getContext().getLocale(),
                 new Object[]{
                         propertyName

http://git-wip-us.apache.org/repos/asf/struts/blob/4ef64185/core/src/main/java/com/opensymphony/xwork2/interceptor/AliasInterceptor.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/com/opensymphony/xwork2/interceptor/AliasInterceptor.java b/core/src/main/java/com/opensymphony/xwork2/interceptor/AliasInterceptor.java
index a956aea..9d260c1 100644
--- a/core/src/main/java/com/opensymphony/xwork2/interceptor/AliasInterceptor.java
+++ b/core/src/main/java/com/opensymphony/xwork2/interceptor/AliasInterceptor.java
@@ -94,11 +94,12 @@ public class AliasInterceptor extends AbstractInterceptor {
     protected String aliasesKey = DEFAULT_ALIAS_KEY;
 
     protected ValueStackFactory valueStackFactory;
-    static boolean devMode = false;
+    protected LocalizedTextUtil localizedTextUtil;
+    protected boolean devMode = false;
 
     @Inject(XWorkConstants.DEV_MODE)
-    public static void setDevMode(String mode) {
-        devMode = "true".equals(mode);
+    public void setDevMode(String mode) {
+        this.devMode = Boolean.parseBoolean(mode);
     }   
 
     @Inject
@@ -106,6 +107,11 @@ public class AliasInterceptor extends AbstractInterceptor {
         this.valueStackFactory = valueStackFactory;
     }
 
+    @Inject
+    public void setLocalizedTextUtil(LocalizedTextUtil localizedTextUtil) {
+        this.localizedTextUtil = localizedTextUtil;
+    }
+
     /**
      * <p>
      * Sets the name of the action parameter to look for the alias map.
@@ -173,7 +179,7 @@ public class AliasInterceptor extends AbstractInterceptor {
                             newStack.setValue(alias, value.get());
                         } catch (RuntimeException e) {
                             if (devMode) {
-                                String developerNotification = LocalizedTextUtil.findText(ParametersInterceptor.class, "devmode.notification", ActionContext.getContext().getLocale(), "Developer Notification:\n{0}", new Object[]{
+                                String developerNotification = localizedTextUtil.findText(ParametersInterceptor.class, "devmode.notification", ActionContext.getContext().getLocale(), "Developer Notification:\n{0}", new Object[]{
                                         "Unexpected Exception caught setting '" + entry.getKey() + "' on '" + action.getClass() + ": " + e.getMessage()
                                 });
                                 LOG.error(developerNotification);

http://git-wip-us.apache.org/repos/asf/struts/blob/4ef64185/core/src/main/java/com/opensymphony/xwork2/interceptor/ParametersInterceptor.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/com/opensymphony/xwork2/interceptor/ParametersInterceptor.java b/core/src/main/java/com/opensymphony/xwork2/interceptor/ParametersInterceptor.java
index c1c52d9..5eba95d 100644
--- a/core/src/main/java/com/opensymphony/xwork2/interceptor/ParametersInterceptor.java
+++ b/core/src/main/java/com/opensymphony/xwork2/interceptor/ParametersInterceptor.java
@@ -17,6 +17,7 @@ package com.opensymphony.xwork2.interceptor;
 
 import com.opensymphony.xwork2.ActionContext;
 import com.opensymphony.xwork2.ActionInvocation;
+import com.opensymphony.xwork2.TextProvider;
 import com.opensymphony.xwork2.XWorkConstants;
 import com.opensymphony.xwork2.inject.Inject;
 import com.opensymphony.xwork2.security.AcceptedPatternsChecker;
@@ -218,15 +219,19 @@ public class ParametersInterceptor extends MethodFilterInterceptor {
     }
 
     protected void notifyDeveloperParameterException(Object action, String property, String message) {
-        String developerNotification = LocalizedTextUtil.findText(ParametersInterceptor.class, "devmode.notification",
-                ActionContext.getContext().getLocale(), "Developer Notification:\n{0}",
-                new Object[]{
-                        "Unexpected Exception caught setting '" + property + "' on '" + action.getClass() + ": " + message
-                }
-        );
+        String developerNotification = "Unexpected Exception caught setting '" + property + "' on '" + action.getClass() + ": " + message;
+        if (action instanceof TextProvider) {
+            TextProvider tp = (TextProvider) action;
+            developerNotification = tp.getText("devmode.notification",
+                    "Developer Notification:\n{0}",
+                    new String[]{ developerNotification }
+            );
+        }
+
         LOG.error(developerNotification);
-        // see https://issues.apache.org/jira/browse/WW-4066
+
         if (action instanceof ValidationAware) {
+            // see https://issues.apache.org/jira/browse/WW-4066
             Collection<String> messages = ((ValidationAware) action).getActionMessages();
             messages.add(message);
             ((ValidationAware) action).setActionMessages(messages);

http://git-wip-us.apache.org/repos/asf/struts/blob/4ef64185/core/src/main/java/com/opensymphony/xwork2/interceptor/StaticParametersInterceptor.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/com/opensymphony/xwork2/interceptor/StaticParametersInterceptor.java b/core/src/main/java/com/opensymphony/xwork2/interceptor/StaticParametersInterceptor.java
index 8aab382..b697a64 100644
--- a/core/src/main/java/com/opensymphony/xwork2/interceptor/StaticParametersInterceptor.java
+++ b/core/src/main/java/com/opensymphony/xwork2/interceptor/StaticParametersInterceptor.java
@@ -93,6 +93,7 @@ public class StaticParametersInterceptor extends AbstractInterceptor {
     private static final Logger LOG = LogManager.getLogger(StaticParametersInterceptor.class);
 
     private ValueStackFactory valueStackFactory;
+    private LocalizedTextUtil localizedTextUtil;
 
     @Inject
     public void setValueStackFactory(ValueStackFactory valueStackFactory) {
@@ -102,7 +103,12 @@ public class StaticParametersInterceptor extends AbstractInterceptor {
     @Inject(XWorkConstants.DEV_MODE)
     public void setDevMode(String mode) {
         devMode = BooleanUtils.toBoolean(mode);
-    }    
+    }
+
+    @Inject
+    public void setLocalizedTextUtil(LocalizedTextUtil localizedTextUtil) {
+        this.localizedTextUtil = localizedTextUtil;
+    }
 
     public void setParse(String value) {
         this.parse = BooleanUtils.toBoolean(value);
@@ -168,7 +174,8 @@ public class StaticParametersInterceptor extends AbstractInterceptor {
                         newStack.setValue(entry.getKey(), val);
                     } catch (RuntimeException e) {
                         if (devMode) {
-                            String developerNotification = LocalizedTextUtil.findText(ParametersInterceptor.class, "devmode.notification", ActionContext.getContext().getLocale(), "Developer Notification:\n{0}", new Object[]{
+
+                            String developerNotification = localizedTextUtil.findText(ParametersInterceptor.class, "devmode.notification", ActionContext.getContext().getLocale(), "Developer Notification:\n{0}", new Object[]{
                                     "Unexpected Exception caught setting '" + entry.getKey() + "' on '" + action.getClass() + ": " + e.getMessage()
                             });
                             LOG.error(developerNotification);

http://git-wip-us.apache.org/repos/asf/struts/blob/4ef64185/core/src/main/java/org/apache/struts2/components/Date.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/struts2/components/Date.java b/core/src/main/java/org/apache/struts2/components/Date.java
index ac3d68b..46c193d 100644
--- a/core/src/main/java/org/apache/struts2/components/Date.java
+++ b/core/src/main/java/org/apache/struts2/components/Date.java
@@ -294,16 +294,18 @@ public class Date extends ContextBean {
                 date = new java.util.Date((long) dateObject);
             } else {
                 if (devMode) {
-                    String developerNotification = LocalizedTextUtil.findText(
-                            Date.class,
-                            "devmode.notification",
-                            ActionContext.getContext().getLocale(),
-                            "Developer Notification:\n{0}",
-                            new Object[]{
-                                    "Expression [" + name + "] passed to <s:date/> tag which was evaluated to [" + dateObject + "]("
-                                            + (dateObject != null ? dateObject.getClass() : "null") + ") isn't instance of java.util.Date nor java.util.Calendar nor long!"
-                            }
-                    );
+                    TextProvider tp = findProviderInStack();
+                    String developerNotification = "";
+                    if (tp != null) {
+                        developerNotification = findProviderInStack().getText(
+                                "devmode.notification",
+                                "Developer Notification:\n{0}",
+                                new String[]{
+                                        "Expression [" + name + "] passed to <s:date/> tag which was evaluated to [" + dateObject + "]("
+                                                + (dateObject != null ? dateObject.getClass() : "null") + ") isn't instance of java.util.Date nor java.util.Calendar nor long!"
+                                }
+                        );
+                    }
                     LOG.warn(developerNotification);
                 } else {
                     LOG.debug("Expression [{}] passed to <s:date/> tag which was evaluated to [{}]({}) isn't instance of java.util.Date nor java.util.Calendar nor long!",

http://git-wip-us.apache.org/repos/asf/struts/blob/4ef64185/core/src/main/java/org/apache/struts2/components/I18n.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/struts2/components/I18n.java b/core/src/main/java/org/apache/struts2/components/I18n.java
index a04840f..7a538b1 100644
--- a/core/src/main/java/org/apache/struts2/components/I18n.java
+++ b/core/src/main/java/org/apache/struts2/components/I18n.java
@@ -121,7 +121,7 @@ public class I18n extends Component {
             ResourceBundle bundle = defaultTextProvider.getTexts(name);
 
             if (bundle == null) {
-                bundle = LocalizedTextUtil.findResourceBundle(name, localeProvider.getLocale());
+                bundle = container.getInstance(LocalizedTextUtil.class).findResourceBundle(name, localeProvider.getLocale());
             }
 
             if (bundle != null) {

http://git-wip-us.apache.org/repos/asf/struts/blob/4ef64185/core/src/main/java/org/apache/struts2/dispatcher/Dispatcher.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/struts2/dispatcher/Dispatcher.java b/core/src/main/java/org/apache/struts2/dispatcher/Dispatcher.java
index 909e802..226ecfc 100644
--- a/core/src/main/java/org/apache/struts2/dispatcher/Dispatcher.java
+++ b/core/src/main/java/org/apache/struts2/dispatcher/Dispatcher.java
@@ -442,15 +442,7 @@ public class Dispatcher {
     }
 
     private Container init_PreloadConfiguration() {
-        Container container = getContainer();
-
-        boolean reloadi18n = Boolean.valueOf(container.getInstance(String.class, StrutsConstants.STRUTS_I18N_RELOAD));
-        LocalizedTextUtil.setReloadBundles(reloadi18n);
-
-        boolean devMode = Boolean.valueOf(container.getInstance(String.class, StrutsConstants.STRUTS_DEVMODE));
-        LocalizedTextUtil.setDevMode(devMode);
-
-        return container;
+        return getContainer();
     }
 
     private void init_CheckWebLogicWorkaround(Container container) {

http://git-wip-us.apache.org/repos/asf/struts/blob/4ef64185/core/src/main/java/org/apache/struts2/dispatcher/multipart/JakartaMultiPartRequest.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/struts2/dispatcher/multipart/JakartaMultiPartRequest.java b/core/src/main/java/org/apache/struts2/dispatcher/multipart/JakartaMultiPartRequest.java
index 02de7f2..f12f1b5 100644
--- a/core/src/main/java/org/apache/struts2/dispatcher/multipart/JakartaMultiPartRequest.java
+++ b/core/src/main/java/org/apache/struts2/dispatcher/multipart/JakartaMultiPartRequest.java
@@ -337,11 +337,7 @@ public class JakartaMultiPartRequest extends AbstractMultiPartRequest {
         for (String name : names) {
             List<FileItem> items = files.get(name);
             for (FileItem item : items) {
-                if (LOG.isDebugEnabled()) {
-                    String msg = LocalizedTextUtil.findText(this.getClass(), "struts.messages.removing.file",
-                            Locale.ENGLISH, "no.message.found", new Object[]{name, item});
-                    LOG.debug(msg);
-                }
+                LOG.debug("Removing file {} {}", name, item );
                 if (!item.isInMemory()) {
                     item.delete();
                 }

http://git-wip-us.apache.org/repos/asf/struts/blob/4ef64185/core/src/main/java/org/apache/struts2/factory/StrutsActionProxy.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/struts2/factory/StrutsActionProxy.java b/core/src/main/java/org/apache/struts2/factory/StrutsActionProxy.java
index 52f2efb..64323c3 100644
--- a/core/src/main/java/org/apache/struts2/factory/StrutsActionProxy.java
+++ b/core/src/main/java/org/apache/struts2/factory/StrutsActionProxy.java
@@ -67,7 +67,7 @@ public class StrutsActionProxy extends DefaultActionProxy {
     protected String getErrorMessage() {
         if ((namespace != null) && (namespace.trim().length() > 0)) {
             String contextPath = ServletActionContext.getRequest().getContextPath();
-            return LocalizedTextUtil.findDefaultText(
+            return localizedTextUtil.findDefaultText(
                     "struts.exception.missing-package-action.with-context",
                     Locale.getDefault(),
                     new String[]{namespace, actionName, contextPath}

http://git-wip-us.apache.org/repos/asf/struts/blob/4ef64185/core/src/main/java/org/apache/struts2/util/TokenHelper.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/struts2/util/TokenHelper.java b/core/src/main/java/org/apache/struts2/util/TokenHelper.java
index d4ae8aa..c6d0f0f 100644
--- a/core/src/main/java/org/apache/struts2/util/TokenHelper.java
+++ b/core/src/main/java/org/apache/struts2/util/TokenHelper.java
@@ -188,7 +188,8 @@ public class TokenHelper {
 
         if (!token.equals(sessionToken)) {
             if (LOG.isWarnEnabled()) {
-                LOG.warn(LocalizedTextUtil.findText(TokenHelper.class, "struts.internal.invalid.token", ActionContext.getContext().getLocale(), "Form token {0} does not match the session token {1}.", new Object[]{
+                LocalizedTextUtil localizedTextUtil = ActionContext.getContext().getContainer().getInstance(LocalizedTextUtil.class);
+                LOG.warn(localizedTextUtil.findText(TokenHelper.class, "struts.internal.invalid.token", ActionContext.getContext().getLocale(), "Form token {0} does not match the session token {1}.", new Object[]{
                         token, sessionToken
                 }));
             }

http://git-wip-us.apache.org/repos/asf/struts/blob/4ef64185/plugins/pell-multipart/src/main/java/org/apache/struts2/dispatcher/multipart/PellMultiPartRequest.java
----------------------------------------------------------------------
diff --git a/plugins/pell-multipart/src/main/java/org/apache/struts2/dispatcher/multipart/PellMultiPartRequest.java b/plugins/pell-multipart/src/main/java/org/apache/struts2/dispatcher/multipart/PellMultiPartRequest.java
index 3c733c6..c91c52e 100644
--- a/plugins/pell-multipart/src/main/java/org/apache/struts2/dispatcher/multipart/PellMultiPartRequest.java
+++ b/plugins/pell-multipart/src/main/java/org/apache/struts2/dispatcher/multipart/PellMultiPartRequest.java
@@ -154,11 +154,7 @@ public class PellMultiPartRequest extends AbstractMultiPartRequest {
             String inputValue = (String) fileParameterNames.nextElement();
             UploadedFile[] files = getFile(inputValue);
             for (UploadedFile currentFile : files) {
-                if (LOG.isInfoEnabled()) {
-                    String msg = LocalizedTextUtil.findText(this.getClass(), "struts.messages.removing.file", Locale.ENGLISH,
-                            "no.message.found", new Object[]{inputValue, currentFile});
-                    LOG.info(msg);
-                }
+                LOG.debug("Removing file {} {}", inputValue, currentFile);
                 if ((currentFile != null) && currentFile.isFile()) {
                     if (!currentFile.delete()) {
                         LOG.warn("Resource Leaking: Could not remove uploaded file [{}]", currentFile.getAbsolutePath());