You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by an...@apache.org on 2004/07/11 21:51:23 UTC
cvs commit: cocoon-2.1/src/blocks/scratchpad/java/org/apache/cocoon/transformation BetwixtTransformer.java
antonio 2004/07/11 12:51:23
Modified: . status.xml
src/blocks/scratchpad/java/org/apache/cocoon/transformation
BetwixtTransformer.java
Log:
Fixing bug #28209: BetwixtTransformer does not marshal Collections properly (java.lang.OutOfMemoryError)
Revision Changes Path
1.394 +4 -1 cocoon-2.1/status.xml
Index: status.xml
===================================================================
RCS file: /home/cvs/cocoon-2.1/status.xml,v
retrieving revision 1.393
retrieving revision 1.394
diff -u -r1.393 -r1.394
--- status.xml 11 Jul 2004 17:43:57 -0000 1.393
+++ status.xml 11 Jul 2004 19:51:23 -0000 1.394
@@ -204,6 +204,9 @@
<changes>
<release version="@version@" date="@date@">
+ <action dev="AG" type="fix" fixes-bug="28209" due-to="Enrico Maccias" due-to-email="enrico.maccias@free.fr">
+ Fixing BetwixtTransformer does not marshal Collections properly (java.lang.OutOfMemoryError).
+ </action>
<action dev="AG" type="fix" fixes-bug="30038" due-to="Jorg Heymans" due-to-email="jh@domek.be">
Fixing lucene-block samples dependencies.
</action>
1.5 +7 -8 cocoon-2.1/src/blocks/scratchpad/java/org/apache/cocoon/transformation/BetwixtTransformer.java
Index: BetwixtTransformer.java
===================================================================
RCS file: /home/cvs/cocoon-2.1/src/blocks/scratchpad/java/org/apache/cocoon/transformation/BetwixtTransformer.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- BetwixtTransformer.java 5 Mar 2004 10:07:26 -0000 1.4
+++ BetwixtTransformer.java 11 Jul 2004 19:51:23 -0000 1.5
@@ -216,15 +216,14 @@
beanWriter.getBindingConfiguration().setMapIDs(this.refIds);
}
-
if (bean instanceof Collection) {
- Iterator i = ((Collection) bean).iterator();
- while (i.hasNext()) {
- if (element == null) {
- beanWriter.write(bean);
- } else {
- beanWriter.write(element, bean);
- }
+ for (Iterator i = ((Collection) bean).iterator(); i.hasNext();) {
+ Object o = i.next();
+ if (element == null) {
+ beanWriter.write(o);
+ } else {
+ beanWriter.write(element, o);
+ }
}
} else {
if (element == null) {