cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 28209] New: - BetwixtTransformer does not marshal Collections properly (java.lang.OutOfMemoryError)
Date Mon, 05 Apr 2004 14:55:59 GMT
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: dev@cocoon.apache.org
        ReportedBy: enrico.maccias@free.fr


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
    }
  }
}

Mime
View raw message