struts-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lukaszlen...@apache.org
Subject [2/2] struts git commit: Converts value of single parameter
Date Sun, 31 Jul 2016 11:39:50 GMT
Converts value of single parameter


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

Branch: refs/heads/master
Commit: 8b559afc7604a2b80ed222987e87ef46264f3c5f
Parents: 0b24437
Author: Lukasz Lenart <lukaszlenart@apache.org>
Authored: Sun Jul 31 13:39:37 2016 +0200
Committer: Lukasz Lenart <lukaszlenart@apache.org>
Committed: Sun Jul 31 13:39:37 2016 +0200

----------------------------------------------------------------------
 .../xwork2/conversion/impl/CollectionConverter.java           | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/struts/blob/8b559afc/core/src/main/java/com/opensymphony/xwork2/conversion/impl/CollectionConverter.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/com/opensymphony/xwork2/conversion/impl/CollectionConverter.java
b/core/src/main/java/com/opensymphony/xwork2/conversion/impl/CollectionConverter.java
index dfe4030..df7cf8c 100644
--- a/core/src/main/java/com/opensymphony/xwork2/conversion/impl/CollectionConverter.java
+++ b/core/src/main/java/com/opensymphony/xwork2/conversion/impl/CollectionConverter.java
@@ -61,11 +61,14 @@ public class CollectionConverter extends DefaultTypeConverter {
             }
         } else {
             result = createCollection(toType, memberType, -1);
-            result.add(value);
+            TypeConverter converter = getTypeConverter(context);
+            Object convertedValue = converter.convertValue(context, target, member, propertyName,
value, memberType);
+            if (!TypeConverter.NO_CONVERSION_POSSIBLE.equals(convertedValue)) {
+                result.add(convertedValue);
+            }
         }
 
         return result;
-
     }
 
     private Collection createCollection(Class toType, Class memberType, int size) {


Mime
View raw message