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 2015/02/17 07:51:39 UTC

[1/2] struts git commit: WW-4427 - Converters are no longer applied to values coming from the context on error path

Repository: struts
Updated Branches:
  refs/heads/develop c5867e2ea -> 66248a80e


WW-4427 - Converters are no longer applied to values coming from the context on error path


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

Branch: refs/heads/develop
Commit: e0d72397c24542a8b83a371a36590570ccd8fd74
Parents: 76ea79f
Author: Przemek Bruski <pb...@atlassian.com>
Authored: Sun Feb 15 10:40:13 2015 +0100
Committer: Przemek Bruski <pb...@atlassian.com>
Committed: Sun Feb 15 10:40:13 2015 +0100

----------------------------------------------------------------------
 .../com/opensymphony/xwork2/ognl/OgnlValueStack.java  |  6 ++++--
 .../opensymphony/xwork2/ognl/OgnlValueStackTest.java  | 14 ++++++++++----
 2 files changed, 14 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/struts/blob/e0d72397/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 7fa70f7..1b09ef6 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
@@ -312,9 +312,11 @@ public class OgnlValueStack implements Serializable, ValueStack, ClearableValueS
             setupExceptionOnFailure(throwExceptionOnFailure);
             return tryFindValueWhenExpressionIsNotNull(expr, asType);
         } catch (OgnlException e) {
-            return handleOgnlException(expr, throwExceptionOnFailure, e);
+            final Object value = handleOgnlException(expr, throwExceptionOnFailure, e);
+            return converter.convertValue(getContext(), value, asType);
         } catch (Exception e) {
-            return handleOtherException(expr, throwExceptionOnFailure, e);
+            final Object value = handleOtherException(expr, throwExceptionOnFailure, e);
+            return converter.convertValue(getContext(), value, asType);
         } finally {
             ReflectionContextState.clear(context);
         }

http://git-wip-us.apache.org/repos/asf/struts/blob/e0d72397/xwork-core/src/test/java/com/opensymphony/xwork2/ognl/OgnlValueStackTest.java
----------------------------------------------------------------------
diff --git a/xwork-core/src/test/java/com/opensymphony/xwork2/ognl/OgnlValueStackTest.java b/xwork-core/src/test/java/com/opensymphony/xwork2/ognl/OgnlValueStackTest.java
index 8c7c3ae..612435d 100644
--- a/xwork-core/src/test/java/com/opensymphony/xwork2/ognl/OgnlValueStackTest.java
+++ b/xwork-core/src/test/java/com/opensymphony/xwork2/ognl/OgnlValueStackTest.java
@@ -94,9 +94,12 @@ public class OgnlValueStackTest extends XWorkTestCase {
     }
 
     public void testValuesFromContextAreConverted() {
-        final OgnlValueStack vs = createValueStack();
+        testValuesFromContextAreConverted("dogName");
+        testValuesFromContextAreConverted("dog.name");
+    }
 
-        final String propertyName = "dogName";
+    private void testValuesFromContextAreConverted(String propertyName) {
+        final OgnlValueStack vs = createValueStack();
         final String propertyValue = "Rover";
         vs.getContext().put(propertyName, new String[]{propertyValue});
 
@@ -104,9 +107,12 @@ public class OgnlValueStackTest extends XWorkTestCase {
     }
 
     public void testNullValueFromContextGetsConverted() {
-        final OgnlValueStack vs = createValueStack();
+        testNullValueFromContextGetsConverted("dogName");
+        testNullValueFromContextGetsConverted("dog.name");
+    }
 
-        final String propertyName = "dogName";
+    private void testNullValueFromContextGetsConverted(String propertyName) {
+        final OgnlValueStack vs = createValueStack();
         final String propertyValue = null;
         vs.getContext().put(propertyName, propertyValue);
 


[2/2] struts git commit: WW-4427 adds complete fix

Posted by lu...@apache.org.
WW-4427 adds complete fix


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

Branch: refs/heads/develop
Commit: 66248a80e3b238092bf547cc196ad2f7b0225b76
Parents: c5867e2 e0d7239
Author: Lukasz Lenart <lu...@apache.org>
Authored: Tue Feb 17 07:49:15 2015 +0100
Committer: Lukasz Lenart <lu...@apache.org>
Committed: Tue Feb 17 07:49:15 2015 +0100

----------------------------------------------------------------------
 .../com/opensymphony/xwork2/ognl/OgnlValueStack.java  |  6 ++++--
 .../opensymphony/xwork2/ognl/OgnlValueStackTest.java  | 14 ++++++++++----
 2 files changed, 14 insertions(+), 6 deletions(-)
----------------------------------------------------------------------