struts-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lukaszlen...@apache.org
Subject [11/12] struts git commit: Decouples LocaleProvider instance from long living interceptor state
Date Thu, 16 Mar 2017 10:09:45 GMT
Decouples LocaleProvider instance from long living interceptor state


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

Branch: refs/heads/master
Commit: 4eb22020a474ffaa69484c8e3dd0711dc517d6e8
Parents: 8298371
Author: Lukasz Lenart <lukaszlenart@apache.org>
Authored: Thu Mar 16 08:15:04 2017 +0100
Committer: Lukasz Lenart <lukaszlenart@apache.org>
Committed: Thu Mar 16 08:15:04 2017 +0100

----------------------------------------------------------------------
 .../java/org/apache/struts2/interceptor/I18nInterceptor.java   | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/struts/blob/4eb22020/core/src/main/java/org/apache/struts2/interceptor/I18nInterceptor.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/struts2/interceptor/I18nInterceptor.java b/core/src/main/java/org/apache/struts2/interceptor/I18nInterceptor.java
index f97176f..722beb0 100644
--- a/core/src/main/java/org/apache/struts2/interceptor/I18nInterceptor.java
+++ b/core/src/main/java/org/apache/struts2/interceptor/I18nInterceptor.java
@@ -59,7 +59,7 @@ public class I18nInterceptor extends AbstractInterceptor {
     protected String requestCookieParameterName = DEFAULT_COOKIE_PARAMETER;
     protected Storage storage = Storage.SESSION;
 
-    protected LocaleProvider localeProvider;
+    protected LocaleProviderFactory localeProviderFactory;
 
     // Request-Only = None
     protected enum Storage { COOKIE, SESSION, NONE }
@@ -95,7 +95,7 @@ public class I18nInterceptor extends AbstractInterceptor {
 
     @Inject
     public void setLocaleProviderFactory(LocaleProviderFactory localeProviderFactory) {
-        this.localeProvider = localeProviderFactory.createLocaleProvider();
+        this.localeProviderFactory = localeProviderFactory;
     }
 
     @Override
@@ -157,6 +157,8 @@ public class I18nInterceptor extends AbstractInterceptor {
      * @return the Locale
      */
     protected Locale getLocaleFromParam(Object requestedLocale) {
+        LocaleProvider localeProvider = localeProviderFactory.createLocaleProvider();
+
         Locale locale = null;
         if (requestedLocale != null) {
             if (requestedLocale instanceof Locale) {


Mime
View raw message