From: Jeremias Maerki Date: Thu, 10 Feb 2005 14:18:39 +0000 (+0000) Subject: Some LMs don't need the childLM List. So create only when necessary. X-Git-Tag: Root_Temp_KnuthStylePageBreaking~94 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=855e36d206fe861aa07209f32792bc04c81b3b9a;p=xmlgraphics-fop.git Some LMs don't need the childLM List. So create only when necessary. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@198413 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/java/org/apache/fop/layoutmgr/AbstractLayoutManager.java b/src/java/org/apache/fop/layoutmgr/AbstractLayoutManager.java index 45ef5e6e3..4edd78c3e 100644 --- a/src/java/org/apache/fop/layoutmgr/AbstractLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/AbstractLayoutManager.java @@ -41,7 +41,7 @@ import java.util.Map; */ public abstract class AbstractLayoutManager implements LayoutManager, Constants { protected LayoutManager parentLM = null; - protected List childLMs = new ArrayList(10); + protected List childLMs = null; protected ListIterator fobjIter = null; protected Map markers = null; @@ -453,6 +453,9 @@ public abstract class AbstractLayoutManager implements LayoutManager, Constants * @see org.apache.fop.layoutmgr.LayoutManager#getChildLMs */ public List getChildLMs() { + if (childLMs == null) { + childLMs = new java.util.ArrayList(10); + } return childLMs; } @@ -465,6 +468,9 @@ public abstract class AbstractLayoutManager implements LayoutManager, Constants } lm.setParent(this); lm.initialize(); + if (childLMs == null) { + childLMs = new java.util.ArrayList(10); + } childLMs.add(lm); log.trace(this.getClass().getName() + ": Adding child LM " + lm.getClass().getName());