struts-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lukaszlen...@apache.org
Subject [03/12] struts git commit: Replaces LocaleProvider with LocaleProviderFactory
Date Thu, 16 Mar 2017 10:09:37 GMT
Replaces LocaleProvider with LocaleProviderFactory


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

Branch: refs/heads/master
Commit: 09be1b9b773f164d59114b0a73d3a4fde366b673
Parents: 636821a
Author: Lukasz Lenart <lukaszlenart@apache.org>
Authored: Wed Mar 15 08:50:05 2017 +0100
Committer: Lukasz Lenart <lukaszlenart@apache.org>
Committed: Wed Mar 15 08:50:05 2017 +0100

----------------------------------------------------------------------
 .../com/opensymphony/xwork2/TextProviderFactory.java  | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/struts/blob/09be1b9b/core/src/main/java/com/opensymphony/xwork2/TextProviderFactory.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/com/opensymphony/xwork2/TextProviderFactory.java b/core/src/main/java/com/opensymphony/xwork2/TextProviderFactory.java
index 349d876..4d55d6c 100644
--- a/core/src/main/java/com/opensymphony/xwork2/TextProviderFactory.java
+++ b/core/src/main/java/com/opensymphony/xwork2/TextProviderFactory.java
@@ -28,7 +28,7 @@ import java.util.ResourceBundle;
 public class TextProviderFactory {
 
     private TextProvider textProvider;
-    private LocaleProvider localeProvider;
+    private LocaleProviderFactory localeProviderFactory;
     private LocalizedTextProvider localizedTextProvider;
 
     @Inject
@@ -37,8 +37,8 @@ public class TextProviderFactory {
     }
 
     @Inject
-    public void setLocaleProvider(LocaleProvider localeProvider) {
-        this.localeProvider = localeProvider;
+    public void setLocaleProviderFactory(LocaleProviderFactory localeProviderFactory) {
+        this.localeProviderFactory = localeProviderFactory;
     }
 
     @Inject
@@ -50,7 +50,7 @@ public class TextProviderFactory {
         TextProvider instance = getTextProvider(clazz);
         if (instance instanceof ResourceBundleTextProvider) {
             ((ResourceBundleTextProvider) instance).setClazz(clazz);
-            ((ResourceBundleTextProvider) instance).setLocaleProvider(localeProvider);
+            ((ResourceBundleTextProvider) instance).setLocaleProvider(localeProviderFactory.createLocaleProvider());
         }
         return instance;
     }
@@ -59,14 +59,14 @@ public class TextProviderFactory {
         TextProvider instance = getTextProvider(bundle);
         if (instance instanceof ResourceBundleTextProvider) {
             ((ResourceBundleTextProvider) instance).setBundle(bundle);
-            ((ResourceBundleTextProvider) instance).setLocaleProvider(localeProvider);
+            ((ResourceBundleTextProvider) instance).setLocaleProvider(localeProviderFactory.createLocaleProvider());
         }
         return instance;
     }
 
     protected TextProvider getTextProvider(Class clazz) {
         if (this.textProvider == null) {
-            return new TextProviderSupport(clazz, localeProvider, localizedTextProvider);
+            return new TextProviderSupport(clazz, localeProviderFactory.createLocaleProvider(),
localizedTextProvider);
         } else {
             return textProvider;
         }
@@ -74,7 +74,7 @@ public class TextProviderFactory {
 
     private TextProvider getTextProvider(ResourceBundle bundle) {
         if (this.textProvider == null) {
-            return new TextProviderSupport(bundle, localeProvider, localizedTextProvider);
+            return new TextProviderSupport(bundle, localeProviderFactory.createLocaleProvider(),
localizedTextProvider);
         }
         return textProvider;
     }


Mime
View raw message