Update of /var/cvs/src/org/mmbase/util
In directory james.mmbase.org:/tmp/cvs-serv11041

Modified Files:
        LocalizedEntryListFactory.java 
Log Message:
if you specify a datatype for node-type, and use node-numbers as value 
(possible using mm:datatype), you got an exception here. This avoids it.


See also: http://cvs.mmbase.org/viewcvs/src/org/mmbase/util


Index: LocalizedEntryListFactory.java
===================================================================
RCS file: /var/cvs/src/org/mmbase/util/LocalizedEntryListFactory.java,v
retrieving revision 1.51
retrieving revision 1.52
diff -u -b -r1.51 -r1.52
--- LocalizedEntryListFactory.java      18 Aug 2008 14:13:59 -0000      1.51
+++ LocalizedEntryListFactory.java      19 Aug 2008 11:43:35 -0000      1.52
@@ -38,7 +38,7 @@
  * partially by explicit values, though this is not recommended.
  *
  * @author Michiel Meeuwissen
- * @version $Id: LocalizedEntryListFactory.java,v 1.51 2008/08/18 14:13:59 
michiel Exp $
+ * @version $Id: LocalizedEntryListFactory.java,v 1.52 2008/08/19 11:43:35 
michiel Exp $
  * @since MMBase-1.8
  */
 public class LocalizedEntryListFactory<C> implements Serializable, Cloneable {
@@ -566,6 +566,11 @@
                 String display = entryElement.getAttribute("display");
                 if (display.equals("")) display = value;
                 Object key = wrapperDefault != null ? 
Casting.toType(wrapperDefault, null, value) : value;
+                if (key instanceof org.mmbase.bridge.Node) {
+                    // if you sepcify node-typed enumeration by entry value=, 
then this happens.
+                    // Perhaps this should happen a bit more generically. 
Casting.toSerializable, or so.
+                    key = new Integer(((org.mmbase.bridge.Node) 
key).getNumber());
+                }
                 if (key instanceof Serializable) {
                     if (log.isDebugEnabled()) {
                         log.debug("Added " + key + "/" + display + " for " + 
locale);
_______________________________________________
Cvs mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/cvs

Reply via email to