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 2014/10/15 07:58:29 UTC
git commit: WW-4408 Delays call to get instance of LocaleProvider
Repository: struts
Updated Branches:
refs/heads/develop 381e92757 -> cc11cc275
WW-4408 Delays call to get instance of LocaleProvider
Project: http://git-wip-us.apache.org/repos/asf/struts/repo
Commit: http://git-wip-us.apache.org/repos/asf/struts/commit/cc11cc27
Tree: http://git-wip-us.apache.org/repos/asf/struts/tree/cc11cc27
Diff: http://git-wip-us.apache.org/repos/asf/struts/diff/cc11cc27
Branch: refs/heads/develop
Commit: cc11cc275c5a2de612f78255a07535d976323a27
Parents: 381e927
Author: Lukasz Lenart <lu...@apache.org>
Authored: Wed Oct 15 07:57:38 2014 +0200
Committer: Lukasz Lenart <lu...@apache.org>
Committed: Wed Oct 15 07:58:15 2014 +0200
----------------------------------------------------------------------
.../xwork2/config/impl/DefaultConfiguration.java | 1 -
.../xwork2/conversion/impl/DefaultTypeConverter.java | 9 +++++----
2 files changed, 5 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/struts/blob/cc11cc27/xwork-core/src/main/java/com/opensymphony/xwork2/config/impl/DefaultConfiguration.java
----------------------------------------------------------------------
diff --git a/xwork-core/src/main/java/com/opensymphony/xwork2/config/impl/DefaultConfiguration.java b/xwork-core/src/main/java/com/opensymphony/xwork2/config/impl/DefaultConfiguration.java
index 57e7f97..fb92d61 100644
--- a/xwork-core/src/main/java/com/opensymphony/xwork2/config/impl/DefaultConfiguration.java
+++ b/xwork-core/src/main/java/com/opensymphony/xwork2/config/impl/DefaultConfiguration.java
@@ -337,7 +337,6 @@ public class DefaultConfiguration implements Configuration {
builder.factory(TextParser.class, OgnlTextParser.class, Scope.SINGLETON);
builder.factory(TextProvider.class, "system", DefaultTextProvider.class, Scope.SINGLETON);
- builder.factory(LocaleProvider.class, DefaultLocaleProvider.class, Scope.SINGLETON);
builder.factory(ObjectTypeDeterminer.class, DefaultObjectTypeDeterminer.class, Scope.SINGLETON);
builder.factory(PropertyAccessor.class, CompoundRoot.class.getName(), CompoundRootAccessor.class, Scope.SINGLETON);
http://git-wip-us.apache.org/repos/asf/struts/blob/cc11cc27/xwork-core/src/main/java/com/opensymphony/xwork2/conversion/impl/DefaultTypeConverter.java
----------------------------------------------------------------------
diff --git a/xwork-core/src/main/java/com/opensymphony/xwork2/conversion/impl/DefaultTypeConverter.java b/xwork-core/src/main/java/com/opensymphony/xwork2/conversion/impl/DefaultTypeConverter.java
index e3363c2..0394122 100644
--- a/xwork-core/src/main/java/com/opensymphony/xwork2/conversion/impl/DefaultTypeConverter.java
+++ b/xwork-core/src/main/java/com/opensymphony/xwork2/conversion/impl/DefaultTypeConverter.java
@@ -33,6 +33,7 @@ package com.opensymphony.xwork2.conversion.impl;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.LocaleProvider;
import com.opensymphony.xwork2.conversion.TypeConverter;
+import com.opensymphony.xwork2.inject.Container;
import com.opensymphony.xwork2.inject.Inject;
import com.opensymphony.xwork2.ognl.XWorkTypeConverterWrapper;
@@ -60,7 +61,7 @@ public abstract class DefaultTypeConverter implements TypeConverter {
private static final Map<Class, Object> primitiveDefaults;
- private LocaleProvider localeProvider;
+ private Container container;
static {
Map<Class, Object> map = new HashMap<Class, Object>();
@@ -78,8 +79,8 @@ public abstract class DefaultTypeConverter implements TypeConverter {
}
@Inject
- public void setLocaleProvider(LocaleProvider localeProvider) {
- this.localeProvider = localeProvider;
+ public void setContainer(Container container) {
+ this.container = container;
}
public Object convertValue(Map<String, Object> context, Object value, Class toType) {
@@ -346,7 +347,7 @@ public abstract class DefaultTypeConverter implements TypeConverter {
locale = (Locale) context.get(ActionContext.LOCALE);
}
if (locale == null) {
- locale = localeProvider.getLocale();
+ locale = container.getInstance(LocaleProvider.class).getLocale();
}
return locale;
}