myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lu4...@apache.org
Subject svn commit: r1178539 - /myfaces/core/trunk/shared/src/main/java/org/apache/myfaces/shared/renderkit/RendererUtils.java
Date Mon, 03 Oct 2011 19:47:45 GMT
Author: lu4242
Date: Mon Oct  3 19:47:45 2011
New Revision: 1178539

URL: http://svn.apache.org/viewvc?rev=1178539&view=rev
Log:
MYFACES-3342 UISelectMany child components could receive non array or collection instances
as selected values

Modified:
    myfaces/core/trunk/shared/src/main/java/org/apache/myfaces/shared/renderkit/RendererUtils.java

Modified: myfaces/core/trunk/shared/src/main/java/org/apache/myfaces/shared/renderkit/RendererUtils.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/shared/src/main/java/org/apache/myfaces/shared/renderkit/RendererUtils.java?rev=1178539&r1=1178538&r2=1178539&view=diff
==============================================================================
--- myfaces/core/trunk/shared/src/main/java/org/apache/myfaces/shared/renderkit/RendererUtils.java
(original)
+++ myfaces/core/trunk/shared/src/main/java/org/apache/myfaces/shared/renderkit/RendererUtils.java
Mon Oct  3 19:47:45 2011
@@ -649,7 +649,7 @@ public final class RendererUtils
             converter = new PassThroughAsStringConverter(converter);
         }
 
-        return internalSubmittedOrSelectedValuesAsSet(context, component, converter, uiSelectMany,
submittedValues);
+        return internalSubmittedOrSelectedValuesAsSet(context, component, converter, uiSelectMany,
submittedValues, false);
     }
 
 
@@ -666,7 +666,7 @@ public final class RendererUtils
     {
         Object selectedValues = uiSelectMany.getValue();
 
-        return internalSubmittedOrSelectedValuesAsSet(context, component, converter, uiSelectMany,
selectedValues);
+        return internalSubmittedOrSelectedValuesAsSet(context, component, converter, uiSelectMany,
selectedValues, true);
     }
 
 
@@ -701,10 +701,9 @@ public final class RendererUtils
         return getConvertedStringValue(context, component, converter, selectItem.getValue());
     }
 
-
     private static Set internalSubmittedOrSelectedValuesAsSet(FacesContext context,
             UIComponent component, Converter converter, UISelectMany uiSelectMany,
-            Object values)
+            Object values, boolean allowNonArrayOrCollectionValue)
     {
         if (values == null || EMPTY_STRING.equals(values))
         {
@@ -752,6 +751,12 @@ public final class RendererUtils
             return set;
 
         }
+        else if (allowNonArrayOrCollectionValue)
+        {
+            HashSet set = new HashSet(HashMapUtils.calcCapacity(1));
+            set.add(values);
+            return set;
+        }
         else
         {
             throw new IllegalArgumentException("Value of UISelectMany component with path
: "



Mime
View raw message