From 855e36d206fe861aa07209f32792bc04c81b3b9a Mon Sep 17 00:00:00 2001 From: Jeremias Maerki Date: Thu, 10 Feb 2005 14:18:39 +0000 Subject: [PATCH] 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 --- .../org/apache/fop/layoutmgr/AbstractLayoutManager.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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()); -- 2.39.5