DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=28209>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=28209

BetwixtTransformer does not marshal Collections properly (java.lang.OutOfMemoryError)

           Summary: BetwixtTransformer does not marshal Collections properly
                    (java.lang.OutOfMemoryError)
           Product: Cocoon 2
           Version: 2.1.4
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: blocks
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


in BetwixtTransformer code (around line 256), some steps have been forgotten
when handling Iterator on Collection objects. This results in a
java.lang.OutOfMemoryError. 

//  fix 
if (bean instanceof Collection) {
  Iterator i = ((Collection) bean).iterator();
  while (i.hasNext()) {
    Object o = i.next(); // the missing part
    if (element == null) {
       beanWriter.write(o); // instead of beanWriter.write(bean)
    } else {
       beanWriter.write(element, o);  // idem
    }
  }
}

Reply via email to