Author: michiel
Date: 2009-05-12 21:33:52 +0200 (Tue, 12 May 2009)
New Revision: 35116

Modified:
   mmbase/trunk/src/org/mmbase/util/Casting.java
Log:
if wrapping a list, make sure also properties are copied

Modified: mmbase/trunk/src/org/mmbase/util/Casting.java
===================================================================
--- mmbase/trunk/src/org/mmbase/util/Casting.java       2009-05-12 19:31:32 UTC 
(rev 35115)
+++ mmbase/trunk/src/org/mmbase/util/Casting.java       2009-05-12 19:33:52 UTC 
(rev 35116)
@@ -1196,13 +1196,18 @@
     /**
      * @since MMBase-1.9
      */
-    public static class NodeListWrapper extends 
org.mmbase.bridge.util.CollectionNodeList {
+    public static class NodeListWrapper extends 
org.mmbase.bridge.util.CollectionNodeList implements Unwrappable {
         private final CharTransformer escaper;
         NodeListWrapper(org.mmbase.bridge.NodeList list, CharTransformer e) {
             super(list);
+            for (Map.Entry<Object, Object> entry : 
list.getProperties().entrySet()) {
+                setProperty(entry.getKey(), entry.getValue());
+            }
             escaper = e;
         }
-        public Node get(int index) { return (Node) 
Casting.wrap(super.get(index), escaper); }
+        public Node get(int index) {
+            return (Node) Casting.wrap(super.get(index), escaper);
+        }
         public String toString() {
             StringBuilder buf = new StringBuilder();
             Iterator<Node> i = iterator();
@@ -1258,7 +1263,7 @@
     }
 
     /**
-     * Clases implementint this will not be wrapped by {...@link #wrap}, even 
if the e.g. are CharSequence.
+     * Clases implementing this will not be wrapped by {...@link #wrap}, even 
if the e.g. are CharSequence.
      * @since MMBase-1.9
      */
     public static interface Unwrappable {

_______________________________________________
Cvs mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/cvs

Reply via email to