[seam-commits] Seam SVN: r10847 - branches/community/Seam_2_1/ui/src/main/java/org/jboss/seam/ui/converter.

seam-commits at lists.jboss.org seam-commits at lists.jboss.org
Mon May 11 15:20:01 EDT 2009


Author: norman.richards at jboss.com
Date: 2009-05-11 15:20:00 -0400 (Mon, 11 May 2009)
New Revision: 10847

Modified:
   branches/community/Seam_2_1/ui/src/main/java/org/jboss/seam/ui/converter/EnumConverter.java
Log:
JBSEAM-4169

Modified: branches/community/Seam_2_1/ui/src/main/java/org/jboss/seam/ui/converter/EnumConverter.java
===================================================================
--- branches/community/Seam_2_1/ui/src/main/java/org/jboss/seam/ui/converter/EnumConverter.java	2009-05-11 00:47:38 UTC (rev 10846)
+++ branches/community/Seam_2_1/ui/src/main/java/org/jboss/seam/ui/converter/EnumConverter.java	2009-05-11 19:20:00 UTC (rev 10847)
@@ -40,8 +40,14 @@
                }
                else if (val instanceof Collection)
                {
-                  t = ((Collection) val).iterator().next().getClass();
-                  return Enum.valueOf(t, value);
+                  Object firstItem = ((Collection) val).iterator().next();
+                  if (firstItem instanceof Enum) {
+                     t = ((Enum) firstItem).getDeclaringClass();
+                  } else {
+                     t = firstItem.getClass();
+                  }
+                  
+                  return Enum.valueOf(t, value);                  
                }
             }
          }




More information about the seam-commits mailing list