struts-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lukaszlen...@apache.org
Subject [05/50] [abbrv] struts git commit: WW-4427 - inject the converter instead of getting it directly
Date Wed, 31 Dec 2014 17:17:27 GMT
WW-4427 - inject the converter instead of getting it directly


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

Branch: refs/heads/master
Commit: 6a58778399dcdacbe061c55b37a581646871d4ce
Parents: 6834b78
Author: Przemek Bruski <pbruski@atlassian.com>
Authored: Tue Dec 16 16:58:38 2014 +0100
Committer: Przemek Bruski <pbruski@atlassian.com>
Committed: Tue Dec 16 16:58:38 2014 +0100

----------------------------------------------------------------------
 .../java/com/opensymphony/xwork2/ognl/OgnlValueStack.java    | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/struts/blob/6a587783/xwork-core/src/main/java/com/opensymphony/xwork2/ognl/OgnlValueStack.java
----------------------------------------------------------------------
diff --git a/xwork-core/src/main/java/com/opensymphony/xwork2/ognl/OgnlValueStack.java b/xwork-core/src/main/java/com/opensymphony/xwork2/ognl/OgnlValueStack.java
index ce273b1..48e5241 100644
--- a/xwork-core/src/main/java/com/opensymphony/xwork2/ognl/OgnlValueStack.java
+++ b/xwork-core/src/main/java/com/opensymphony/xwork2/ognl/OgnlValueStack.java
@@ -63,6 +63,7 @@ public class OgnlValueStack implements Serializable, ValueStack, ClearableValueS
     Map<Object, Object> overrides;
     transient OgnlUtil ognlUtil;
     transient SecurityMemberAccess securityMemberAccess;
+    private transient XWorkConverter converter;
 
     private boolean devMode;
     private boolean logMissingProperties;
@@ -351,8 +352,7 @@ public class OgnlValueStack implements Serializable, ValueStack, ClearableValueS
             value = getValue(expr, asType);
             if (value == null) {
                 value = findInContext(expr);
-                final XWorkConverter conv = ((Container)getContext().get(ActionContext.CONTAINER)).getInstance(XWorkConverter.class);
-                return conv.convertValue(getContext(), value, asType);
+                return converter.convertValue(getContext(), value, asType);
             }
         } finally {
             context.remove(THROW_EXCEPTION_ON_FAILURE);
@@ -475,4 +475,8 @@ public class OgnlValueStack implements Serializable, ValueStack, ClearableValueS
         securityMemberAccess.setExcludeProperties(excludeProperties);
     }
 
+    @Inject
+    public void setXWorkConverter(final XWorkConverter converter) {
+        this.converter = converter;
+    }
 }


Mime
View raw message