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

Modified Files:
        AbstractCollectionNodeList.java 
Log Message:
an exception from the 'convert' method can be very very bad, it can cause 
infinite loops. Therefore, it seems better to catch them 


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


Index: AbstractCollectionNodeList.java
===================================================================
RCS file: /var/cvs/src/org/mmbase/bridge/util/AbstractCollectionNodeList.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- AbstractCollectionNodeList.java     13 Jun 2008 09:22:06 -0000      1.5
+++ AbstractCollectionNodeList.java     1 Aug 2008 13:12:13 -0000       1.6
@@ -14,9 +14,11 @@
 import org.mmbase.bridge.*;
 import org.mmbase.bridge.implementation.AbstractNodeList;
 import org.mmbase.util.Casting;
-
+import org.mmbase.util.logging.Logger;
+import org.mmbase.util.logging.Logging;
 
 public abstract class AbstractCollectionNodeList<E extends Node> extends 
AbstractBridgeList<E> {
+    private static final Logger log = 
Logging.getLoggerInstance(AbstractCollectionNodeList.class);
 
     protected Cloud cloud;
     protected final NodeManager nodeManager;
@@ -83,7 +85,9 @@
             return o;
         }
         Node node = null;
-        if (o instanceof String) { // a string indicates a nodemanager by name
+        try {
+            if (o instanceof String &&
+                ! 
org.mmbase.datatypes.StringDataType.INTEGER_PATTERN.matcher((String) 
o).matches()) { // a string indicates a nodemanager by name
             node = getCloud().getNodeManager((String)o);
         } else if (o instanceof Map) {
             if (nodeManager != null) {
@@ -104,6 +108,10 @@
                 node = getCloud().getNode(Casting.toString(o));
             }
         }
+        } catch (Throwable t) {
+            // letting the exception go, would cause infinite loops here and 
there because 'next' cancels like that.
+            log.error(t.getMessage(), t);
+        }
         wrappedCollection.set(index, node);
         return node;
     }
_______________________________________________
Cvs mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/cvs

Reply via email to