Bug 14013 - [PATCH] Performance tuning
Summary: [PATCH] Performance tuning
Status: CLOSED FIXED
Alias: None
Product: Fop - Now in Jira
Classification: Unclassified
Component: general (show other bugs)
Version: 0.20.4
Hardware: PC All
: P3 enhancement
Target Milestone: ---
Assignee: fop-dev
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-10-28 12:09 UTC by Henrik Olsson
Modified: 2012-04-01 07:02 UTC (History)
0 users



Attachments
Performans tuning fop-0.20.4 (26.39 KB, application/octet-stream)
2002-10-28 12:39 UTC, Henrik Olsson
Details
performanceTuning.patch (153.17 KB, patch)
2002-10-30 07:23 UTC, Henrik Olsson
Details | Diff
Correction for BorderAndPadding wrong color (1.54 KB, patch)
2002-11-25 10:34 UTC, Henrik Olsson
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Henrik Olsson 2002-10-28 12:09:19 UTC
Made some changes to the fop-0.20.4 that makes it run about 20-30% faster.
Whats done: removed alot of code that made to many strings and unnecessary 
objects.

(I know i promised more but...)

diff:

+++ src\org\apache\fop\apps\StreamRenderer.java	Mon Oct 28 11:39:21 2002
@@ -118,7 +118,7 @@
     }
 
     public void addExtension(ExtensionObj ext) {
-        extensions.addElement(ext);
+        extensions.add(ext);
     }
 
     public void startRenderer()
@@ -222,7 +222,7 @@
           valid on the current pages. This short-cuts the
           pipeline and renders the area immediately.
         */
-        if ((renderQueue.size() == 0) && idReferences.isEveryIdValid())
+        if((renderQueue.size() == 0) && idReferences.isEveryIdValid())
             renderer.render(page, outputStream);
         else
             addToRenderQueue(page);
--- org__src\org\apache\fop\extensions\ExtensionObj.java	Mon Oct 28 
11:39:43 2002
+++ src\org\apache\fop\extensions\ExtensionObj.java	Mon Oct 28 11:39:43 2002
@@ -32,10 +32,10 @@
      *
      * @param area
      */
-    public Status layout(Area area) throws FOPException {
+    public int layout(Area area) throws FOPException {
         ExtensionArea extArea = new ExtensionArea(this);
         area.addChild(extArea);
-        return new Status(Status.OK);
+        return Status.OK;
     }
 
 
--- org__src\org\apache\fop\fo\ColorProfile.java	Mon Oct 28 11:39:45 2002
+++ src\org\apache\fop\fo\ColorProfile.java	Mon Oct 28 11:39:45 2002
@@ -8,7 +8,6 @@
 package org.apache.fop.fo;
 
 // FOP
-import org.apache.fop.fo.*;
 import org.apache.fop.fo.flow.*;
 import org.apache.fop.fo.properties.*;
 import org.apache.fop.layout.AreaTree;
--- org__src\org\apache\fop\fo\Declarations.java	Mon Oct 28 11:39:45 2002
+++ src\org\apache\fop\fo\Declarations.java	Mon Oct 28 11:39:45 2002
@@ -8,7 +8,6 @@
 package org.apache.fop.fo;
 
 // FOP
-import org.apache.fop.fo.*;
 import org.apache.fop.fo.flow.*;
 import org.apache.fop.fo.properties.*;
 import org.apache.fop.layout.AreaTree;
--- org__src\org\apache\fop\fo\FObj.java	Mon Oct 28 11:39:46 2002
+++ src\org\apache\fop\fo\FObj.java	Mon Oct 28 11:39:46 2002
@@ -69,9 +69,9 @@
      *
      * @param area
      */
-    public Status layout(Area area) throws FOPException {
+    public int layout(Area area) throws FOPException {
         // should always be overridden
-        return new Status(Status.OK);
+        return Status.OK;
     }
 
     /**
@@ -132,7 +132,7 @@
         idReferences.removeID(((FObj)this).properties.get("id").getString());
         int numChildren = this.children.size();
         for (int i = 0; i < numChildren; i++) {
-            FONode child = (FONode)children.elementAt(i);
+            FONode child = (FONode)children.get(i);
             if ((child instanceof FObj)) {
                 ((FObj)child).removeID(idReferences);
             }
--- org__src\org\apache\fop\fo\FObjMixed.java	Mon Oct 28 11:39:47 2002
+++ src\org\apache\fop\fo\FObjMixed.java	Mon Oct 28 11:39:47 2002
@@ -53,7 +53,7 @@
 
     }
 
-    public Status layout(Area area) throws FOPException {
+    public int layout(Area area) throws FOPException {
 
         if (this.properties != null) {
             Property prop = this.properties.get("id");
@@ -75,14 +75,14 @@
 
         int numChildren = this.children.size();
         for (int i = this.marker; i < numChildren; i++) {
-            FONode fo = (FONode)children.elementAt(i);
-            Status status;
-            if ((status = fo.layout(area)).isIncomplete()) {
+            FONode fo = (FONode)children.get(i);
+            int status;
+            if (Status.isIncomplete((status = fo.layout(area)))) {
                 this.marker = i;
                 return status;
             }
         }
-        return new Status(Status.OK);
+        return Status.OK;
     }
 
 }
--- org__src\org\apache\fop\fo\FONode.java	Mon Oct 28 11:39:47 2002
+++ src\org\apache\fop\fo\FONode.java	Mon Oct 28 11:39:47 2002
@@ -20,8 +20,8 @@
 import org.apache.avalon.framework.logger.Logger;
 
 // Java
-import java.util.Vector;
-import java.util.Hashtable;
+import java.util.ArrayList;
+import java.util.HashMap;
 
 /**
  * base class for nodes in the formatting object tree
@@ -41,7 +41,7 @@
 
     public BufferManager bufferManager;
 
-    protected Vector children = new Vector();    // made public for searching 
for id's
+    protected ArrayList children = new ArrayList();    // made public for 
searching for id's
 
     /**
      * value of marker before layout begins
@@ -74,7 +74,7 @@
     public int areasGenerated = 0;
 
     // markers
-    protected Hashtable markers;
+    protected HashMap markers;
 
     protected Logger log;
 
@@ -84,7 +84,7 @@
             this.bufferManager = parent.bufferManager;
         }
 
-        markers = new Hashtable();
+        markers = new HashMap();
 
         if (null != parent)
             this.areaClass = parent.areaClass;
@@ -98,7 +98,7 @@
         this.isInTableCell = true;
         // made recursive by Eric Schaeffer
         for (int i = 0; i < this.children.size(); i++) {
-            FONode child = (FONode)this.children.elementAt(i);
+            FONode child = (FONode)this.children.get(i);
             child.setIsInTableCell();
         }
     }
@@ -107,7 +107,7 @@
         this.forcedStartOffset = offset;
         // made recursive by Eric Schaeffer
         for (int i = 0; i < this.children.size(); i++) {
-            FONode child = (FONode)this.children.elementAt(i);
+            FONode child = (FONode)this.children.get(i);
             child.forceStartOffset(offset);
         }
     }
@@ -116,7 +116,7 @@
         this.forcedWidth = width;
         // made recursive by Eric Schaeffer
         for (int i = 0; i < this.children.size(); i++) {
-            FONode child = (FONode)this.children.elementAt(i);
+            FONode child = (FONode)this.children.get(i);
             child.forceWidth(width);
         }
     }
@@ -125,7 +125,7 @@
         this.marker = START;
         int numChildren = this.children.size();
         for (int i = 0; i < numChildren; i++) {
-            ((FONode)children.elementAt(i)).resetMarker();
+            ((FONode)children.get(i)).resetMarker();
         }
     }
 
@@ -143,7 +143,7 @@
 
 
     protected void addChild(FONode child) {
-        children.addElement(child);
+        children.add(child);
     }
 
     public FObj getParent() {
@@ -161,7 +161,7 @@
     public void setLinkSet(LinkSet linkSet) {
         this.linkSet = linkSet;
         for (int i = 0; i < this.children.size(); i++) {
-            FONode child = (FONode)this.children.elementAt(i);
+            FONode child = (FONode)this.children.get(i);
             child.setLinkSet(linkSet);
         }
     }
@@ -170,7 +170,7 @@
         return this.linkSet;
     }
 
-    abstract public Status layout(Area area) throws FOPException;
+    abstract public int layout(Area area) throws FOPException;
 
     /**
      * lets outside sources access the property list
@@ -190,8 +190,8 @@
      * @param snapshot a Vector of markers (Integer)
      * @returns the updated Vector of markers (Integers)
      */
-    public Vector getMarkerSnapshot(Vector snapshot) {
-        snapshot.addElement(new Integer(this.marker));
+    public ArrayList getMarkerSnapshot(ArrayList snapshot) {
+        snapshot.add(new Integer(this.marker));
 
         // terminate if no kids or child not yet accessed
         if (this.marker < 0)
@@ -199,7 +199,7 @@
         else if (children.isEmpty())
             return snapshot;
         else
-            return ((FONode)children.elementAt(this.marker)).getMarkerSnapshot
(snapshot);
+            return ((FONode)children.get(this.marker)).getMarkerSnapshot
(snapshot);
     }
 
     /**
@@ -208,9 +208,9 @@
      * and restored using this method.
      * @param snapshot the Vector of saved markers (Integers)
      */
-    public void rollback(Vector snapshot) {
-        this.marker = ((Integer)snapshot.elementAt(0)).intValue();
-        snapshot.removeElementAt(0);
+    public void rollback(ArrayList snapshot) {
+        this.marker = ((Integer)snapshot.get(0)).intValue();
+        snapshot.remove(0);
 
         if (this.marker == START) {
             // make sure all the children of this FO are also reset
@@ -226,10 +226,10 @@
         }
 
         for (int i = this.marker + 1; i < numChildren; i++) {
-            FONode fo = (FONode)children.elementAt(i);
+            FONode fo = (FONode)children.get(i);
             fo.resetMarker();
         }
-        ((FONode)children.elementAt(this.marker)).rollback(snapshot);
+        ((FONode)children.get(this.marker)).rollback(snapshot);
     }
 
 
@@ -249,8 +249,8 @@
         return !markers.isEmpty();
     }
 
-    public Vector getMarkers() {
-        return new Vector(markers.values());
+    public ArrayList getMarkers() {
+        return new ArrayList(markers.values());
     }
 
 }
--- org__src\org\apache\fop\fo\FOText.java	Mon Oct 28 11:39:47 2002
+++ src\org\apache\fop\fo\FOText.java	Mon Oct 28 11:39:47 2002
@@ -101,13 +101,13 @@
         return false;
     }
 
-    public Status layout(Area area) throws FOPException {
+    public int layout(Area area) throws FOPException {
         // ML - remove refs to BufferManager
         // char ca[] = this.bufferManager.readBuffer((Object)this);
         if (!(area instanceof BlockArea)) {
             log.error("text outside block area"
                       + new String(ca, start, length));
-            return new Status(Status.OK);
+            return Status.OK;
         }
         if (this.marker == START) {
             String fontFamily =
@@ -166,11 +166,11 @@
             // see LineArea.addText()
 
             // this.marker = 0;
-            return new Status(Status.OK);
+            return Status.OK;
         } else if (this.marker != orig_start) {
-            return new Status(Status.AREA_FULL_SOME);
+            return Status.AREA_FULL_SOME;
         } else {
-            return new Status(Status.AREA_FULL_NONE);
+            return Status.AREA_FULL_NONE;
         }
     }
 
--- org__src\org\apache\fop\fo\PropertyList.java	Mon Oct 28 11:39:50 2002
+++ src\org\apache\fop\fo\PropertyList.java	Mon Oct 28 11:39:50 2002
@@ -7,12 +7,14 @@
 
 package org.apache.fop.fo;
 
-import java.util.Hashtable;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Iterator;
 import org.apache.fop.messaging.MessageHandler;
 import org.apache.fop.fo.properties.WritingMode;
 import org.apache.fop.apps.FOPException;
 
-public class PropertyList extends Hashtable {
+public class PropertyList extends HashMap {
 
     private byte[] wmtable = null;    // writing-mode values
     public static final int LEFT = 0;
@@ -38,20 +40,22 @@
                 "inline-progression-dimension"
             };
 
-    static private final Hashtable wmtables = new Hashtable(4);
-    {
-        wmtables.put(new Integer(WritingMode.LR_TB),    /* lr-tb */
-                     new byte[] {
-                         START, END, BEFORE, AFTER, BLOCKPROGDIM, INLINEPROGDIM
-                     });
-        wmtables.put(new Integer(WritingMode.RL_TB),    /* rl-tb */
-                     new byte[] {
-                         END, START, BEFORE, AFTER, BLOCKPROGDIM, INLINEPROGDIM
-                     });
-        wmtables.put(new Integer(WritingMode.TB_RL),    /* tb-rl */
-                     new byte[] {
-                         AFTER, BEFORE, START, END, INLINEPROGDIM, BLOCKPROGDIM
-                     });
+    static private final byte[][] wmtables;
+    static{
+        int i = Math.max( Math.max( WritingMode.LR_TB, WritingMode.RL_TB), 
WritingMode.TB_RL)+1;
+        wmtables = new byte[i][];
+        wmtables[ WritingMode.LR_TB] =    /* lr-tb */
+            new byte[] {
+                START, END, BEFORE, AFTER, BLOCKPROGDIM, INLINEPROGDIM
+            };
+        wmtables[ WritingMode.RL_TB] =     /* rl-tb */
+            new byte[] {
+                END, START, BEFORE, AFTER, BLOCKPROGDIM, INLINEPROGDIM
+            };
+        wmtables[ WritingMode.TB_RL] =     /* tb-rl */
+            new byte[] {
+                AFTER, BEFORE, START, END, INLINEPROGDIM, BLOCKPROGDIM
+            };
     }
 
     private PropertyListBuilder builder;
@@ -366,7 +370,7 @@
      * Set the writing mode traits for the FO with this property list.
      */
     public void setWritingMode(int writingMode) {
-        this.wmtable = (byte[])wmtables.get(new Integer(writingMode));
+        this.wmtable = wmtables[writingMode];
     }
 
 }
--- org__src\org\apache\fop\fo\PropertyManager.java	Mon Oct 28 11:39:51 2002
+++ src\org\apache\fop\fo\PropertyManager.java	Mon Oct 28 11:39:51 2002
@@ -6,7 +6,7 @@
  */
 
 package org.apache.fop.fo;
-
+import java.lang.StringBuffer;
 import java.net.MalformedURLException;
 import java.text.FieldPosition;
 import java.text.MessageFormat;
@@ -47,15 +47,6 @@
     private String[] saTop;
     private String[] saBottom;
 
-    private static MessageFormat msgColorFmt =
-        new MessageFormat("border-{0}-color");
-    private static MessageFormat msgStyleFmt =
-        new MessageFormat("border-{0}-style");
-    private static MessageFormat msgWidthFmt =
-        new MessageFormat("border-{0}-width");
-    private static MessageFormat msgPaddingFmt =
-        new MessageFormat("padding-{0}");
-
     public PropertyManager(PropertyList pList) {
         this.properties = pList;
     }
@@ -103,14 +94,40 @@
 
     private void initBorderInfo(int whichSide, String[] saSide) {
         borderAndPadding.setPadding(whichSide,
-                                    properties.get(msgPaddingFmt.format
(saSide)).getCondLength());
+                                    properties.get(formatPadding
(saSide)).getCondLength());
+
         // If style = none, force width to 0, don't get Color
-        int style = properties.get(msgStyleFmt.format(saSide)).getEnum();
+        int style = properties.get(formatStyle(saSide)).getEnum();
         if (style != Constants.NONE) {
             borderAndPadding.setBorder(whichSide, style,
-                                       properties.get(msgWidthFmt.format
(saSide)).getCondLength(),
-                                       properties.get(msgColorFmt.format
(saSide)).getColorType());
+                                       properties.get(formatWidth
(saSide)).getCondLength(),
+                                       properties.get(formatColor
(saSide)).getColorType());
         }
+    }
+
+    private static final String padding = new String("padding-");
+    private static final String border  = new String("border-");
+    private static final String width   = new String("-width");
+    private static final String color	 = new String("-color");
+    private static final String style	 = new String("-style");
+
+    private String formatPadding(String[] saSide) {
+        StringBuffer sb = new StringBuffer(14);
+        return sb.append(padding).append(saSide[0]).toString();
+    }
+
+    private String formatColor(String[] saSide) {
+        StringBuffer sb = new StringBuffer(19);
+        return sb.append(border).append(saSide[0]).append(color).toString();
+    }
+    private String formatWidth(String[] saSide) {
+        StringBuffer sb = new StringBuffer(19);
+        return sb.append(border).append(saSide[0]).append(width).toString();
+    }
+
+    private String formatStyle(String[] saSide) {
+        StringBuffer sb = new StringBuffer(19);
+        return sb.append(border).append(saSide[0]).append(style).toString();
     }
 
     public HyphenationProps getHyphenationProps() {
--- org__src\org\apache\fop\fo\Status.java	Mon Oct 28 11:39:51 2002
+++ src\org\apache\fop\fo\Status.java	Mon Oct 28 11:39:51 2002
@@ -10,9 +10,7 @@
 /**
  * classes representating the status of laying out a formatting object
  */
-public class Status {
-
-    protected int code;
+public abstract class Status {
 
     public final static int OK = 1;
     public final static int AREA_FULL_NONE = 2;
@@ -23,26 +21,21 @@
     public final static int FORCE_COLUMN_BREAK = 7;
     public final static int KEEP_WITH_NEXT = 8;
 
-    public Status(int code) {
-        this.code = code;
-    }
-
-    public int getCode() {
-        return this.code;
+    public static boolean isIncomplete(int code) {
+        return ((code != OK) && (code != KEEP_WITH_NEXT));
     }
 
-    public boolean isIncomplete() {
-        return ((this.code != OK) && (this.code != KEEP_WITH_NEXT));
+    public static boolean laidOutNone(int code) {
+        return (code == AREA_FULL_NONE);
     }
 
-    public boolean laidOutNone() {
-        return (this.code == AREA_FULL_NONE);
+    public static boolean isPageBreak(int code) {
+        switch( code) {
+        case FORCE_PAGE_BREAK:
+        case FORCE_PAGE_BREAK_EVEN:
+        case FORCE_PAGE_BREAK_ODD:
+            return true;
+        }
+        return false;
     }
-
-    public boolean isPageBreak() {
-        return ((this.code == FORCE_PAGE_BREAK)
-                || (this.code == FORCE_PAGE_BREAK_EVEN)
-                || (this.code == FORCE_PAGE_BREAK_ODD));
-    }
-
 }
--- org__src\org\apache\fop\fo\Title.java	Mon Oct 28 11:39:52 2002
+++ src\org\apache\fop\fo\Title.java	Mon Oct 28 11:39:52 2002
@@ -8,7 +8,6 @@
 package org.apache.fop.fo;
 
 // FOP
-import org.apache.fop.fo.*;
 import org.apache.fop.datatypes.*;
 import org.apache.fop.layout.*;
 import org.apache.fop.fo.flow.*;
@@ -38,7 +37,7 @@
         this.name = "fo:title";
     }
 
-    public Status layout(Area area) throws FOPException {
+    public int layout(Area area) throws FOPException {
 
         // Common Accessibility Properties
         AccessibilityProps mAccProps = propMgr.getAccessibilityProps();
--- org__src\org\apache\fop\fo\ToBeImplementedElement.java	Mon Oct 28 
11:39:52 2002
+++ src\org\apache\fop\fo\ToBeImplementedElement.java	Mon Oct 28 11:39:52 2002
@@ -8,7 +8,6 @@
 package org.apache.fop.fo;
 
 // FOP
-import org.apache.fop.fo.*;
 import org.apache.fop.fo.flow.*;
 import org.apache.fop.fo.properties.*;
 import org.apache.fop.layout.Area;
@@ -23,10 +22,10 @@
         super(parent, propertyList);
     }
 
-    public Status layout(Area area) throws FOPException {
+    public int layout(Area area) throws FOPException {
         log.debug("This element \"" + this.name
                   + "\" is not yet implemented.");
-        return new Status(Status.OK);
+        return Status.OK;
     }
 
 }
--- org__src\org\apache\fop\fo\Unknown.java	Mon Oct 28 11:39:52 2002
+++ src\org\apache\fop\fo\Unknown.java	Mon Oct 28 11:39:52 2002
@@ -8,7 +8,7 @@
 package org.apache.fop.fo;
 
 // FOP
-import org.apache.fop.fo.*;
+//import org.apache.fop.fo.*;
 import org.apache.fop.layout.*;
 import org.apache.fop.fo.flow.*;
 import org.apache.fop.fo.properties.*;
@@ -41,8 +41,8 @@
         this.name = "unknown";
     }
 
-    public Status layout(Area area) throws FOPException {
+    public int layout(Area area) throws FOPException {
         log.debug("Layout Unknown element");
-        return new Status(Status.OK);
+        return Status.OK;
     }
 }
--- org__src\org\apache\fop\fo\UnknownXMLObj.java	Mon Oct 28 11:39:53 2002
+++ src\org\apache\fop\fo\UnknownXMLObj.java	Mon Oct 28 11:39:52 2002
@@ -7,7 +7,7 @@
 
 package org.apache.fop.fo;
 
-import org.apache.fop.fo.*;
+//import org.apache.fop.fo.*;
 import org.apache.fop.layout.Area;
 import org.apache.fop.layout.FontState;
 import org.apache.fop.layout.inline.*;
@@ -87,7 +87,7 @@
         super.addCharacters(data, start, length);
     }
 
-    public Status layout(Area area) throws FOPException {
+    public int layout(Area area) throws FOPException {
         //if (!(area instanceof ForeignObjectArea)) {
         // this is an error
         //throw new FOPException("Foreign XML not in fo:instream-foreign-
object");
@@ -95,7 +95,7 @@
         log.error("no handler defined for " + this.name + " foreign xml");
 
         /* return status */
-        return new Status(Status.OK);
+        return Status.OK;
     }
 }
 
--- org__src\org\apache\fop\fo\XMLElement.java	Mon Oct 28 11:39:53 2002
+++ src\org\apache\fop\fo\XMLElement.java	Mon Oct 28 11:39:53 2002
@@ -70,7 +70,7 @@
      *
      * @return the status of the layout
      */
-    public Status layout(final Area area) throws FOPException {
+    public int layout(final Area area) throws FOPException {
 
         if (!(area instanceof ForeignObjectArea)) {
             // this is an error
@@ -78,7 +78,7 @@
         }
 
         /* return status */
-        return new Status(Status.OK);
+        return Status.OK;
     }
 
     private void init() {
--- org__src\org\apache\fop\fo\XMLObj.java	Mon Oct 28 11:39:53 2002
+++ src\org\apache\fop\fo\XMLObj.java	Mon Oct 28 11:39:53 2002
@@ -8,7 +8,7 @@
 package org.apache.fop.fo;
 
 // FOP
-import org.apache.fop.fo.*;
+//import org.apache.fop.fo.*;
 import org.apache.fop.layout.Area;
 import org.apache.fop.layout.FontState;
 import org.apache.fop.apps.FOPException;
@@ -137,12 +137,12 @@
      * @param area the area to layout the object into
      * @return the status of the layout
      */
-    public Status layout(Area area) throws FOPException {
+    public int layout(Area area) throws FOPException {
         /* generate a warning */
         log.error("" + this.name + " outside foreign xml");
 
         /* return status */
-        return new Status(Status.OK);
+        return Status.OK;
     }
 
     public void removeID(IDReferences idReferences) {}
--- org__src\org\apache\fop\fo\expr\PropertyTokenizer.java	Mon Oct 28 
11:39:58 2002
+++ src\org\apache\fop\fo\expr\PropertyTokenizer.java	Mon Oct 28 11:39:58 2002
@@ -282,12 +282,23 @@
         return false;
     }
 
-
-    static private final String nameStartChars =
-        "_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
-    static private final String nameChars = ".-0123456789";
-    static private final String digits = "0123456789";
-    static private final String hexchars = digits + "abcdefABCDEF";
+    static private final int CS = 1, nameStartChars = 
1; // "_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
+    static private final int C = 2, nameChars = 2; //".-0123456789";
+    static private final int D = 4, digits = 4; //"0123456789";
+    static private final int H = 8, hexchars = 8; //digits + "abcdefABCDEF";
+    static private final int C_CS = C + CS;
+
+
+    static private final int charMap[] = {
+                                             0,0,0,0, 0,0,0,0, 0,0,0,0, 
0,0,0,0, //0x00
+                                             0,0,0,0, 0,0,0,0, 0,0,0,0, 
0,0,0,0, //0x10
+                                             0,0,0,0, 0,0,0,0, 0,0,0,0, 
0,C,C,0, //0x20
+                                             C+D+H,C+D+H,C+D+H,C+D+H, 
C+D+H,C+D+H,C+D+H,C+D+H, C+D+H,C+D+H,0,0, 0,0,0,0, //0x30
+                                             0,CS+H,CS+H,CS+H, 
CS+H,CS+H,CS+H,CS, CS,CS,CS,CS, CS,CS,CS,CS, //0x40
+                                             CS,CS,CS,CS, CS,CS,CS,CS, 
CS,CS,CS,0, 0,0,0,CS,  //0x50
+                                             0,CS+H,CS+H,CS+H, 
CS+H,CS+H,CS+H,CS, CS,CS,CS,CS, CS,CS,CS,CS, //0x60
+                                             CS,CS,CS,CS, CS,CS,CS,CS, 
CS,CS,CS,0, 0,0,0,0  //0x70
+                                         };
 
     /**
      * Return a boolean value indicating whether the argument is a
@@ -295,7 +306,7 @@
      * @param c The character to check
      */
     private static final boolean isDigit(char c) {
-        return digits.indexOf(c) >= 0;
+        return c > 0 && c < 128 && (charMap[ c] & digits) != 0;
     }
 
     /**
@@ -304,7 +315,8 @@
      * @param c The character to check
      */
     private static final boolean isHexDigit(char c) {
-        return hexchars.indexOf(c) >= 0;
+        return c > 0 && c < 128 && (charMap[ c] & hexchars) != 0;
+        //return hexchars.indexOf(c) >= 0;
     }
 
     /**
@@ -329,7 +341,8 @@
      * @param c The character to check
      */
     private static final boolean isNameStartChar(char c) {
-        return nameStartChars.indexOf(c) >= 0 || c >= 0x80;
+        return c >= 0x80 || c < 0 || (charMap[ c] & nameStartChars) != 0;
+        //return nameStartChars.indexOf(c) >= 0 || c >= 0x80;
     }
 
     /**
@@ -338,8 +351,8 @@
      * @param c The character to check
      */
     private static final boolean isNameChar(char c) {
-        return nameStartChars.indexOf(c) >= 0 || nameChars.indexOf(c) >= 0
-               || c >= 0x80;
+        return c > 0x80 || c < 0 || (charMap[ c] & C_CS) != 0;
+        //return nameStartChars.indexOf(c) >= 0 || nameChars.indexOf(c) >= 0 
|| c >= 0x80;
     }
 
 }
--- org__src\org\apache\fop\fo\flow\BasicLink.java	Mon Oct 28 11:39:59 2002
+++ src\org\apache\fop\fo\flow\BasicLink.java	Mon Oct 28 11:39:59 2002
@@ -38,7 +38,7 @@
         this.name = "fo:basic-link";
     }
 
-    public Status layout(Area area) throws FOPException {
+    public int layout(Area area) throws FOPException {
         String destination;
         int linkType;
 
@@ -106,11 +106,11 @@
 
         int numChildren = this.children.size();
         for (int i = this.marker; i < numChildren; i++) {
-            FONode fo = (FONode)children.elementAt(i);
+            FONode fo = (FONode)children.get(i);
             fo.setLinkSet(ls);
 
-            Status status;
-            if ((status = fo.layout(area)).isIncomplete()) {
+            int status;
+            if (Status.isIncomplete((status = fo.layout(area)))) {
                 this.marker = i;
                 return status;
             }
@@ -126,7 +126,7 @@
 
         p.addLinkSet(ls);
 
-        return new Status(Status.OK);
+        return Status.OK;
     }
 
 }
--- org__src\org\apache\fop\fo\flow\BidiOverride.java	Mon Oct 28 11:39:59 2002
+++ src\org\apache\fop\fo\flow\BidiOverride.java	Mon Oct 28 11:39:59 2002
@@ -10,7 +10,7 @@
 // FOP
 import org.apache.fop.fo.*;
 import org.apache.fop.layout.*;
-import org.apache.fop.fo.flow.*;
+//import org.apache.fop.fo.flow.*;
 import org.apache.fop.fo.properties.*;
 import org.apache.fop.layout.AreaTree;
 import org.apache.fop.apps.FOPException;
@@ -37,7 +37,7 @@
         this.name = "fo:bidi-override";
     }
 
-    public Status layout(Area area) throws FOPException {
+    public int layout(Area area) throws FOPException {
 
         // Common Aural Properties
         AuralProps mAurProps = propMgr.getAuralProps();
--- org__src\org\apache\fop\fo\flow\Block.java	Mon Oct 28 11:40:00 2002
+++ src\org\apache\fop\fo\flow\Block.java	Mon Oct 28 11:39:59 2002
@@ -74,14 +74,14 @@
         ts = propMgr.getTextDecoration(parent);
     }
 
-    public Status layout(Area area) throws FOPException {
+    public int layout(Area area) throws FOPException {
         BlockArea blockArea;
 
         // log.error(" b:LAY[" + marker + "] ");
 
 
         if (this.marker == BREAK_AFTER) {
-            return new Status(Status.OK);
+            return Status.OK;
         }
 
         if (this.marker == START) {
@@ -176,18 +176,18 @@
             // area
             int breakBeforeStatus = propMgr.checkBreakBefore(area);
             if (breakBeforeStatus != Status.OK) {
-                return new Status(breakBeforeStatus);
+                return breakBeforeStatus;
             }
 
             int numChildren = this.children.size();
             for (int i = 0; i < numChildren; i++) {
-                FONode fo = (FONode)children.elementAt(i);
+                FONode fo = (FONode)children.get(i);
                 if (fo instanceof FOText) {
                     if (((FOText)fo).willCreateArea()) {
                         fo.setWidows(blockWidows);
                         break;
                     } else {
-                        children.removeElementAt(i);
+                        children.remove(i);
                         numChildren = this.children.size();
                         i--;
                     }
@@ -198,7 +198,7 @@
             }
 
             for (int i = numChildren - 1; i >= 0; i--) {
-                FONode fo = (FONode)children.elementAt(i);
+                FONode fo = (FONode)children.get(i);
                 if (fo instanceof FOText) {
                     if (((FOText)fo).willCreateArea()) {
                         fo.setOrphans(blockOrphans);
@@ -238,7 +238,7 @@
 
         // markers
         if (this.hasMarkers())
-            blockArea.addMarkers(this.getMarkers());
+            blockArea.addMarkers( this.getMarkers());
 
         blockArea.setParent(area);    // BasicLink needs it
         blockArea.setPage(area.getPage());
@@ -254,9 +254,9 @@
 
         int numChildren = this.children.size();
         for (int i = this.marker; i < numChildren; i++) {
-            FONode fo = (FONode)children.elementAt(i);
-            Status status;
-            if ((status = fo.layout(blockArea)).isIncomplete()) {
+            FONode fo = (FONode)children.get(i);
+            int status;
+            if (Status.isIncomplete((status = fo.layout(blockArea)))) {
                 this.marker = i;
                 // this block was modified by
                 // Hani Elabed 11/27/2000
@@ -267,10 +267,10 @@
 
                 // new block to replace the one above
                 // Hani Elabed 11/27/2000
-                if (status.getCode() == Status.AREA_FULL_NONE) {
+                if (status == Status.AREA_FULL_NONE) {
                     // something has already been laid out
                     if ((i != 0)) {
-                        status = new Status(Status.AREA_FULL_SOME);
+                        status = Status.AREA_FULL_SOME;
                         area.addChild(blockArea);
                         area.setMaxHeight(area.getMaxHeight() - spaceLeft
                                           + blockArea.getMaxHeight());
@@ -328,18 +328,18 @@
         if (breakAfterStatus != Status.OK) {
             this.marker = BREAK_AFTER;
             blockArea = null; //Faster GC - BlockArea is big
-            return new Status(breakAfterStatus);
+            return breakAfterStatus;
         }
 
         if (keepWithNext != 0) {
             blockArea = null; // Faster GC - BlockArea is big
-            return new Status(Status.KEEP_WITH_NEXT);
+            return Status.KEEP_WITH_NEXT;
         }
 
         // log.error(" b:OK" + marker + " ");
         blockArea.isLast(true);
         blockArea = null; // Faster GC - BlockArea is big
-        return new Status(Status.OK);
+        return Status.OK;
     }
 
     public int getAreaHeight() {
--- org__src\org\apache\fop\fo\flow\BlockContainer.java	Mon Oct 28 11:40:00 2002
+++ src\org\apache\fop\fo\flow\BlockContainer.java	Mon Oct 28 11:40:00 2002
@@ -55,7 +55,7 @@
         this.span = this.properties.get("span").getEnum();
     }
 
-    public Status layout(Area area) throws FOPException {
+    public int layout(Area area) throws FOPException {
         if (this.marker == START) {
 
             // Common Accessibility Properties
@@ -124,13 +124,13 @@
 
         int numChildren = this.children.size();
         for (int i = this.marker; i < numChildren; i++) {
-            FObj fo = (FObj)children.elementAt(i);
-            Status status;
-            if ((status = fo.layout(areaContainer)).isIncomplete()) {
+            FObj fo = (FObj)children.get(i);
+            int status;
+            if (Status.isIncomplete((status = fo.layout(areaContainer)))) {
                 /*
                  * if ((prevChildMustKeepWithNext) && (status.laidOutNone())) {
                  * this.marker = i - 1;
-                 * FObj prevChild = (FObj) children.elementAt(this.marker);
+                 * FObj prevChild = (FObj) children.get(this.marker);
                  * prevChild.removeAreas();
                  * prevChild.resetMarker();
                  * return new Status(Status.AREA_FULL_SOME);
@@ -142,7 +142,7 @@
                  * }
                  */
             }
-            if (status.getCode() == Status.KEEP_WITH_NEXT) {
+            if (status == Status.KEEP_WITH_NEXT) {
                 prevChildMustKeepWithNext = true;
             }
         }
@@ -153,7 +153,7 @@
             areaContainer.setHeight(height);
         area.addChild(areaContainer);
 
-        return new Status(Status.OK);
+        return Status.OK;
     }
 
     /**
--- org__src\org\apache\fop\fo\flow\Character.java	Mon Oct 28 11:40:00 2002
+++ src\org\apache\fop\fo\flow\Character.java	Mon Oct 28 11:40:00 2002
@@ -56,11 +56,11 @@
     }
 
 
-    public Status layout(Area area) throws FOPException {
+    public int layout(Area area) throws FOPException {
         BlockArea blockArea;
         if (!(area instanceof BlockArea)) {
             log.warn("currently Character can only be in a BlockArea");
-            return new Status(Status.OK);
+            return Status.OK;
         }
         blockArea = (BlockArea)area;
         boolean textDecoration;
@@ -135,7 +135,7 @@
 
         LineArea la = blockArea.getCurrentLineArea();
         if (la == null) {
-            return new Status(Status.AREA_FULL_NONE);
+            return Status.AREA_FULL_NONE;
         }
         la.changeFont(propMgr.getFontState(area.getFontInfo()));
         la.changeColor(red, green, blue);
@@ -147,7 +147,7 @@
         if (result == Character.DOESNOT_FIT) {
             la = blockArea.createNextLineArea();
             if (la == null) {
-                return new Status(Status.AREA_FULL_NONE);
+                return Status.AREA_FULL_NONE;
             }
             la.changeFont(propMgr.getFontState(area.getFontInfo()));
             la.changeColor(red, green, blue);
@@ -157,7 +157,7 @@
             la.addCharacter(characterValue, this.getLinkSet(),
                             textDecoration);
         }
-        return new Status(Status.OK);
+        return Status.OK;
 
     }
 
--- org__src\org\apache\fop\fo\flow\ExternalGraphic.java	Mon Oct 28 
11:40:00 2002
+++ src\org\apache\fop\fo\flow\ExternalGraphic.java	Mon Oct 28 11:40:00 2002
@@ -43,7 +43,7 @@
     }
 
 
-    public Status layout(Area area) throws FOPException {
+    public int layout(Area area) throws FOPException {
 
         if (this.marker == START) {
 
@@ -155,7 +155,7 @@
             }
 
             if (area.spaceLeft() < (height + spaceBefore)) {
-                return new Status(Status.AREA_FULL_NONE);
+                return Status.AREA_FULL_NONE;
             }
 
             this.imageArea =
@@ -183,15 +183,15 @@
             if (breakBefore == BreakBefore.PAGE
                     || ((spaceBefore + imageArea.getHeight())
                         > area.spaceLeft())) {
-                return new Status(Status.FORCE_PAGE_BREAK);
+                return Status.FORCE_PAGE_BREAK;
             }
 
             if (breakBefore == BreakBefore.ODD_PAGE) {
-                return new Status(Status.FORCE_PAGE_BREAK_ODD);
+                return Status.FORCE_PAGE_BREAK_ODD;
             }
 
             if (breakBefore == BreakBefore.EVEN_PAGE) {
-                return new Status(Status.FORCE_PAGE_BREAK_EVEN);
+                return Status.FORCE_PAGE_BREAK_EVEN;
             }
 
 
@@ -199,13 +199,13 @@
                 BlockArea ba = (BlockArea)area;
                 LineArea la = ba.getCurrentLineArea();
                 if (la == null) {
-                    return new Status(Status.AREA_FULL_NONE);
+                    return Status.AREA_FULL_NONE;
                 }
                 la.addPending();
                 if (imageArea.getContentWidth() > la.getRemainingWidth()) {
                     la = ba.createNextLineArea();
                     if (la == null) {
-                        return new Status(Status.AREA_FULL_NONE);
+                        return Status.AREA_FULL_NONE;
                     }
                 }
                 la.addInlineArea(imageArea);
@@ -217,17 +217,17 @@
 
             if (breakAfter == BreakAfter.PAGE) {
                 this.marker = BREAK_AFTER;
-                return new Status(Status.FORCE_PAGE_BREAK);
+                return Status.FORCE_PAGE_BREAK;
             }
 
             if (breakAfter == BreakAfter.ODD_PAGE) {
                 this.marker = BREAK_AFTER;
-                return new Status(Status.FORCE_PAGE_BREAK_ODD);
+                return Status.FORCE_PAGE_BREAK_ODD;
             }
 
             if (breakAfter == BreakAfter.EVEN_PAGE) {
                 this.marker = BREAK_AFTER;
-                return new Status(Status.FORCE_PAGE_BREAK_EVEN);
+                return Status.FORCE_PAGE_BREAK_EVEN;
             }
 
 
@@ -248,7 +248,7 @@
         // area.start();
         // }
 
-        return new Status(Status.OK);
+        return Status.OK;
     }
 
 
--- org__src\org\apache\fop\fo\flow\Float.java	Mon Oct 28 11:40:00 2002
+++ src\org\apache\fop\fo\flow\Float.java	Mon Oct 28 11:40:00 2002
@@ -9,7 +9,7 @@
 
 // FOP
 import org.apache.fop.fo.*;
-import org.apache.fop.fo.flow.*;
+//import org.apache.fop.fo.flow.*;
 import org.apache.fop.fo.properties.*;
 import org.apache.fop.layout.*;
 import org.apache.fop.apps.FOPException;
@@ -36,7 +36,7 @@
         this.name = "fo:float";
     }
 
-    public Status layout(Area area) throws FOPException {
+    public int layout(Area area) throws FOPException {
 
         // this.properties.get("float");
         // this.properties.get("clear");
--- org__src\org\apache\fop\fo\flow\Flow.java	Mon Oct 28 11:40:01 2002
+++ src\org\apache\fop\fo\flow\Flow.java	Mon Oct 28 11:40:01 2002
@@ -17,8 +17,8 @@
 
 // Java
 import java.util.Hashtable;
-import java.util.Enumeration;
-import java.util.Vector;
+import java.util.Iterator;
+import java.util.ArrayList;
 
 public class Flow extends FObj {
 
@@ -47,7 +47,7 @@
     /**
      * Vector to store snapshot
      */
-    private Vector markerSnapshot;
+    private ArrayList markerSnapshot;
 
     /**
      * flow-name attribute
@@ -59,7 +59,7 @@
      */
     private int contentWidth;
 
-    private Status _status = new Status(Status.AREA_FULL_NONE);
+    private int _status = Status.AREA_FULL_NONE;
 
 
     protected Flow(FObj parent,
@@ -109,12 +109,12 @@
         return _flowName;
     }
 
-    public Status layout(Area area) throws FOPException {
+    public int layout(Area area) throws FOPException {
         return layout(area, null);
 
     }
 
-    public Status layout(Area area, Region region) throws FOPException {
+    public int layout(Area area, Region region) throws FOPException {
         if (this.marker == START) {
             this.marker = 0;
         }
@@ -123,14 +123,14 @@
         BodyAreaContainer bac = (BodyAreaContainer)area;
 
         boolean prevChildMustKeepWithNext = false;
-        Vector pageMarker = this.getMarkerSnapshot(new Vector());
+        ArrayList pageMarker = this.getMarkerSnapshot(new ArrayList());
 
         int numChildren = this.children.size();
         if (numChildren == 0) {
             throw new FOPException("fo:flow must contain block-level 
children");
         }
         for (int i = this.marker; i < numChildren; i++) {
-            FObj fo = (FObj)children.elementAt(i);
+            FObj fo = (FObj)children.get(i);
 
             if (bac.isBalancingRequired(fo)) {
                 // reset the the just-done span area in preparation
@@ -148,7 +148,7 @@
             currentArea.setIDReferences(bac.getIDReferences());
             if (bac.isNewSpanArea()) {
                 this.marker = i;
-                markerSnapshot = this.getMarkerSnapshot(new Vector());
+                markerSnapshot = this.getMarkerSnapshot(new ArrayList());
             }
             // Set current content width for percent-based lengths in children
             setContentWidth(currentArea.getContentWidth());
@@ -165,23 +165,22 @@
              * continue;
              * }
              */
-            if (_status.isIncomplete()) {
-                if ((prevChildMustKeepWithNext) && (_status.laidOutNone())) {
+            if (Status.isIncomplete(_status)) {
+                if ((prevChildMustKeepWithNext) && (Status.laidOutNone
(_status))) {
                     this.marker = i - 1;
-                    FObj prevChild = (FObj)children.elementAt(this.marker);
+                    FObj prevChild = (FObj)children.get(this.marker);
                     prevChild.removeAreas();
                     prevChild.resetMarker();
                     prevChild.removeID(area.getIDReferences());
-                    _status = new Status(Status.AREA_FULL_SOME);
+                    _status = Status.AREA_FULL_SOME;
                     return _status;
                     // should probably return AREA_FULL_NONE if first
                     // or perhaps an entirely new status code
                 }
                 if (bac.isLastColumn())
-                    if (_status.getCode() == Status.FORCE_COLUMN_BREAK) {
+                    if (_status == Status.FORCE_COLUMN_BREAK) {
                         this.marker = i;
-                        _status =
-                            new Status(Status.FORCE_PAGE_BREAK);    // same 
thing
+                        _status = Status.FORCE_PAGE_BREAK;    // same thing
                         return _status;
                     } else {
                         this.marker = i;
@@ -189,7 +188,7 @@
                     }
                 else {
                     // not the last column, but could be page breaks
-                    if (_status.isPageBreak()) {
+                    if (Status.isPageBreak(_status)) {
                         this.marker = i;
                         return _status;
                     }
@@ -198,7 +197,7 @@
                     i--;
                 }
             }
-            if (_status.getCode() == Status.KEEP_WITH_NEXT) {
+            if (_status == Status.KEEP_WITH_NEXT) {
                 prevChildMustKeepWithNext = true;
             } else {
                 prevChildMustKeepWithNext = false;
@@ -222,7 +221,7 @@
         return "fo:flow";
     }
 
-    public Status getStatus() {
+    public int getStatus() {
         return _status;
     }
 
--- org__src\org\apache\fop\fo\flow\Footnote.java	Mon Oct 28 11:40:01 2002
+++ src\org\apache\fop\fo\flow\Footnote.java	Mon Oct 28 11:40:01 2002
@@ -15,8 +15,8 @@
 import org.apache.fop.messaging.*;
 
 // Java
-import java.util.Enumeration;
-import java.util.Vector;
+import java.util.Iterator;
+import java.util.ArrayList;
 
 public class Footnote extends FObj {
 
@@ -38,7 +38,7 @@
         this.name = "fo:footnote";
     }
 
-    public Status layout(Area area) throws FOPException {
+    public int layout(Area area) throws FOPException {
         FONode inline = null;
         FONode fbody = null;
         if (this.marker == START) {
@@ -46,11 +46,11 @@
         }
         int numChildren = this.children.size();
         for (int i = this.marker; i < numChildren; i++) {
-            FONode fo = (FONode)children.elementAt(i);
+            FONode fo = (FONode)children.get(i);
             if (fo instanceof Inline) {
                 inline = fo;
-                Status status = fo.layout(area);
-                if (status.isIncomplete()) {
+                int status = fo.layout(area);
+                if (Status.isIncomplete(status)) {
                     return status;
                 }
             } else if (inline != null && fo instanceof FootnoteBody) {
@@ -68,7 +68,7 @@
             log.error("no footnote-body in footnote");
         }
         if (area instanceof BlockArea) {}
-        return new Status(Status.OK);
+        return Status.OK;
     }
 
     public static boolean layoutFootnote(Page p, FootnoteBody fb, Area area) {
@@ -86,8 +86,8 @@
                 footArea.setMaxHeight(bac.getMaxHeight()
                                       + footArea.getHeight());
             }
-            Status status = fb.layout(footArea);
-            if (status.isIncomplete()) {
+            int status = fb.layout(footArea);
+            if (Status.isIncomplete(status)) {
                 // add as a pending footnote
                 return false;
             } else {
@@ -110,9 +110,9 @@
 
     protected static void decreaseMaxHeight(Area ar, int change) {
         ar.setMaxHeight(ar.getMaxHeight() - change);
-        Vector childs = ar.getChildren();
-        for (Enumeration en = childs.elements(); en.hasMoreElements(); ) {
-            Object obj = en.nextElement();
+        ArrayList childs = ar.getChildren();
+        for (Iterator en = childs.iterator(); en.hasNext(); ) {
+            Object obj = en.next();
             if (obj instanceof Area) {
                 Area childArea = (Area)obj;
                 decreaseMaxHeight(childArea, change);
--- org__src\org\apache\fop\fo\flow\FootnoteBody.java	Mon Oct 28 11:40:01 2002
+++ src\org\apache\fop\fo\flow\FootnoteBody.java	Mon Oct 28 11:40:01 2002
@@ -46,7 +46,7 @@
         this.areaClass = AreaClass.setAreaClass(AreaClass.XSL_FOOTNOTE);
     }
 
-    public Status layout(Area area) throws FOPException {
+    public int layout(Area area) throws FOPException {
         if (this.marker == START) {
             this.marker = 0;
         }
@@ -67,9 +67,9 @@
 
         int numChildren = this.children.size();
         for (int i = this.marker; i < numChildren; i++) {
-            FONode fo = (FONode)children.elementAt(i);
-            Status status;
-            if ((status = fo.layout(blockArea)).isIncomplete()) {
+            FONode fo = (FONode)children.get(i);
+            int status;
+            if (Status.isIncomplete((status = fo.layout(blockArea)))) {
                 this.resetMarker();
                 return status;
             }
@@ -78,7 +78,7 @@
         area.addChild(blockArea);
         area.increaseHeight(blockArea.getHeight());
         blockArea.isLast(true);
-        return new Status(Status.OK);
+        return Status.OK;
     }
 
 }
--- org__src\org\apache\fop\fo\flow\InitialPropertySet.java	Mon Oct 28 
11:40:02 2002
+++ src\org\apache\fop\fo\flow\InitialPropertySet.java	Mon Oct 28 11:40:02 2002
@@ -10,7 +10,6 @@
 // FOP
 import org.apache.fop.fo.*;
 import org.apache.fop.layout.*;
-import org.apache.fop.fo.flow.*;
 import org.apache.fop.fo.properties.*;
 import org.apache.fop.layout.AreaTree;
 import org.apache.fop.apps.FOPException;
@@ -37,7 +36,7 @@
         this.name = "fo:initial-property-set";
     }
 
-    public Status layout(Area area) throws FOPException {
+    public int layout(Area area) throws FOPException {
 
         // Common Accessibility Properties
         AccessibilityProps mAccProps = propMgr.getAccessibilityProps();
--- org__src\org\apache\fop\fo\flow\Inline.java	Mon Oct 28 11:40:02 2002
+++ src\org\apache\fop\fo\flow\Inline.java	Mon Oct 28 11:40:02 2002
@@ -84,7 +84,7 @@
         ft.setUnderlined(ts.getUnderlined());
         ft.setOverlined(ts.getOverlined());
         ft.setLineThrough(ts.getLineThrough());
-        children.addElement(ft);
+        children.add(ft);
     }
 
 }
--- org__src\org\apache\fop\fo\flow\InlineContainer.java	Mon Oct 28 
11:40:02 2002
+++ src\org\apache\fop\fo\flow\InlineContainer.java	Mon Oct 28 11:40:02 2002
@@ -9,7 +9,6 @@
 
 // FOP
 import org.apache.fop.fo.*;
-import org.apache.fop.fo.flow.*;
 import org.apache.fop.fo.properties.*;
 import org.apache.fop.layout.*;
 import org.apache.fop.apps.FOPException;
--- org__src\org\apache\fop\fo\flow\InstreamForeignObject.java	Mon Oct 28 
11:40:03 2002
+++ src\org\apache\fop\fo\flow\InstreamForeignObject.java	Mon Oct 28 
11:40:03 2002
@@ -86,10 +86,10 @@
      *
      * @return the status of the layout
      */
-    public Status layout(Area area) throws FOPException {
+    public int layout(Area area) throws FOPException {
 
         if (this.marker == BREAK_AFTER) {
-            return new Status(Status.OK);
+            return Status.OK;
         }
 
         if (this.marker == START) {
@@ -191,11 +191,11 @@
                 }
                 /* layout foreign object */
                 if (this.children.size() > 0) {
-                    FONode fo = (FONode)children.elementAt(0);
-                    Status status;
+                    FONode fo = (FONode)children.get(0);
+                    int status;
                     // currently FONode must be an SVG
-                    if ((status =
-                                fo.layout(this.areaCurrent)).isIncomplete()) {
+                    if (Status.isIncomplete((status =
+                                                 fo.layout
(this.areaCurrent)))) {
                         return status;
                     }
 
@@ -209,33 +209,33 @@
             if (breakBefore == BreakBefore.PAGE
                     || ((spaceBefore + areaCurrent.getEffectiveHeight())
                         > area.spaceLeft())) {
-                return new Status(Status.FORCE_PAGE_BREAK);
+                return Status.FORCE_PAGE_BREAK;
             }
 
             if (breakBefore == BreakBefore.ODD_PAGE) {
-                return new Status(Status.FORCE_PAGE_BREAK_ODD);
+                return Status.FORCE_PAGE_BREAK_ODD;
             }
 
             if (breakBefore == BreakBefore.EVEN_PAGE) {
-                return new Status(Status.FORCE_PAGE_BREAK_EVEN);
+                return Status.FORCE_PAGE_BREAK_EVEN;
             }
         }
 
         if (this.areaCurrent == null) {
-            return new Status(Status.OK);
+            return Status.OK;
         }
 
         if (area instanceof BlockArea) {
             BlockArea ba = (BlockArea)area;
             LineArea la = ba.getCurrentLineArea();
             if (la == null) {
-                return new Status(Status.AREA_FULL_NONE);
+                return Status.AREA_FULL_NONE;
             }
             la.addPending();
             if (areaCurrent.getEffectiveWidth() > la.getRemainingWidth()) {
                 la = ba.createNextLineArea();
                 if (la == null) {
-                    return new Status(Status.AREA_FULL_NONE);
+                    return Status.AREA_FULL_NONE;
                 }
             }
             la.addInlineArea(areaCurrent);
@@ -278,22 +278,22 @@
 
         if (breakAfter == BreakAfter.PAGE) {
             this.marker = BREAK_AFTER;
-            return new Status(Status.FORCE_PAGE_BREAK);
+            return Status.FORCE_PAGE_BREAK;
         }
 
         if (breakAfter == BreakAfter.ODD_PAGE) {
             this.marker = BREAK_AFTER;
-            return new Status(Status.FORCE_PAGE_BREAK_ODD);
+            return Status.FORCE_PAGE_BREAK_ODD;
         }
 
         if (breakAfter == BreakAfter.EVEN_PAGE) {
             this.marker = BREAK_AFTER;
-            return new Status(Status.FORCE_PAGE_BREAK_EVEN);
+            return Status.FORCE_PAGE_BREAK_EVEN;
         }
 
         areaCurrent = null;
         /* return status */
-        return new Status(Status.OK);
+        return Status.OK;
     }
 
 }
--- org__src\org\apache\fop\fo\flow\Leader.java	Mon Oct 28 11:40:03 2002
+++ src\org\apache\fop\fo\flow\Leader.java	Mon Oct 28 11:40:03 2002
@@ -43,12 +43,12 @@
         this.name = "fo:leader";
     }
 
-    public Status layout(Area area) throws FOPException {
+    public int layout(Area area) throws FOPException {
         BlockArea blockArea;
         // restriction in this version
         if (!(area instanceof BlockArea)) {
             log.warn("in this version of Fop fo:leader must be a direct child 
of fo:block ");
-            return new Status(Status.OK);
+            return Status.OK;
         } else {
             blockArea = (BlockArea)area;
         }
@@ -139,10 +139,10 @@
                                   ruleStyle, leaderPatternWidth,
                                   leaderAlignment);
         if (succeeded == 1) {
-            return new Status(Status.OK);
+            return Status.OK;
         } else {
             // not sure that this is the correct Status here
-            return new Status(Status.AREA_FULL_SOME);
+            return Status.AREA_FULL_SOME;
         }
     }
 
--- org__src\org\apache\fop\fo\flow\ListBlock.java	Mon Oct 28 11:40:03 2002
+++ src\org\apache\fop\fo\flow\ListBlock.java	Mon Oct 28 11:40:03 2002
@@ -49,7 +49,7 @@
         this.name = "fo:list-block";
     }
 
-    public Status layout(Area area) throws FOPException {
+    public int layout(Area area) throws FOPException {
         if (this.marker == START) {
 
             // Common Accessibility Properties
@@ -138,15 +138,15 @@
 
         int numChildren = this.children.size();
         for (int i = this.marker; i < numChildren; i++) {
-            if (!(children.elementAt(i) instanceof ListItem)) {
+            if (!(children.get(i) instanceof ListItem)) {
                 log.error("children of list-blocks must be list-items");
-                return new Status(Status.OK);
+                return Status.OK;
             }
-            ListItem listItem = (ListItem)children.elementAt(i);
-            Status status;
-            if ((status = listItem.layout(blockArea)).isIncomplete()) {
-                if (status.getCode() == Status.AREA_FULL_NONE && i > 0) {
-                    status = new Status(Status.AREA_FULL_SOME);
+            ListItem listItem = (ListItem)children.get(i);
+            int status;
+            if (Status.isIncomplete((status = listItem.layout(blockArea)))) {
+                if (status == Status.AREA_FULL_NONE && i > 0) {
+                    status = Status.AREA_FULL_SOME;
                 }
                 this.marker = i;
                 blockArea.end();
@@ -171,7 +171,7 @@
         }
 
         blockArea.isLast(true);
-        return new Status(Status.OK);
+        return Status.OK;
     }
 
 }
--- org__src\org\apache\fop\fo\flow\ListItem.java	Mon Oct 28 11:40:03 2002
+++ src\org\apache\fop\fo\flow\ListItem.java	Mon Oct 28 11:40:03 2002
@@ -49,7 +49,7 @@
         this.name = "fo:list-item";
     }
 
-    public Status layout(Area area) throws FOPException {
+    public int layout(Area area) throws FOPException {
         if (this.marker == START) {
 
             // Common Accessibility Properties
@@ -125,10 +125,10 @@
         if (numChildren != 2) {
             throw new FOPException("list-item must have exactly two children");
         }
-        ListItemLabel label = (ListItemLabel)children.elementAt(0);
-        ListItemBody body = (ListItemBody)children.elementAt(1);
+        ListItemLabel label = (ListItemLabel)children.get(0);
+        ListItemBody body = (ListItemBody)children.get(1);
 
-        Status status;
+        int status;
 
         // what follows doesn't yet take into account whether the
         // body failed completely or only got some text in
@@ -138,13 +138,13 @@
             area.getIDReferences().configureID(id, area);
 
             status = label.layout(blockArea);
-            if (status.isIncomplete()) {
+            if (Status.isIncomplete(status)) {
                 return status;
             }
         }
 
         status = body.layout(blockArea);
-        if (status.isIncomplete()) {
+        if (Status.isIncomplete(status)) {
             blockArea.end();
             area.addChild(blockArea);
             area.increaseHeight(blockArea.getHeight());
@@ -167,7 +167,7 @@
             area.start();
         }
         this.blockArea.isLast(true);
-        return new Status(Status.OK);
+        return Status.OK;
     }
 
     /**
--- org__src\org\apache\fop\fo\flow\ListItemBody.java	Mon Oct 28 11:40:04 2002
+++ src\org\apache\fop\fo\flow\ListItemBody.java	Mon Oct 28 11:40:03 2002
@@ -36,7 +36,7 @@
         this.name = "fo:list-item-body";
     }
 
-    public Status layout(Area area) throws FOPException {
+    public int layout(Area area) throws FOPException {
         if (this.marker == START) {
 
             // Common Accessibility Properties
@@ -60,19 +60,19 @@
 
         int numChildren = this.children.size();
         for (int i = this.marker; i < numChildren; i++) {
-            FObj fo = (FObj)children.elementAt(i);
+            FObj fo = (FObj)children.get(i);
 
-            Status status;
-            if ((status = fo.layout(area)).isIncomplete()) {
+            int status;
+            if (Status.isIncomplete((status = fo.layout(area)))) {
                 this.marker = i;
-                if ((i == 0) && (status.getCode() == Status.AREA_FULL_NONE)) {
-                    return new Status(Status.AREA_FULL_NONE);
+                if ((i == 0) && (status == Status.AREA_FULL_NONE)) {
+                    return Status.AREA_FULL_NONE;
                 } else {
-                    return new Status(Status.AREA_FULL_SOME);
+                    return Status.AREA_FULL_SOME;
                 }
             }
         }
-        return new Status(Status.OK);
+        return Status.OK;
     }
 
 }
--- org__src\org\apache\fop\fo\flow\ListItemLabel.java	Mon Oct 28 11:40:04 2002
+++ src\org\apache\fop\fo\flow\ListItemLabel.java	Mon Oct 28 11:40:04 2002
@@ -36,7 +36,7 @@
         this.name = "fo:list-item-label";
     }
 
-    public Status layout(Area area) throws FOPException {
+    public int layout(Area area) throws FOPException {
         int numChildren = this.children.size();
 
         if (numChildren != 1) {
@@ -53,7 +53,7 @@
         String id = this.properties.get("id").getString();
         area.getIDReferences().initializeID(id, area);
 
-        Block block = (Block)children.elementAt(0);
+        Block block = (Block)children.get(0);
 
         /*
          * For calculating the lineage - The fo:list-item-label formatting 
object
@@ -62,7 +62,7 @@
          * of areas returned by each of the children of the fo:list-item-label.
          */
 
-        Status status;
+        int status;
         status = block.layout(area);
         area.addDisplaySpace(-block.getAreaHeight());
         return status;
--- org__src\org\apache\fop\fo\flow\Marker.java	Mon Oct 28 11:40:04 2002
+++ src\org\apache\fop\fo\flow\Marker.java	Mon Oct 28 11:40:04 2002
@@ -51,31 +51,31 @@
         }
     }
 
-    public Status layout(Area area) throws FOPException {
+    public int layout(Area area) throws FOPException {
         // no layout action desired
         this.registryArea = area;
         area.addMarker(this);
         area.getPage().registerMarker(this);
         // System.out.println("Marker being registered in area '" + area 
+ "'");
-        return new Status(Status.OK);
+        return Status.OK;
     }
 
-    public Status layoutMarker(Area area) throws FOPException {
+    public int layoutMarker(Area area) throws FOPException {
         if (this.marker == START)
             this.marker = 0;
 
         int numChildren = this.children.size();
         for (int i = this.marker; i < numChildren; i++) {
-            FONode fo = (FONode)children.elementAt(i);
+            FONode fo = (FONode)children.get(i);
 
-            Status status;
-            if ((status = fo.layout(area)).isIncomplete()) {
+            int status;
+            if (Status.isIncomplete((status = fo.layout(area)))) {
                 this.marker = i;
                 return status;
             }
         }
 
-        return new Status(Status.OK);
+        return Status.OK;
     }
 
     public String getMarkerClassName() {
--- org__src\org\apache\fop\fo\flow\MultiCase.java	Mon Oct 28 11:40:04 2002
+++ src\org\apache\fop\fo\flow\MultiCase.java	Mon Oct 28 11:40:04 2002
@@ -9,7 +9,6 @@
 
 // FOP
 import org.apache.fop.fo.*;
-import org.apache.fop.fo.flow.*;
 import org.apache.fop.fo.properties.*;
 import org.apache.fop.layout.*;
 import org.apache.fop.apps.FOPException;
@@ -36,7 +35,7 @@
         this.name = "fo:multi-case";
     }
 
-    public Status layout(Area area) throws FOPException {
+    public int layout(Area area) throws FOPException {
 
         // Common Accessibility Properties
         AccessibilityProps mAccProps = propMgr.getAccessibilityProps();
--- org__src\org\apache\fop\fo\flow\MultiProperties.java	Mon Oct 28 
11:40:04 2002
+++ src\org\apache\fop\fo\flow\MultiProperties.java	Mon Oct 28 11:40:04 2002
@@ -9,7 +9,7 @@
 
 // FOP
 import org.apache.fop.fo.*;
-import org.apache.fop.fo.flow.*;
+//import org.apache.fop.fo.flow.*;
 import org.apache.fop.fo.properties.*;
 import org.apache.fop.layout.*;
 import org.apache.fop.apps.FOPException;
@@ -36,7 +36,7 @@
         this.name = "fo:multi-properties";
     }
 
-    public Status layout(Area area) throws FOPException {
+    public int layout(Area area) throws FOPException {
 
         // Common Accessibility Properties
         AccessibilityProps mAccProps = propMgr.getAccessibilityProps();
--- org__src\org\apache\fop\fo\flow\MultiPropertySet.java	Mon Oct 28 
11:40:04 2002
+++ src\org\apache\fop\fo\flow\MultiPropertySet.java	Mon Oct 28 11:40:04 2002
@@ -9,7 +9,7 @@
 
 // FOP
 import org.apache.fop.fo.*;
-import org.apache.fop.fo.flow.*;
+//import org.apache.fop.fo.flow.*;
 import org.apache.fop.fo.properties.*;
 import org.apache.fop.layout.*;
 import org.apache.fop.apps.FOPException;
@@ -36,7 +36,7 @@
         this.name = "fo:multi-property-set";
     }
 
-    public Status layout(Area area) throws FOPException {
+    public int layout(Area area) throws FOPException {
 
         // this.properties.get("id");
         // this.properties.get("active-state");
--- org__src\org\apache\fop\fo\flow\MultiSwitch.java	Mon Oct 28 11:40:05 2002
+++ src\org\apache\fop\fo\flow\MultiSwitch.java	Mon Oct 28 11:40:05 2002
@@ -9,7 +9,7 @@
 
 // FOP
 import org.apache.fop.fo.*;
-import org.apache.fop.fo.flow.*;
+//import org.apache.fop.fo.flow.*;
 import org.apache.fop.fo.properties.*;
 import org.apache.fop.layout.*;
 import org.apache.fop.apps.FOPException;
@@ -36,7 +36,7 @@
         this.name = "fo:multi-switch";
     }
 
-    public Status layout(Area area) throws FOPException {
+    public int layout(Area area) throws FOPException {
 
         // Common Accessibility Properties
         AccessibilityProps mAccProps = propMgr.getAccessibilityProps();
--- org__src\org\apache\fop\fo\flow\MultiToggle.java	Mon Oct 28 11:40:05 2002
+++ src\org\apache\fop\fo\flow\MultiToggle.java	Mon Oct 28 11:40:05 2002
@@ -9,7 +9,7 @@
 
 // FOP
 import org.apache.fop.fo.*;
-import org.apache.fop.fo.flow.*;
+//import org.apache.fop.fo.flow.*;
 import org.apache.fop.fo.properties.*;
 import org.apache.fop.layout.*;
 import org.apache.fop.apps.FOPException;
@@ -36,7 +36,7 @@
         this.name = "fo:multi-toggle";
     }
 
-    public Status layout(Area area) throws FOPException {
+    public int layout(Area area) throws FOPException {
 
         // Common Accessibility Properties
         AccessibilityProps mAccProps = propMgr.getAccessibilityProps();
--- org__src\org\apache\fop\fo\flow\PageNumber.java	Mon Oct 28 11:40:05 2002
+++ src\org\apache\fop\fo\flow\PageNumber.java	Mon Oct 28 11:40:05 2002
@@ -12,7 +12,7 @@
 import org.apache.fop.layout.*;
 import org.apache.fop.datatypes.*;
 import org.apache.fop.fo.properties.*;
-import org.apache.fop.layout.*;
+//import org.apache.fop.layout.*;
 import org.apache.fop.apps.FOPException;
 
 // Java
@@ -44,10 +44,10 @@
         this.name = "fo:page-number";
     }
 
-    public Status layout(Area area) throws FOPException {
+    public int layout(Area area) throws FOPException {
         if (!(area instanceof BlockArea)) {
             log.warn("page-number outside block area");
-            return new Status(Status.OK);
+            return Status.OK;
         }
         if (this.marker == START) {
 
@@ -108,7 +108,7 @@
                                      red, green, blue, wrapOption, null,
                                      whiteSpaceCollapse, p.toCharArray(), 0,
                                      p.length(), ts, VerticalAlign.BASELINE);
-        return new Status(Status.OK);
+        return Status.OK;
     }
 
 }
--- org__src\org\apache\fop\fo\flow\PageNumberCitation.java	Mon Oct 28 
11:40:06 2002
+++ src\org\apache\fop\fo\flow\PageNumberCitation.java	Mon Oct 28 11:40:06 2002
@@ -102,10 +102,10 @@
     }
 
 
-    public Status layout(Area area) throws FOPException {
+    public int layout(Area area) throws FOPException {
         if (!(area instanceof BlockArea)) {
             log.warn("page-number-citation outside block area");
-            return new Status(Status.OK);
+            return Status.OK;
         }
 
         IDReferences idReferences = area.getIDReferences();
@@ -190,7 +190,7 @@
             BlockArea blockArea = (BlockArea)area;
             LineArea la = blockArea.getCurrentLineArea();
             if (la == null) {
-                return new Status(Status.AREA_FULL_NONE);
+                return Status.AREA_FULL_NONE;
             }
             la.changeFont(propMgr.getFontState(area.getFontInfo()));
             la.changeColor(red, green, blue);
@@ -209,9 +209,9 @@
 
 
         if (this.marker == -1) {
-            return new Status(Status.OK);
+            return Status.OK;
         } else {
-            return new Status(Status.AREA_FULL_NONE);
+            return Status.AREA_FULL_NONE;
         }
 
     }
--- org__src\org\apache\fop\fo\flow\RetrieveMarker.java	Mon Oct 28 11:40:06 2002
+++ src\org\apache\fop\fo\flow\RetrieveMarker.java	Mon Oct 28 11:40:06 2002
@@ -47,7 +47,7 @@
             this.properties.get("retrieve-boundary").getEnum();
     }
 
-    public Status layout(Area area) throws FOPException {
+    public int layout(Area area) throws FOPException {
         // locate qualifying areas by 'marker-class-name' and
         // 'retrieve-boundary'. Initially we will always check
         // the containing page
@@ -72,7 +72,7 @@
             }
         }
 
-        Status status = new Status(Status.OK);
+        int status = Status.OK;
         if (null != bestMarker) {
             // System.out.println("Laying out marker '" + bestMarker + "' in 
area '" + area + "'");
             // the 'markers' referred to in this method are internal; they have
--- org__src\org\apache\fop\fo\flow\StaticContent.java	Mon Oct 28 11:40:06 2002
+++ src\org\apache\fop\fo\flow\StaticContent.java	Mon Oct 28 11:40:06 2002
@@ -37,12 +37,12 @@
         ((PageSequence)parent).setIsFlowSet(false);    // hacquery of sorts
     }
 
-    public Status layout(Area area) throws FOPException {
+    public int layout(Area area) throws FOPException {
         return layout(area, null);
     }
 
 
-    public Status layout(Area area, Region region) throws FOPException {
+    public int layout(Area area, Region region) throws FOPException {
 
         int numChildren = this.children.size();
         // Set area absolute height so that link rectangles will be drawn 
correctly in xsl-before and xsl-after
@@ -73,21 +73,21 @@
         setContentWidth(area.getContentWidth());
 
         for (int i = 0; i < numChildren; i++) {
-            FObj fo = (FObj)children.elementAt(i);
+            FObj fo = (FObj)children.get(i);
 
-            Status status;
-            if ((status = fo.layout(area)).isIncomplete()) {
+            int status;
+            if (Status.isIncomplete( (status = fo.layout(area)))) {
                 // in fact all should be laid out and clip, error etc 
depending on 'overflow'
                 log.warn("Some static content could not fit in the area.");
                 this.marker = i;
-                if ((i != 0) && (status.getCode() == Status.AREA_FULL_NONE)) {
-                    status = new Status(Status.AREA_FULL_SOME);
+                if ((i != 0) && (status == Status.AREA_FULL_NONE)) {
+                    status = Status.AREA_FULL_SOME;
                 }
                 return (status);
             }
         }
         resetMarker();
-        return new Status(Status.OK);
+        return Status.OK;
     }
 
     protected String getElementName() {
--- org__src\org\apache\fop\fo\flow\Table.java	Mon Oct 28 11:40:08 2002
+++ src\org\apache\fop\fo\flow\Table.java	Mon Oct 28 11:40:07 2002
@@ -15,8 +15,8 @@
 import org.apache.fop.apps.FOPException;
 
 // Java
-import java.util.Vector;
-import java.util.Enumeration;
+import java.util.ArrayList;
+import java.util.Iterator;
 
 public class Table extends FObj {
 
@@ -45,7 +45,7 @@
     boolean omitHeaderAtBreak = false;
     boolean omitFooterAtBreak = false;
 
-    Vector columns = new Vector();
+    ArrayList columns = new ArrayList();
     int bodyCount = 0;
     private boolean bAutoLayout=false;
     private int contentWidth = 0; // Sum of column widths
@@ -63,9 +63,9 @@
         this.name = "fo:table";
     }
 
-    public Status layout(Area area) throws FOPException {
+    public int layout(Area area) throws FOPException {
         if (this.marker == BREAK_AFTER) {
-            return new Status(Status.OK);
+            return Status.OK;
         }
 
         if (this.marker == START) {
@@ -140,15 +140,15 @@
             this.marker = 0;
 
             if (breakBefore == BreakBefore.PAGE) {
-                return new Status(Status.FORCE_PAGE_BREAK);
+                return Status.FORCE_PAGE_BREAK;
             }
 
             if (breakBefore == BreakBefore.ODD_PAGE) {
-                return new Status(Status.FORCE_PAGE_BREAK_ODD);
+                return Status.FORCE_PAGE_BREAK_ODD;
             }
 
             if (breakBefore == BreakBefore.EVEN_PAGE) {
-                return new Status(Status.FORCE_PAGE_BREAK_EVEN);
+                return Status.FORCE_PAGE_BREAK_EVEN;
             }
 
         }
@@ -196,32 +196,32 @@
         layoutColumns(areaContainer);
 
         for (int i = this.marker; i < numChildren; i++) {
-            FONode fo = (FONode)children.elementAt(i);
+            FONode fo = (FONode)children.get(i);
             if (fo instanceof TableHeader) {
                 if (columns.size() == 0) {
                     log.warn("current implementation of tables requires a 
table-column for each column, indicating column-width");
-                    return new Status(Status.OK);
+                    return Status.OK;
                 }
                 tableHeader = (TableHeader)fo;
                 tableHeader.setColumns(columns);
             } else if (fo instanceof TableFooter) {
                 if (columns.size() == 0) {
                     log.warn("current implementation of tables requires a 
table-column for each column, indicating column-width");
-                    return new Status(Status.OK);
+                    return Status.OK;
                 }
                 tableFooter = (TableFooter)fo;
                 tableFooter.setColumns(columns);
             } else if (fo instanceof TableBody) {
                 if (columns.size() == 0) {
                     log.warn("current implementation of tables requires a 
table-column for each column, indicating column-width");
-                    return new Status(Status.OK);
+                    return Status.OK;
                 }
-                Status status;
+                int status;
                 if (tableHeader != null &&!addedHeader) {
-                    if ((status =
-                                tableHeader.layout(areaContainer)).isIncomplete
()) {
+                    if (Status.isIncomplete((status =
+                                                 tableHeader.layout
(areaContainer)))) {
                         tableHeader.resetMarker();
-                        return new Status(Status.AREA_FULL_NONE);
+                        return Status.AREA_FULL_NONE;
                     }
                     addedHeader = true;
                     tableHeader.resetMarker();
@@ -230,9 +230,9 @@
                 }
                 if (tableFooter != null &&!this.omitFooterAtBreak
                         &&!addedFooter) {
-                    if ((status =
-                                tableFooter.layout(areaContainer)).isIncomplete
()) {
-                        return new Status(Status.AREA_FULL_NONE);
+                    if (Status.isIncomplete((status =
+                                                 tableFooter.layout
(areaContainer)))) {
+                        return Status.AREA_FULL_NONE;
                     }
                     addedFooter = true;
                     tableFooter.resetMarker();
@@ -241,10 +241,10 @@
                 fo.setOrphans(orphans);
                 ((TableBody)fo).setColumns(columns);
 
-                if ((status = fo.layout(areaContainer)).isIncomplete()) {
+                if (Status.isIncomplete((status = fo.layout(areaContainer)))) {
                     this.marker = i;
                     if (bodyCount == 0
-                            && status.getCode() == Status.AREA_FULL_NONE) {
+                            && status == Status.AREA_FULL_NONE) {
                         if (tableHeader != null)
                             tableHeader.removeLayout(areaContainer);
                         if (tableFooter != null)
@@ -268,7 +268,7 @@
                                                      + ((TableBody)
fo).getHeight());
                         }
                         setupColumnHeights();
-                        status = new Status(Status.AREA_FULL_SOME);
+                        status = Status.AREA_FULL_SOME;
                     }
                     return status;
                 } else {
@@ -287,7 +287,7 @@
         }
 
         if (tableFooter != null && this.omitFooterAtBreak) {
-            if (tableFooter.layout(areaContainer).isIncomplete()) {
+            if (Status.isIncomplete(tableFooter.layout(areaContainer))) {
                 // this is a problem since we need to remove a row
                 // from the last table body and place it on the
                 // next page so that it can have a footer at
@@ -302,7 +302,7 @@
                 }
                 tableFooter.removeLayout(areaContainer);
                 tableFooter.resetMarker();
-                return new Status(Status.AREA_FULL_SOME);
+                return Status.AREA_FULL_SOME;
             }
         }
 
@@ -329,26 +329,26 @@
 
         if (breakAfter == BreakAfter.PAGE) {
             this.marker = BREAK_AFTER;
-            return new Status(Status.FORCE_PAGE_BREAK);
+            return Status.FORCE_PAGE_BREAK;
         }
 
         if (breakAfter == BreakAfter.ODD_PAGE) {
             this.marker = BREAK_AFTER;
-            return new Status(Status.FORCE_PAGE_BREAK_ODD);
+            return Status.FORCE_PAGE_BREAK_ODD;
         }
 
         if (breakAfter == BreakAfter.EVEN_PAGE) {
             this.marker = BREAK_AFTER;
-            return new Status(Status.FORCE_PAGE_BREAK_EVEN);
+            return Status.FORCE_PAGE_BREAK_EVEN;
         }
 
-        return new Status(Status.OK);
+        return Status.OK;
     }
 
     protected void setupColumnHeights() {
-        Enumeration eCol = columns.elements();
-        while (eCol.hasMoreElements()) {
-            TableColumn c = (TableColumn)eCol.nextElement();
+        Iterator eCol = columns.iterator();
+        while (eCol.hasNext()) {
+            TableColumn c = (TableColumn)eCol.next();
             if ( c != null) {
                 c.setHeight(areaContainer.getContentHeight());
             }
@@ -357,9 +357,9 @@
 
     private void findColumns(Area areaContainer) throws FOPException {
         int nextColumnNumber = 1;
-        Enumeration e = children.elements();
-        while (e.hasMoreElements()) {
-            FONode fo = (FONode)e.nextElement();
+        Iterator e = children.iterator();
+        while (e.hasNext()) {
+            FONode fo = (FONode)e.next();
             if (fo instanceof TableColumn) {
                 TableColumn c = (TableColumn)fo;
                 c.doSetup(areaContainer);
@@ -371,14 +371,15 @@
 
                 for (int j = 0; j < numColumnsRepeated; j++) {
                     if (currentColumnNumber > columns.size()) {
-                        columns.setSize(currentColumnNumber);
+                        columns.ensureCapacity(currentColumnNumber);
                     }
-                    if (columns.elementAt(currentColumnNumber - 1) != null) {
+                    if (currentColumnNumber -1 < columns.size() &&
+                            columns.get(currentColumnNumber - 1) != null) {
                         log.warn("More than one column object assigned " +
                                  "to column " +
                                  currentColumnNumber);
                     }
-                    columns.setElementAt(c, currentColumnNumber - 1);
+                    columns.add(currentColumnNumber - 1, c);
                     currentColumnNumber++;
                 }
                 nextColumnNumber = currentColumnNumber;
@@ -396,9 +397,9 @@
         double dWidthFactor = 0.0;
         double dUnitLength = 0.0;
         double tuMin = 100000.0 ; // Minimum number of proportional units
-        Enumeration eCol = columns.elements();
-        while (eCol.hasMoreElements()) {
-            TableColumn c = (TableColumn)eCol.nextElement();
+        Iterator eCol = columns.iterator();
+        while (eCol.hasNext()) {
+            TableColumn c = (TableColumn)eCol.next();
             if (c == null) {
                 log.warn("No table-column specification for column " +
                          nextColumnNumber);
@@ -463,9 +464,9 @@
         }
         // Now distribute the extra units onto each column and set offsets
         int offset = 0;
-        eCol = columns.elements();
-        while (eCol.hasMoreElements()) {
-            TableColumn c = (TableColumn)eCol.nextElement();
+        eCol = columns.iterator();
+        while (eCol.hasNext()) {
+            TableColumn c = (TableColumn)eCol.next();
             if (c != null) {
                 c.setColumnOffset(offset);
                 Length l = c.getColumnWidthAsLength();
@@ -489,9 +490,9 @@
     }
 
     private void layoutColumns(Area tableArea) throws FOPException  {
-        Enumeration eCol = columns.elements();
-        while (eCol.hasMoreElements()) {
-            TableColumn c = (TableColumn)eCol.nextElement();
+        Iterator eCol = columns.iterator();
+        while (eCol.hasNext()) {
+            TableColumn c = (TableColumn)eCol.next();
             if (c != null) {
                 c.layout(tableArea);
             }
--- org__src\org\apache\fop\fo\flow\TableAndCaption.java	Mon Oct 28 
11:40:08 2002
+++ src\org\apache\fop\fo\flow\TableAndCaption.java	Mon Oct 28 11:40:08 2002
@@ -9,7 +9,7 @@
 
 // FOP
 import org.apache.fop.fo.*;
-import org.apache.fop.fo.flow.*;
+//import org.apache.fop.fo.flow.*;
 import org.apache.fop.fo.properties.*;
 import org.apache.fop.layout.*;
 import org.apache.fop.apps.FOPException;
@@ -36,7 +36,7 @@
         this.name = "fo:table-and-caption";
     }
 
-    public Status layout(Area area) throws FOPException {
+    public int layout(Area area) throws FOPException {
 
         // Common Accessibility Properties
         AccessibilityProps mAccProps = propMgr.getAccessibilityProps();
--- org__src\org\apache\fop\fo\flow\TableBody.java	Mon Oct 28 11:40:08 2002
+++ src\org\apache\fop\fo\flow\TableBody.java	Mon Oct 28 11:40:08 2002
@@ -15,8 +15,8 @@
 import org.apache.fop.apps.FOPException;
 
 // Java
-import java.util.Vector;
-import java.util.Enumeration;
+import java.util.Iterator;
+import java.util.ArrayList;
 
 public class TableBody extends FObj {
 
@@ -36,7 +36,7 @@
     int spaceAfter;
     String id;
 
-    Vector columns;
+    ArrayList columns;
     RowSpanMgr rowSpanMgr;    // manage information about spanning rows
 
     AreaContainer areaContainer;
@@ -46,7 +46,7 @@
         this.name = "fo:table-body";
     }
 
-    public void setColumns(Vector columns) {
+    public void setColumns(ArrayList columns) {
         this.columns = columns;
     }
 
@@ -62,9 +62,9 @@
         return areaContainer.getHeight() + spaceBefore + spaceAfter;
     }
 
-    public Status layout(Area area) throws FOPException {
+    public int layout(Area area) throws FOPException {
         if (this.marker == BREAK_AFTER) {
-            return new Status(Status.OK);
+            return Status.OK;
         }
 
         if (this.marker == START) {
@@ -140,12 +140,12 @@
         areaContainer.setAbsoluteHeight(area.getAbsoluteHeight());
         areaContainer.setIDReferences(area.getIDReferences());
 
-        Vector keepWith = new Vector();
+        ArrayList keepWith = new ArrayList();
         int numChildren = this.children.size();
         TableRow lastRow = null;
         boolean endKeepGroup = true;
         for (int i = this.marker; i < numChildren; i++) {
-            Object child = children.elementAt(i);
+            Object child = children.get(i);
             if (!(child instanceof TableRow)) {
                 throw new FOPException("Currently only Table Rows are 
supported in table body, header and footer");
             }
@@ -158,17 +158,17 @@
                     != KeepValue.KEEP_WITH_AUTO && lastRow != null
                     && keepWith.indexOf(lastRow)
                     == -1) {
-                keepWith.addElement(lastRow);
+                keepWith.add(lastRow);
             } else {
                 if (endKeepGroup && keepWith.size() > 0) {
-                    keepWith = new Vector();
+                    keepWith = new ArrayList();
                 }
             }
 
-            Status status;
-            if ((status = row.layout(areaContainer)).isIncomplete()) {
+            int status;
+            if (Status.isIncomplete((status = row.layout(areaContainer)))) {
                 // BUG!!! don't distinguish between break-before and after!
-                if (status.isPageBreak()) {
+                if (Status.isPageBreak(status)) {
                     this.marker = i;
                     area.addChild(areaContainer);
                     // areaContainer.end();
@@ -188,9 +188,9 @@
                     // && status.getCode() == Status.AREA_FULL_NONE
                     // FIXME!!! Handle rows spans!!!
                     row.removeLayout(areaContainer);
-                    for (Enumeration e = keepWith.elements();
-                            e.hasMoreElements(); ) {
-                        TableRow tr = (TableRow)e.nextElement();
+                    for (Iterator e = keepWith.iterator();
+                            e.hasNext(); ) {
+                        TableRow tr = (TableRow)e.next();
                         tr.removeLayout(areaContainer);
                         i--;
                     }
@@ -200,12 +200,12 @@
                         // Fix for infinite loop bug if keeps are too big for 
page
                         rowSpanMgr.setIgnoreKeeps(true);
 
-                        return new Status(Status.AREA_FULL_NONE);
+                        return Status.AREA_FULL_NONE;
                     }
                 }
                 this.marker = i;
-                if ((i != 0) && (status.getCode() == Status.AREA_FULL_NONE)) {
-                    status = new Status(Status.AREA_FULL_SOME);
+                if ((i != 0) && (status == Status.AREA_FULL_NONE)) {
+                    status = Status.AREA_FULL_SOME;
                 }
                 if (!((i == 0) && (areaContainer.getContentHeight() <= 0))) {
                     area.addChild(areaContainer);
@@ -219,9 +219,9 @@
                 rowSpanMgr.setIgnoreKeeps(true);
 
                 return status;
-            } else if (status.getCode() == Status.KEEP_WITH_NEXT
+            } else if (status == Status.KEEP_WITH_NEXT
                        || rowSpanMgr.hasUnfinishedSpans()) {
-                keepWith.addElement(row);
+                keepWith.add(row);
                 endKeepGroup = false;
             } else {
                 endKeepGroup = true;
@@ -247,7 +247,7 @@
             area.start();
         }
 
-        return new Status(Status.OK);
+        return Status.OK;
     }
 
     public void removeLayout(Area area) {
--- org__src\org\apache\fop\fo\flow\TableCaption.java	Mon Oct 28 11:40:08 2002
+++ src\org\apache\fop\fo\flow\TableCaption.java	Mon Oct 28 11:40:08 2002
@@ -9,7 +9,7 @@
 
 // FOP
 import org.apache.fop.fo.*;
-import org.apache.fop.fo.flow.*;
+//import org.apache.fop.fo.flow.*;
 import org.apache.fop.fo.properties.*;
 import org.apache.fop.layout.*;
 import org.apache.fop.apps.FOPException;
@@ -36,7 +36,7 @@
         this.name = "fo:table-caption";
     }
 
-    public Status layout(Area area) throws FOPException {
+    public int layout(Area area) throws FOPException {
 
         // Common Accessibility Properties
         AccessibilityProps mAccProps = propMgr.getAccessibilityProps();
--- org__src\org\apache\fop\fo\flow\TableCell.java	Mon Oct 28 11:40:09 2002
+++ src\org\apache\fop\fo\flow\TableCell.java	Mon Oct 28 11:40:08 2002
@@ -193,10 +193,10 @@
     }
 
 
-    public Status layout(Area area) throws FOPException {
+    public int layout(Area area) throws FOPException {
         int originalAbsoluteHeight = area.getAbsoluteHeight();
         if (this.marker == BREAK_AFTER) {
-            return new Status(Status.OK);
+            return Status.OK;
         }
 
         if (this.marker == START) {
@@ -253,7 +253,7 @@
 
         int numChildren = this.children.size();
         for (int i = this.marker; bDone==false && i < numChildren; i++) {
-            FObj fo = (FObj)children.elementAt(i);
+            FObj fo = (FObj)children.get(i);
             fo.setIsInTableCell();
             fo.forceWidth(width);    // ???
 
@@ -261,16 +261,16 @@
             // need to pass already processed content.
             this.marker = i;
 
-            Status status;
-            if ((status = fo.layout(cellArea)).isIncomplete()) {
+            int status;
+            if (Status.isIncomplete((status = fo.layout(cellArea)))) {
                 // this.marker = i;
-                if ((i == 0) && (status.getCode() == Status.AREA_FULL_NONE)) {
-                    return new Status(Status.AREA_FULL_NONE);
+                if ((i == 0) && (status == Status.AREA_FULL_NONE)) {
+                    return Status.AREA_FULL_NONE;
                 } else {
                     // hani Elabed 11/21/2000
                     area.addChild(cellArea);
                     // area.setAbsoluteHeight(cellArea.getAbsoluteHeight());
-                    return new Status(Status.AREA_FULL_SOME);
+                    return Status.AREA_FULL_SOME;
                 }
             }
 
@@ -298,7 +298,7 @@
         // area.setHeight(cellArea.getHeight());
         // area.setAbsoluteHeight(originalAbsoluteHeight);
 
-        return new Status(Status.OK);
+        return Status.OK;
     }
 
     /**
--- org__src\org\apache\fop\fo\flow\TableColumn.java	Mon Oct 28 11:40:09 2002
+++ src\org\apache\fop\fo\flow\TableColumn.java	Mon Oct 28 11:40:09 2002
@@ -98,9 +98,9 @@
         setup = true;
     }
 
-    public Status layout(Area area) throws FOPException {
+    public int layout(Area area) throws FOPException {
         if (this.marker == BREAK_AFTER) {
-            return new Status(Status.OK);
+            return Status.OK;
         }
 
         if (this.marker == START) {
@@ -120,7 +120,7 @@
             areaContainer.setHeight(area.getHeight());
             area.addChild(areaContainer);
         }
-        return new Status(Status.OK);
+        return Status.OK;
     }
 
     public void setColumnOffset(int columnOffset) {
--- org__src\org\apache\fop\fo\flow\TableRow.java	Mon Oct 28 11:40:10 2002
+++ src\org\apache\fop\fo\flow\TableRow.java	Mon Oct 28 11:40:09 2002
@@ -15,8 +15,8 @@
 import org.apache.fop.apps.FOPException;
 
 // Java
-import java.util.Vector;
-import java.util.Enumeration;
+import java.util.ArrayList;
+import java.util.Iterator;
 
 public class TableRow extends FObj {
 
@@ -44,7 +44,7 @@
     int widthOfCellsSoFar = 0;
     int largestCellHeight = 0;
     int minHeight = 0;    // force row height
-    Vector columns;
+    ArrayList columns;
 
     AreaContainer areaContainer;
 
@@ -129,7 +129,7 @@
             return rslt;
         }
 
-        // private class EnumCells implements Enumeration {
+        // private class EnumCells implements Iterator {
         // private int iNextIndex=0;
         // private Object nextCell = null;
         // EnumCells() {
@@ -161,11 +161,11 @@
         // }
 
         // /**
-        // * Return an enumeration over all cells in this row
+        // * Return an Iterator over all cells in this row
         // * Return each element in cells whose state is CELLSTART or EMPTY?
         // * Skip spanning elements.
         // */
-        // Enumeration getCells() {
+        // Iterator getCells() {
         // return new EnumCells();
         // }
     }
@@ -176,7 +176,7 @@
         this.name = "fo:table-row";
     }
 
-    public void setColumns(Vector columns) {
+    public void setColumns(ArrayList columns) {
         this.columns = columns;
     }
 
@@ -240,11 +240,11 @@
         }
     }
 
-    public Status layout(Area area) throws FOPException {
+    public int layout(Area area) throws FOPException {
         boolean configID = false;
 
         if (this.marker == BREAK_AFTER) {
-            return new Status(Status.OK);
+            return Status.OK;
         }
 
         // Layout the first area for this FO
@@ -265,7 +265,7 @@
             this.marker = 0;
             int breakStatus = propMgr.checkBreakBefore(area);
             if (breakStatus != Status.OK)
-                return new Status(breakStatus);
+                return breakStatus;
         }
 
         // if (marker == 0 && configID) {
@@ -302,7 +302,7 @@
          */
         int offset = 0;       // Offset of each cell from table start edge
         int iColIndex = 0;    // 1-based column index
-        Enumeration eCols = columns.elements();
+        Iterator eCols = columns.iterator();
         /*
          * Ideas: set offset on each column when they are initialized
          * no need to calculate for each row.
@@ -310,10 +310,10 @@
          * info if borders are "collapsed".
          */
 
-        while (eCols.hasMoreElements()) {
+        while (eCols.hasNext()) {
             TableCell cell;
             ++iColIndex;
-            TableColumn tcol = (TableColumn)eCols.nextElement();
+            TableColumn tcol = (TableColumn)eCols.next();
             int colWidth = tcol.getColumnWidth();
             if (cellArray.getCellType(iColIndex) == CellArray.CELLSTART) {
                 cell = cellArray.getCell(iColIndex);
@@ -337,10 +337,10 @@
 
 
             int rowSpan = cell.getNumRowsSpanned();
-            Status status;
-            if ((status = cell.layout(areaContainer)).isIncomplete()) {
+            int status;
+            if (Status.isIncomplete((status = cell.layout(areaContainer)))) {
                 if ((keepTogether.getType() == KeepValue.KEEP_WITH_ALWAYS)
-                        || (status.getCode() == Status.AREA_FULL_NONE)
+                        || (status == Status.AREA_FULL_NONE)
                         || rowSpan > 1) {
                     // We will put this row into the next column/page
                     // Note: the only time this shouldn't be honored is
@@ -348,8 +348,8 @@
                     // Remove spanning cells from RowSpanMgr?
                     this.resetMarker();
                     this.removeID(area.getIDReferences());
-                    return new Status(Status.AREA_FULL_NONE);
-                } else if (status.getCode() == Status.AREA_FULL_SOME) {
+                    return Status.AREA_FULL_NONE;
+                } else if (status == Status.AREA_FULL_SOME) {
                     /*
                      * Row is not keep-together, cell isn't spanning
                      * and part of it fits. We can break the cell and
@@ -415,35 +415,35 @@
         // return new Status(Status.OK);
 
         if (someCellDidNotLayoutCompletely) {
-            return new Status(Status.AREA_FULL_SOME);
+            return Status.AREA_FULL_SOME;
         } else {
             if (rowSpanMgr.hasUnfinishedSpans()) {
                 // Ignore break after if row span!
-                return new Status(Status.KEEP_WITH_NEXT);
+                return Status.KEEP_WITH_NEXT;
             }
             if (breakAfter == BreakAfter.PAGE) {
                 this.marker = BREAK_AFTER;
-                return new Status(Status.FORCE_PAGE_BREAK);
+                return Status.FORCE_PAGE_BREAK;
             }
 
             if (breakAfter == BreakAfter.ODD_PAGE) {
                 this.marker = BREAK_AFTER;
-                return new Status(Status.FORCE_PAGE_BREAK_ODD);
+                return Status.FORCE_PAGE_BREAK_ODD;
             }
 
             if (breakAfter == BreakAfter.EVEN_PAGE) {
                 this.marker = BREAK_AFTER;
-                return new Status(Status.FORCE_PAGE_BREAK_EVEN);
+                return Status.FORCE_PAGE_BREAK_EVEN;
             }
 
             if (breakAfter == BreakAfter.COLUMN) {
                 this.marker = BREAK_AFTER;
-                return new Status(Status.FORCE_COLUMN_BREAK);
+                return Status.FORCE_COLUMN_BREAK;
             }
             if (keepWithNext.getType() != KeepValue.KEEP_WITH_AUTO) {
-                return new Status(Status.KEEP_WITH_NEXT);
+                return Status.KEEP_WITH_NEXT;
             }
-            return new Status(Status.OK);
+            return Status.OK;
         }
 
     }
@@ -481,13 +481,13 @@
     private void initCellArray() {
         cellArray = new CellArray(rowSpanMgr, columns.size());
         int colNum = 1;
-        Enumeration eCells = children.elements();
-        while (eCells.hasMoreElements()) {
+        Iterator eCells = children.iterator();
+        while (eCells.hasNext()) {
             colNum = cellArray.getNextFreeCell(colNum);
             // If off the end, the rest of the cells had better be
             // explicitly positioned!!! (returns -1)
 
-            TableCell cell = (TableCell)eCells.nextElement();
+            TableCell cell = (TableCell)eCells.next();
             int numCols = cell.getNumColumnsSpanned();
             int numRows = cell.getNumRowsSpanned();
             int cellColNum = cell.getColumnNumber();
@@ -532,8 +532,8 @@
     private int getCellWidth(int startCol, int numCols) {
         int width = 0;
         for (int count = 0; count < numCols; count++) {
-            width += ((TableColumn)columns.elementAt(startCol + count
-                      - 1)).getColumnWidth();
+            width += ((TableColumn)columns.get(startCol + count
+                                               - 1)).getColumnWidth();
         }
         return width;
     }
--- org__src\org\apache\fop\fo\flow\Wrapper.java	Mon Oct 28 11:40:10 2002
+++ src\org\apache\fop\fo\flow\Wrapper.java	Mon Oct 28 11:40:10 2002
@@ -43,7 +43,7 @@
     protected void addCharacters(char data[], int start, int length) {
         FOText ft = new FOText(data, start, length, this);
         ft.setLogger(log);
-        children.addElement(ft);
+        children.add(ft);
     }
 
 }
--- org__src\org\apache\fop\fo\pagination\PageSequence.java	Mon Oct 28 
11:40:12 2002
+++ src\org\apache\fop\fo\pagination\PageSequence.java	Mon Oct 28 11:40:11 2002
@@ -169,7 +169,8 @@
         } else {
             pageNumberType = EXPLICIT;
             try {
-                int pageStart = new Integer(ipnValue).intValue();
+                int pageStart = Integer.parseInt( ipnValue);
+
                 this.currentPageNumber = (pageStart > 0) ? pageStart - 1 : 0;
             } catch (NumberFormatException nfe) {
                 throw new FOPException("\"" + ipnValue
@@ -214,7 +215,7 @@
      */
     public void format(AreaTree areaTree) throws FOPException {
 
-        Status status = new Status(Status.OK);
+        int status = Status.OK;
 
         this.layoutMasterSet.resetPageMasters();
 
@@ -254,10 +255,10 @@
             // compute flag for 'blank-or-not-blank'
             boolean isEmptyPage = false;
 
-            if ((status.getCode() == Status.FORCE_PAGE_BREAK_EVEN)
+            if ((status == Status.FORCE_PAGE_BREAK_EVEN)
                     && ((currentPageNumber % 2) == 1)) {
                 isEmptyPage = true;
-            } else if ((status.getCode() == Status.FORCE_PAGE_BREAK_ODD)
+            } else if ((status == Status.FORCE_PAGE_BREAK_ODD)
                        && ((currentPageNumber % 2) == 0)) {
                 isEmptyPage = true;
             } else {
@@ -275,9 +276,9 @@
 
             log.info("[" + currentPageNumber + "]");
 
-            if ((status.getCode() == Status.FORCE_PAGE_BREAK_EVEN)
+            if ((status == Status.FORCE_PAGE_BREAK_EVEN)
                 && ((currentPageNumber % 2) == 1)) {}
-            else if ((status.getCode() == Status.FORCE_PAGE_BREAK_ODD)
+            else if ((status == Status.FORCE_PAGE_BREAK_ODD)
                  && ((currentPageNumber % 2) == 0)) {}
             else {
                 BodyAreaContainer bodyArea = currentPage.getBody();
@@ -549,8 +550,8 @@
                 continue;
             }
 
-            Status status = flow.getStatus();
-            isIncomplete |= status.isIncomplete();
+            int status = flow.getStatus();
+            isIncomplete |= Status.isIncomplete(status);
         }
         return isIncomplete;
     }
@@ -589,7 +590,7 @@
 
 
             Flow flow = (Flow)_flowMap.get(region.getRegionName());
-            if ((null == flow) || flow.getStatus().isIncomplete())
+            if ((null == flow) || Status.isIncomplete(flow.getStatus()))
                 return false;
             else
                 return true;
--- org__src\org\apache\fop\fo\pagination\RegionBody.java	Mon Oct 28 
11:40:13 2002
+++ src\org\apache\fop\fo\pagination\RegionBody.java	Mon Oct 28 11:40:13 2002
@@ -76,7 +76,11 @@
             this.properties.get("column-count").getString();
         int columnCount = 1;
         try {
-            columnCount = Integer.parseInt(columnCountAsString);
+            if( columnCountAsString.charAt(0) >= '0' && 
columnCountAsString.charAt(0)<= '9') {
+                columnCount = Integer.parseInt(columnCountAsString);
+            } else {
+                log.error("Bad value on region body 'column-count'");
+            }
         } catch (NumberFormatException nfe) {
             log.error("Bad value on region body 'column-count'");
             columnCount = 1;
--- org__src\org\apache\fop\image\analyser\ImageReaderFactory.java	Mon Oct 
28 11:40:24 2002
+++ src\org\apache\fop\image\analyser\ImageReaderFactory.java	Mon Oct 28 
11:40:24 2002
@@ -11,8 +11,8 @@
 import java.io.InputStream;
 import java.io.BufferedInputStream;
 import java.io.IOException;
-import java.util.Enumeration;
-import java.util.Vector;
+import java.util.Iterator;
+import java.util.ArrayList;
 
 // FOP
 import org.apache.fop.image.FopImageException;
@@ -23,7 +23,7 @@
  * @version 1.0
  */
 public class ImageReaderFactory {
-    static protected Vector formats = null;
+    static protected ArrayList formats = null;
 
     /**
      * ImageReader maker.
@@ -36,22 +36,22 @@
                                    InputStream in) throws FopImageException {
 
         // need to use a config file and remove static methods
-        formats = new Vector();
-        formats.addElement(new JPEGReader());
-        formats.addElement(new BMPReader());
-        formats.addElement(new GIFReader());
-        formats.addElement(new PNGReader());
-        formats.addElement(new TIFFReader());
-        formats.addElement(new EPSReader());
-        formats.addElement(new SVGReader());
+        formats = new ArrayList();
+        formats.add(new JPEGReader());
+        formats.add(new BMPReader());
+        formats.add(new GIFReader());
+        formats.add(new PNGReader());
+        formats.add(new TIFFReader());
+        formats.add(new EPSReader());
+        formats.add(new SVGReader());
         //
 
         ImageReader reader;
         BufferedInputStream bis = new BufferedInputStream(in);
-        Enumeration itr = formats.elements();
+        Iterator itr = formats.iterator();
         try {
-            while (itr.hasMoreElements()) {
-                reader = (ImageReader)itr.nextElement();
+            while (itr.hasNext()) {
+                reader = (ImageReader)itr.next();
                 if (reader.verifySignature(uri, bis)) {
                     return reader;
                 }
--- org__src\org\apache\fop\layout\Area.java	Mon Oct 28 11:40:26 2002
+++ src\org\apache\fop\layout\Area.java	Mon Oct 28 11:40:26 2002
@@ -13,8 +13,8 @@
 import org.apache.fop.layout.inline.InlineSpace;
 
 // Java
-import java.util.Vector;
-import java.util.Hashtable;
+import java.util.ArrayList;
+import java.util.HashMap;
 
 abstract public class Area extends Box {
 
@@ -25,7 +25,7 @@
     protected FontState fontState;
     protected BorderAndPadding bp = null;
 
-    protected Vector children = new Vector();
+    protected ArrayList children = new ArrayList();
 
     /* max size in line-progression-direction */
     protected int maxHeight;
@@ -52,11 +52,11 @@
 
     private IDReferences idReferences;
 
-    protected Vector markers;
+    protected ArrayList markers;
 
     // as defined in Section 6.1.1
     protected org.apache.fop.fo.FObj generatedBy;    // corresponds 
to 'generated-by' trait
-    protected Hashtable returnedBy;
+    //protected HashMap returnedBy;
 
     // as defined in Section 6.1.1
     protected String areaClass;
@@ -75,8 +75,8 @@
 
     public Area(FontState fontState) {
         setFontState(fontState);
-        this.markers = new Vector();
-        this.returnedBy = new Hashtable();
+        this.markers = new ArrayList();
+        // this.returnedBy = new HashMap();
     }
 
     /**
@@ -93,8 +93,8 @@
         this.allocationWidth = allocationWidth;
         this.contentRectangleWidth = allocationWidth;
         this.maxHeight = maxHeight;
-        this.markers = new Vector();
-        this.returnedBy = new Hashtable();
+        this.markers = new ArrayList();
+        // this.returnedBy = new HashMap();
     }
 
     private void setFontState(FontState fontState) {
@@ -103,12 +103,12 @@
     }
 
     public void addChild(Box child) {
-        this.children.addElement(child);
+        this.children.add(child);
         child.parent = this;
     }
 
     public void addChildAtStart(Box child) {
-        this.children.insertElementAt(child, 0);
+        this.children.add(0,child);
         child.parent = this;
     }
 
@@ -151,7 +151,7 @@
         this.contentRectangleWidth = this.allocationWidth;
     }
 
-    public Vector getChildren() {
+    public ArrayList getChildren() {
         return this.children;
     }
 
@@ -274,13 +274,13 @@
     public void removeChild(Area area) {
         this.currentHeight -= area.getHeight();
         this.absoluteHeight -= area.getHeight();
-        this.children.removeElement(area);
+        this.children.remove(area);
     }
 
     public void removeChild(DisplaySpace spacer) {
         this.currentHeight -= spacer.getSize();
         this.absoluteHeight -= spacer.getSize();
-        this.children.removeElement(spacer);
+        this.children.remove(spacer);
     }
 
     public void remove
@@ -373,18 +373,18 @@
     }
 
     public void addMarker(Marker marker) {
-        markers.addElement(marker);
+        markers.add(marker);
     }
 
-    public void addMarkers(Vector markers) {
+    public void addMarkers(ArrayList markers) {
         markers.addAll(markers);
     }
 
     public void addLineagePair(org.apache.fop.fo.FObj fo, int areaPosition) {
-        returnedBy.put(fo, new Integer(areaPosition));
+        // returnedBy.put(fo, new Integer(areaPosition));
     }
 
-    public Vector getMarkers() {
+    public ArrayList getMarkers() {
         return markers;
     }
 
--- org__src\org\apache\fop\layout\BodyAreaContainer.java	Mon Oct 28 
11:40:31 2002
+++ src\org\apache\fop\layout\BodyAreaContainer.java	Mon Oct 28 11:40:31 2002
@@ -17,8 +17,8 @@
 import org.apache.fop.fo.flow.BlockContainer;
 
 // Java
-import java.util.Vector;
-import java.util.Enumeration;
+import java.util.ArrayList;
+import java.util.Iterator;
 
 public class BodyAreaContainer extends Area {
 
@@ -165,8 +165,8 @@
                 return addSpanArea(columnCount);
         }
 
-        Vector spanAreas = this.mainReferenceArea.getChildren();
-        SpanArea spanArea = (SpanArea)spanAreas.elementAt(spanAreas.size()
+        ArrayList spanAreas = this.mainReferenceArea.getChildren();
+        SpanArea spanArea = (SpanArea)spanAreas.get(spanAreas.size()
                             - 1);
 
         if ((span == Span.ALL) && (spanArea.getColumnCount() == 1)) {
@@ -220,8 +220,8 @@
         if (this.mainReferenceArea.getChildren().isEmpty())
             return false;
 
-        Vector spanAreas = this.mainReferenceArea.getChildren();
-        SpanArea spanArea = (SpanArea)spanAreas.elementAt(spanAreas.size()
+        ArrayList spanAreas = this.mainReferenceArea.getChildren();
+        SpanArea spanArea = (SpanArea)spanAreas.get(spanAreas.size()
                             - 1);
 
         if (spanArea.isBalanced())
@@ -255,8 +255,8 @@
      * one added with the computed max height.
      */
     public void resetSpanArea() {
-        Vector spanAreas = this.mainReferenceArea.getChildren();
-        SpanArea spanArea = (SpanArea)spanAreas.elementAt(spanAreas.size()
+        ArrayList spanAreas = this.mainReferenceArea.getChildren();
+        SpanArea spanArea = (SpanArea)spanAreas.get(spanAreas.size()
                             - 1);
 
         if (!spanArea.isBalanced()) {
@@ -299,9 +299,9 @@
      */
     private void resetHeights() {
         int totalHeight = 0;
-        for (Enumeration e = this.mainReferenceArea.getChildren().elements();
-                e.hasMoreElements(); ) {
-            SpanArea spanArea = (SpanArea)e.nextElement();
+        for (Iterator e = this.mainReferenceArea.getChildren().iterator();
+                e.hasNext(); ) {
+            SpanArea spanArea = (SpanArea)e.next();
             int spanContentHeight = spanArea.getMaxContentHeight();
             int spanMaxHeight = spanArea.getMaxHeight();
 
@@ -316,8 +316,8 @@
      * @returns boolean Is this the last column in this span?
      */
     public boolean isLastColumn() {
-        Vector spanAreas = this.mainReferenceArea.getChildren();
-        SpanArea spanArea = (SpanArea)spanAreas.elementAt(spanAreas.size()
+        ArrayList spanAreas = this.mainReferenceArea.getChildren();
+        SpanArea spanArea = (SpanArea)spanAreas.get(spanAreas.size()
                             - 1);
         return spanArea.isLastColumn();
     }
@@ -332,8 +332,8 @@
     }
 
     public AreaContainer getCurrentColumnArea() {
-        Vector spanAreas = this.mainReferenceArea.getChildren();
-        SpanArea spanArea = (SpanArea)spanAreas.elementAt(spanAreas.size()
+        ArrayList spanAreas = this.mainReferenceArea.getChildren();
+        SpanArea spanArea = (SpanArea)spanAreas.get(spanAreas.size()
                             - 1);
         return spanArea.getCurrentColumnArea();
     }
@@ -366,9 +366,9 @@
             footnoteYPosition = footnoteReferenceArea.getYPosition();
             footnoteReferenceArea.setMaxHeight(footnoteReferenceArea.getHeight
());
 
-            Vector childs = footnoteReferenceArea.getChildren();
-            for (Enumeration en = childs.elements(); en.hasMoreElements(); ) {
-                Object obj = en.nextElement();
+            ArrayList childs = footnoteReferenceArea.getChildren();
+            for (Iterator en = childs.iterator(); en.hasNext(); ) {
+                Object obj = en.next();
                 if (obj instanceof Area) {
                     Area childArea = (Area)obj;
                     footnoteReferenceArea.removeChild(childArea);
@@ -381,9 +381,9 @@
 
     protected static void resetMaxHeight(Area ar, int change) {
         ar.setMaxHeight(change);
-        Vector childs = ar.getChildren();
-        for (Enumeration en = childs.elements(); en.hasMoreElements(); ) {
-            Object obj = en.nextElement();
+        ArrayList childs = ar.getChildren();
+        for (Iterator en = childs.iterator(); en.hasNext(); ) {
+            Object obj = en.next();
             if (obj instanceof Area) {
                 Area childArea = (Area)obj;
                 resetMaxHeight(childArea, change);
--- org__src\org\apache\fop\layout\BorderAndPadding.java	Mon Oct 28 
11:40:32 2002
+++ src\org\apache\fop\layout\BorderAndPadding.java	Mon Oct 28 11:40:32 2002
@@ -16,35 +16,25 @@
     public static final int RIGHT = 1;
     public static final int BOTTOM = 2;
     public static final int LEFT = 3;
-
-    private static class ResolvedCondLength implements Cloneable {
-        int iLength;    // Resolved length value
-        boolean bDiscard;
-
-        ResolvedCondLength(CondLength length) {
-            bDiscard = length.isDiscard();
-            iLength = length.mvalue();
-        }
-
-        public Object clone() throws CloneNotSupportedException {
-            return super.clone();
-        }
-
+    //ResolvedCondLength is long, mask wiht 0x100000000 != 0 is bDiscard
+    //	mask wiht 0xFFFFFFFF is iLength
+    static final long bDiscard_MASK = 0x100000000L;
+    static final long iLength_MASK = 0xFFFFFFFFL;
+    private static final long new_ResolvedCondLength(CondLength length) {
+        return (length.isDiscard()?bDiscard_MASK:0) + length.mvalue();
     }
 
     /**
-     * Return a full copy of the BorderAndPadding information. This clones all
-     * padding and border information.
-     * @return The copy.
-     */
+        * Return a full copy of the BorderAndPadding information. This clones 
all
+        * padding and border information.
+        * @return The copy.
+        */
     public Object clone() throws CloneNotSupportedException {
         BorderAndPadding bp = (BorderAndPadding) super.clone();
-        bp.padding = (ResolvedCondLength[])padding.clone();
+        bp.padding = new long[ padding.length]; //
+        System.arraycopy( padding, 0, bp.padding, 0, padding.length);
         bp.borderInfo = (BorderInfo[])borderInfo.clone();
-        for (int i=0; i<padding.length; i++) {
-            if (padding[i] != null) {
-                bp.padding[i]=(ResolvedCondLength)padding[i].clone();
-            }
+        for (int i=0; i<borderInfo.length; i++) {
             if (borderInfo[i] != null) {
                 bp.borderInfo[i]=(BorderInfo)borderInfo[i].clone();
             }
@@ -55,24 +45,23 @@
     public static class BorderInfo implements Cloneable {
         private int mStyle;          // Enum for border style
         private ColorType mColor;    // Border color
-        private ResolvedCondLength mWidth;
+        private long mWidth;
 
         BorderInfo(int style, CondLength width, ColorType color) {
             mStyle = style;
-            mWidth = new ResolvedCondLength(width);
+            mWidth = new_ResolvedCondLength(width);
             mColor = color;
         }
-
         public Object clone() throws CloneNotSupportedException {
             BorderInfo bi = (BorderInfo) super.clone();
-            bi.mWidth = (ResolvedCondLength)mWidth.clone();
+            bi.mWidth = mWidth;
             // do we need to clone the Color too???
             return bi;
         }
     }
 
     private BorderInfo[] borderInfo = new BorderInfo[4];
-    private ResolvedCondLength[] padding = new ResolvedCondLength[4];
+    private long[] padding = new long[4];//
 
     public BorderAndPadding() {}
 
@@ -82,15 +71,15 @@
     }
 
     public void setPadding(int side, CondLength width) {
-        padding[side] = new ResolvedCondLength(width);
+        padding[ side] = new_ResolvedCondLength(width);
     }
 
     public void setPaddingLength(int side, int iLength) {
-        padding[side].iLength = iLength;
+        padding[side] = iLength + padding[side]&bDiscard_MASK;
     }
 
     public void setBorderLength(int side, int iLength) {
-        borderInfo[side].mWidth.iLength = iLength;
+        borderInfo[side].mWidth = iLength + borderInfo
[side].mWidth&bDiscard_MASK;
     }
 
     public int getBorderLeftWidth(boolean bDiscard) {
@@ -128,10 +117,13 @@
 
     private int getBorderWidth(int side, boolean bDiscard) {
         if ((borderInfo[side] == null)
-                || (bDiscard && borderInfo[side].mWidth.bDiscard)) {
+                || (bDiscard &&
+                    ((borderInfo[side].mWidth&bDiscard_MASK) != 0L)
+                   )) {
             return 0;
-        } else
-            return borderInfo[side].mWidth.iLength;
+        } else {
+            return (int) (borderInfo[side].mWidth&iLength_MASK);
+        }
     }
 
     public ColorType getBorderColor(int side) {
@@ -149,10 +141,7 @@
     }
 
     private int getPadding(int side, boolean bDiscard) {
-        if ((padding[side] == null) || (bDiscard && padding[side].bDiscard)) {
-            return 0;
-        } else
-            return padding[side].iLength;
+        return (int)( padding[side]&iLength_MASK);
     }
 
 }
--- org__src\org\apache\fop\layout\FontInfo.java	Mon Oct 28 11:40:33 2002
+++ src\org\apache\fop\layout\FontInfo.java	Mon Oct 28 11:40:33 2002
@@ -8,6 +8,7 @@
 package org.apache.fop.layout;
 
 import java.util.Hashtable;
+import java.util.HashMap;
 import org.apache.fop.messaging.MessageHandler;
 import java.util.Enumeration;
 
@@ -27,9 +28,9 @@
     public void addFontProperties(String name, String family, String style,
                                   String weight) {
         /*
-         * add the given family, style and weight as a lookup for the font
-         * with the given name
-         */
+        * add the given family, style and weight as a lookup for the font
+        * with the given name
+        */
 
         String key = createFontKey(family, style, weight);
         this.triplets.put(key, name);
@@ -80,16 +81,40 @@
     /**
      * Creates a key from the given strings
      */
-    public static String createFontKey(String family, String style,
-                                       String weight) {
-        int i;
-
-        try {
-            i = Integer.parseInt(weight);
-        } catch (NumberFormatException e) {
-            i = 0;
+    static HashMap _hweight = new HashMap(); //key = wight value _hStyle
+
+    public static String createFontKey(String family, String style,String 
weight) {
+
+        HashMap _hstyle = (HashMap) _hweight.get( weight);
+        HashMap _hfamily = null; //key family, value CreateFontKey
+        String ret = null;
+        if( _hstyle == null) {
+            _hweight.put( weight, _hstyle = new HashMap());
+        } else {
+            _hfamily = (HashMap) _hstyle.get( style); // , value CreateFontKey
+        }
+        if( _hfamily != null) {
+            ret = (String) _hfamily.get( family);
+            if( ret != null)
+                return ret;
+        } else {
+            _hstyle.put( style, _hfamily = new HashMap());
         }
+        ret = _createFontKey(family, style, weight);
+        _hfamily.put( family, ret);
+        return ret;
+    }
 
+    private static String _createFontKey(String family, String style,
+                                         String weight) {
+        int i = 0;
+        if( weight.charAt(0)>='0' &&  weight.charAt(0)<='9') {
+            try {
+                i = Integer.parseInt(weight);
+            } catch (NumberFormatException e) {
+                i = 0;
+            }
+        }
         if (i > 600)
             weight = "bold";
         else if (i > 0)
--- org__src\org\apache\fop\layout\FontState.java	Mon Oct 28 11:40:33 2002
+++ src\org\apache\fop\layout\FontState.java	Mon Oct 28 11:40:33 2002
@@ -7,6 +7,7 @@
 
 package org.apache.fop.layout;
 
+import java.util.HashMap;
 import java.util.Hashtable;
 import java.util.StringTokenizer;
 
@@ -29,7 +30,41 @@
 
     private static Hashtable EMPTY_HASHTABLE = new Hashtable();
 
-
+    private static HashMap FONT_TOKENS = new  HashMap(16); //key _fontFamily 
value String[]
+    private static String[] getFontFamilyTokens( String fontFamily) {
+        String ret[] = (String[]) FONT_TOKENS.get(fontFamily);
+        if( ret != null)
+            return ret;
+        StringTokenizer st = new StringTokenizer(fontFamily, ",");
+        ret = new String[ st.countTokens()];
+        FONT_TOKENS.put(fontFamily, ret);
+        for( int j = 0; j < ret.length; j++) {
+            //while (st.hasMoreTokens()) {
+            String token = st.nextToken().trim();
+            //Checks for quoted font family name
+            if (token.charAt(0) == '"' || token.charAt(0) == '\'')
+                token = token.substring(1, token.length()-1);
+            else {
+                //In a nonquoted font family name any sequence of whitespace
+                //inside should be converted to a single space
+                StringBuffer sb = new StringBuffer();
+                boolean spaced = false;
+                for (int i=0; i<token.length(); i++) {
+                    char c = token.charAt(i);
+                    if (!isWhitespace(c)) {
+                        sb.append(c);
+                        spaced = false;
+                    } else if (!spaced) {
+                        sb.append(c);
+                        spaced = true;
+                    }
+                }
+                token = sb.toString();
+            }
+            ret[j] = token;
+        }
+        return ret;
+    }
     public FontState(FontInfo fontInfo, String fontFamily, String fontStyle,
                      String fontWeight, int fontSize,
                      int fontVariant) throws FOPException {
@@ -41,30 +76,36 @@
         String _fontKey = FontInfo.createFontKey(_fontFamily, _fontStyle, 
_fontWeight);
         //Quick check-out for simple font family
         if (!fontInfo.hasFont(_fontKey)) {
-            //Tokenizes font-family list
-            StringTokenizer st = new StringTokenizer(_fontFamily, ",");
-            while (st.hasMoreTokens()) {
-                String token = st.nextToken().trim();
-                //Checks for quoted font family name
-                if (token.charAt(0) == '"' || token.charAt(0) == '\'')
-                    token = token.substring(1, token.length()-1);
-                else {
-                    //In a nonquoted font family name any sequence of 
whitespace
-                    //inside should be converted to a single space
-                    StringBuffer sb = new StringBuffer();
-                    boolean spaced = false;
-                    for (int i=0; i<token.length(); i++) {
-                        char c = token.charAt(i);
-                        if (!isWhitespace(c)) {
-                            sb.append(c);
-                            spaced = false;
-                        } else if (!spaced) {
-                            sb.append(c);
-                            spaced = true;
-                        }
-                    }
-                    token = sb.toString();
-                }
+            String _aString[] = getFontFamilyTokens( _fontFamily);
+            for( int i = 0; i < _aString.length; i++) {
+                String token = _aString[i];
+                /*
+                			//Tokenizes font-family list
+                            StringTokenizer st = new StringTokenizer
(_fontFamily, ",");
+                            while (st.hasMoreTokens()){
+                                String token = st.nextToken().trim();
+                                //Checks for quoted font family name
+                                if (token.charAt(0) == '"' || token.charAt(0) 
== '\'')
+                                    token = token.substring(1, token.length()-
1);
+                                else {
+                                    //In a nonquoted font family name any 
sequence of whitespace
+                                    //inside should be converted to a single 
space
+                                    StringBuffer sb = new StringBuffer();
+                                    boolean spaced = false;
+                                    for (int i=0; i<token.length(); i++) {
+                                        char c = token.charAt(i);
+                                        if (!isWhitespace(c)) {
+                                            sb.append(c);
+                                            spaced = false;
+                                        }
+                                        else if (!spaced) {
+                                            sb.append(c);
+                                            spaced = true;
+                                        }
+                                    }
+                                    token = sb.toString();
+                                }
+                */
                 //Checks found font family name for existence
                 _fontKey = FontInfo.createFontKey(token, _fontStyle, 
_fontWeight);
                 if (fontInfo.hasFont(_fontKey)) {
--- org__src\org\apache\fop\layout\LineArea.java	Mon Oct 28 11:40:34 2002
+++ src\org\apache\fop\layout\LineArea.java	Mon Oct 28 11:40:34 2002
@@ -27,8 +27,8 @@
 import org.apache.fop.configuration.Configuration;
 
 // java
-import java.util.Vector;
-import java.util.Enumeration;
+import java.util.ArrayList;
+import java.util.Iterator;
 import java.util.StringTokenizer;
 import java.awt.Rectangle;
 
@@ -90,7 +90,7 @@
      * because subsequent characters to come (in a different addText)
      * may be part of the same word
      */
-    protected Vector pendingAreas = new Vector();
+    protected ArrayList pendingAreas = new ArrayList();
 
     /* the width of the pendingAreas */
     protected int pendingWidth = 0;
@@ -123,7 +123,7 @@
         this.endIndent = endIndent;
 
         if (prevLineArea != null) {
-            Enumeration e = prevLineArea.pendingAreas.elements();
+            Iterator e = prevLineArea.pendingAreas.iterator();
             Box b = null;
             // There might be InlineSpaces at the beginning
             // that should not be there - eat them
@@ -131,8 +131,8 @@
             int eatenWidth = 0;
 
             while (eatMoreSpace) {
-                if (e.hasMoreElements()) {
-                    b = (Box)e.nextElement();
+                if (e.hasNext()) {
+                    b = (Box)e.next();
                     if (b instanceof InlineSpace) {
                         InlineSpace is = (InlineSpace)b;
                         if (is.isEatable())
@@ -149,9 +149,9 @@
             }
 
             while (b != null) {
-                pendingAreas.addElement(b);
-                if (e.hasMoreElements())
-                    b = (Box)e.nextElement();
+                pendingAreas.add(b);
+                if (e.hasNext())
+                    b = (Box)e.next();
                 else
                     b = null;
             }
@@ -178,7 +178,7 @@
                                    this.red, this.green, this.blue, refid, 
width);
 
         pia.setYOffset(placementOffset);
-        pendingAreas.addElement(pia);
+        pendingAreas.add(pia);
         pendingWidth += width;
         prev = TEXT;
 
@@ -297,9 +297,9 @@
 
                     // add any pending areas
 
-                    Enumeration e = pendingAreas.elements();
-                    while (e.hasMoreElements()) {
-                        Box box = (Box)e.nextElement();
+                    Iterator e = pendingAreas.iterator();
+                    while (e.hasNext()) {
+                        Box box = (Box)e.next();
                         if (box instanceof InlineArea) {
                             if (ls != null) {
                                 Rectangle lr =
@@ -316,7 +316,7 @@
 
                     // reset pending areas array
                     pendingWidth = 0;
-                    pendingAreas = new Vector();
+                    pendingAreas = new ArrayList();
 
                     // add the current word
 
@@ -433,9 +433,9 @@
 
                         // add any pending areas
 
-                        Enumeration e = pendingAreas.elements();
-                        while (e.hasMoreElements()) {
-                            Box box = (Box)e.nextElement();
+                        Iterator e = pendingAreas.iterator();
+                        while (e.hasNext()) {
+                            Box box = (Box)e.next();
                             if (box instanceof InlineArea) {
                                 if (ls != null) {
                                     Rectangle lr =
@@ -452,7 +452,7 @@
 
                         // reset pending areas array
                         pendingWidth = 0;
-                        pendingAreas = new Vector();
+                        pendingAreas = new ArrayList();
 
                         // add the current word
 
@@ -556,7 +556,7 @@
                 if (prevLTState) {
                     pis.setLineThrough(textState.getLineThrough());
                 }
-                pendingAreas.addElement(pis);
+                pendingAreas.add(pis);
                 pendingWidth += spaceWidth;
                 spaceWidth = 0;
             }
@@ -619,7 +619,7 @@
         switch (leaderPattern) {
         case LeaderPattern.SPACE:
             InlineSpace spaceArea = new InlineSpace(leaderLength);
-            pendingAreas.addElement(spaceArea);
+            pendingAreas.add(spaceArea);
             break;
         case LeaderPattern.RULE:
             LeaderArea leaderArea = new LeaderArea(fontState, red, green,
@@ -627,7 +627,7 @@
                                                    leaderPattern,
                                                    ruleThickness, ruleStyle);
             leaderArea.setYOffset(placementOffset);
-            pendingAreas.addElement(leaderArea);
+            pendingAreas.add(leaderArea);
             break;
         case LeaderPattern.DOTS:
             // if the width of a dot is larger than leader-pattern-width
@@ -637,8 +637,8 @@
             }
             // if value of leader-pattern-width is 'use-font-metrics' (0)
             if (leaderPatternWidth == 0) {
-                pendingAreas.addElement(this.buildSimpleLeader(dotIndex,
-                                        leaderLength));
+                pendingAreas.add(this.buildSimpleLeader(dotIndex,
+                                                        leaderLength));
             } else {
                 // if leader-alignment is used, calculate space to insert 
before leader
                 // so that all dots will be parallel.
@@ -649,8 +649,8 @@
                     // appending indent space leader-alignment
                     // setting InlineSpace to false, so it is not used in line 
justification
                     if (spaceBeforeLeader != 0) {
-                        pendingAreas.addElement(new InlineSpace
(spaceBeforeLeader,
-                                                                false));
+                        pendingAreas.add(new InlineSpace(spaceBeforeLeader,
+                                                         false));
                         pendingWidth += spaceBeforeLeader;
                         // shorten leaderLength, otherwise - in case of
                         // leaderLength=remaining length - it will cut off the 
end of
@@ -675,13 +675,13 @@
                 // add combination of dot + space to fill leader
                 // is there a way to do this in a more effective way?
                 for (int i = 0; i < dotsFactor; i++) {
-                    pendingAreas.addElement(leaderPatternArea);
-                    pendingAreas.addElement(spaceBetweenDots);
+                    pendingAreas.add(leaderPatternArea);
+                    pendingAreas.add(spaceBetweenDots);
                 }
                 // append at the end some space to fill up to leader length
-                pendingAreas.addElement(new InlineSpace(leaderLength
-                                                        - dotsFactor
-                                                        * leaderPatternWidth));
+                pendingAreas.add(new InlineSpace(leaderLength
+                                                 - dotsFactor
+                                                 * leaderPatternWidth));
             }
             break;
             // leader pattern use-content not implemented.
@@ -709,9 +709,9 @@
             spaceWidth = 0;
         }
 
-        Enumeration e = pendingAreas.elements();
-        while (e.hasMoreElements()) {
-            Box box = (Box)e.nextElement();
+        Iterator e = pendingAreas.iterator();
+        while (e.hasNext()) {
+            Box box = (Box)e.next();
             addChild(box);
         }
 
@@ -719,7 +719,7 @@
 
         // reset pending areas array
         pendingWidth = 0;
-        pendingAreas = new Vector();
+        pendingAreas = new ArrayList();
     }
 
     /**
@@ -746,9 +746,9 @@
         case TextAlign.JUSTIFY:    // justify
             // first pass - count the spaces
             int spaceCount = 0;
-            Enumeration e = children.elements();
-            while (e.hasMoreElements()) {
-                Box b = (Box)e.nextElement();
+            Iterator e = children.iterator();
+            while (e.hasNext()) {
+                Box b = (Box)e.next();
                 if (b instanceof InlineSpace) {
                     InlineSpace space = (InlineSpace)b;
                     if (space.getResizeable()) {
@@ -763,9 +763,9 @@
             }
             // second pass - add additional space
             spaceCount = 0;
-            e = children.elements();
-            while (e.hasMoreElements()) {
-                Box b = (Box)e.nextElement();
+            e = children.iterator();
+            while (e.hasNext()) {
+                Box b = (Box)e.next();
                 if (b instanceof InlineSpace) {
                     InlineSpace space = (InlineSpace)b;
                     if (space.getResizeable()) {
@@ -786,9 +786,9 @@
     public void verticalAlign() {
         int superHeight = -this.placementOffset;
         int maxHeight = this.allocationHeight;
-        Enumeration e = children.elements();
-        while (e.hasMoreElements()) {
-            Box b = (Box)e.nextElement();
+        Iterator e = children.iterator();
+        while (e.hasNext()) {
+            Box b = (Box)e.next();
             if (b instanceof InlineArea) {
                 InlineArea ia = (InlineArea)b;
                 if (ia instanceof WordArea) {
@@ -855,7 +855,7 @@
         // return (prev == NOTHING);
     }
 
-    public Vector getPendingAreas() {
+    public ArrayList getPendingAreas() {
         return pendingAreas;
     }
 
@@ -863,7 +863,7 @@
         return pendingWidth;
     }
 
-    public void setPendingAreas(Vector areas) {
+    public void setPendingAreas(ArrayList areas) {
         pendingAreas = areas;
     }
 
@@ -1135,7 +1135,7 @@
                               width);
             ia.setYOffset(placementOffset);
             ia.setUnderlined(ul);
-            pendingAreas.addElement(ia);
+            pendingAreas.add(ia);
             if (Character.isSpaceChar(data)) {
                 this.spaceWidth = +width;
                 prev = LineArea.WHITESPACE;
@@ -1235,59 +1235,65 @@
      * versions of space that might not exists in the font.
      */
     private int getCharWidth(char c) {
-        int width;
+        switch( c) {
+        case '\n':
+        case '\r':
+        case '\t':
+        case '\u00A0':
+            return getCharWidth(' ');
+        }
+
+        int width = currentFontState.width(currentFontState.mapChar(c));
+        if (width > 0)
+            return width;
+        if (c == ' ')
+            return currentFontState.width(currentFontState.mapChar('m'));
+
+        // Estimate the width of spaces not represented in
+        // the font
+        int em = currentFontState.width(currentFontState.mapChar('m'));
+        int en = currentFontState.width(currentFontState.mapChar('n'));
+        if (em <= 0)
+            em = 500 * currentFontState.getFontSize();
+        if (en <= 0)
+            en = em - 10;
+
+        //if (c == ' ') width = em;
+        switch( c) {
+        case '\u2000':
+            return en;
+        case '\u2001':
+            return em;
+        case '\u2002':
+            return em / 2;
+        case '\u2003':
+            return currentFontState.getFontSize();
+        case '\u2004':
+            return em / 3;
+        case '\u2005':
+            return em / 4;
+        case '\u2006':
+            return em / 6;
+        case '\u2007':
+            return getCharWidth(' ');
+        case '\u2008':
+            return getCharWidth('.');
+        case '\u2009':
+            return em / 5;
+        case '\u200A':
+            return 5;
+        case '\u200B':
+            return 100;
+        case '\u202F':
+            return getCharWidth(' ') / 2;
+        case '\u3000':
+            return getCharWidth(' ') * 2;
 
-        if ((c == '\n') || (c == '\r') || (c == '\t') || (c == '\u00A0')) {
-            width = getCharWidth(' ');
-        } else {
-            width = currentFontState.width(currentFontState.mapChar(c));
-            if (width <= 0) {
-                // Estimate the width of spaces not represented in
-                // the font
-                int em = currentFontState.width(currentFontState.mapChar('m'));
-                int en = currentFontState.width(currentFontState.mapChar('n'));
-                if (em <= 0)
-                    em = 500 * currentFontState.getFontSize();
-                if (en <= 0)
-                    en = em - 10;
-
-                if (c == ' ')
-                    width = em;
-                if (c == '\u2000')
-                    width = en;
-                if (c == '\u2001')
-                    width = em;
-                if (c == '\u2002')
-                    width = em / 2;
-                if (c == '\u2003')
-                    width = currentFontState.getFontSize();
-                if (c == '\u2004')
-                    width = em / 3;
-                if (c == '\u2005')
-                    width = em / 4;
-                if (c == '\u2006')
-                    width = em / 6;
-                if (c == '\u2007')
-                    width = getCharWidth(' ');
-                if (c == '\u2008')
-                    width = getCharWidth('.');
-                if (c == '\u2009')
-                    width = em / 5;
-                if (c == '\u200A')
-                    width = 5;
-                if (c == '\u200B')
-                    width = 100;
-                if (c == '\u202F')
-                    width = getCharWidth(' ') / 2;
-                if (c == '\u3000')
-                    width = getCharWidth(' ') * 2;
-            }
         }
 
-        return width;
+        return 0;
     }
 
-
     /**
      * Helper method to determine if the character is a
      * space with normal behaviour. Normal behaviour means that
@@ -1341,63 +1347,83 @@
     private void addSpacedWord(String word, LinkSet ls, int startw,
                                int spacew, TextState textState,
                                boolean addToPending) {
-        StringTokenizer st = new StringTokenizer(word, "\u00A0\u202F\u3000
\uFEFF", true);
-        int extraw = 0;
-        while (st.hasMoreTokens()) {
-            String currentWord = st.nextToken();
-
-            if (currentWord.length() == 1
-                    && (isNBSP(currentWord.charAt(0)))) {
-                // Add an InlineSpace
-                int spaceWidth = getCharWidth(currentWord.charAt(0));
-                if (spaceWidth > 0) {
-                    InlineSpace is = new InlineSpace(spaceWidth);
-                    extraw += spaceWidth;
-                    if (prevUlState) {
-                        is.setUnderlined(textState.getUnderlined());
-                    }
-                    if (prevOlState) {
-                        is.setOverlined(textState.getOverlined());
-                    }
-                    if (prevLTState) {
-                        is.setLineThrough(textState.getLineThrough());
-                    }
-
-                    if (addToPending) {
-                        pendingAreas.addElement(is);
-                        pendingWidth += spaceWidth;
-                    } else {
-                        addChild(is);
-                    }
+        for( int i = 0; i < word.length(); i++) {
+            switch( word.charAt(i)) {
+            case '\u00A0':
+            case '\u202F':
+            case '\u3000':
+            case '\uFEFF':
+                //default:
+                StringTokenizer st = new StringTokenizer(word, "\u00A0
\u202F\u3000\uFEFF", true);
+                int extraw = 0;
+                while (st.hasMoreTokens()) {
+                    String currentWord = st.nextToken();
+                    extraw = proc_addSpacedWord(currentWord,  ls,  startw,
+                                                spacew, textState,
+                                                addToPending, extraw);
+                }
+                return;
+            }
+        }
+        proc_addSpacedWord( word,  ls,  startw,
+                            spacew, textState,
+                            addToPending, 0);
+    }
+    private int proc_addSpacedWord(String currentWord, LinkSet ls, int startw,
+                                   int spacew, TextState textState,
+                                   boolean addToPending, int extraw) {
+        if (currentWord.length() == 1
+                && (isNBSP(currentWord.charAt(0)))) {
+            // Add an InlineSpace
+            int spaceWidth = getCharWidth(currentWord.charAt(0));
+            if (spaceWidth > 0) {
+                InlineSpace is = new InlineSpace(spaceWidth);
+                extraw += spaceWidth;
+                if (prevUlState) {
+                    is.setUnderlined(textState.getUnderlined());
+                }
+                if (prevOlState) {
+                    is.setOverlined(textState.getOverlined());
+                }
+                if (prevLTState) {
+                    is.setLineThrough(textState.getLineThrough());
                 }
-            } else {
-                WordArea ia = new WordArea(currentFontState, this.red,
-                                           this.green, this.blue,
-                                           currentWord,
-                                           getWordWidth(currentWord));
-                ia.setYOffset(placementOffset);
-                ia.setUnderlined(textState.getUnderlined());
-                prevUlState = textState.getUnderlined();
-                ia.setOverlined(textState.getOverlined());
-                prevOlState = textState.getOverlined();
-                ia.setLineThrough(textState.getLineThrough());
-                prevLTState = textState.getLineThrough();
-                ia.setVerticalAlign(vAlign);
 
                 if (addToPending) {
-                    pendingAreas.addElement(ia);
-                    pendingWidth += getWordWidth(currentWord);
+                    pendingAreas.add(is);
+                    pendingWidth += spaceWidth;
                 } else {
-                    addChild(ia);
-                }
-                if (ls != null) {
-                    Rectangle lr = new Rectangle(startw + extraw, spacew,
-                                                 ia.getContentWidth(),
-                                                 fontState.getFontSize());
-                    ls.addRect(lr, this, ia);
+                    addChild(is);
                 }
             }
+        } else {
+            WordArea ia = new WordArea(currentFontState, this.red,
+                                       this.green, this.blue,
+                                       currentWord,
+                                       getWordWidth(currentWord));
+            ia.setYOffset(placementOffset);
+            ia.setUnderlined(textState.getUnderlined());
+            prevUlState = textState.getUnderlined();
+            ia.setOverlined(textState.getOverlined());
+            prevOlState = textState.getOverlined();
+            ia.setLineThrough(textState.getLineThrough());
+            prevLTState = textState.getLineThrough();
+            ia.setVerticalAlign(vAlign);
+
+            if (addToPending) {
+                pendingAreas.add(ia);
+                pendingWidth += getWordWidth(currentWord);
+            } else {
+                addChild(ia);
+            }
+            if (ls != null) {
+                Rectangle lr = new Rectangle(startw + extraw, spacew,
+                                             ia.getContentWidth(),
+                                             fontState.getFontSize());
+                ls.addRect(lr, this, ia);
+            }
         }
+        return extraw;
     }
 
 }
--- org__src\org\apache\fop\layout\SpanArea.java	Mon Oct 28 11:40:37 2002
+++ src\org\apache\fop\layout\SpanArea.java	Mon Oct 28 11:40:37 2002
@@ -14,7 +14,7 @@
 
 // Java
 import java.util.Vector;
-import java.util.Enumeration;
+import java.util.Iterator;
 
 public class SpanArea extends AreaContainer {
 
@@ -77,7 +77,7 @@
     }
 
     public AreaContainer getCurrentColumnArea() {
-        return (AreaContainer)getChildren().elementAt(currentColumn - 1);
+        return (AreaContainer)getChildren().get(currentColumn - 1);
     }
 
     public boolean isBalanced() {
@@ -90,19 +90,19 @@
 
     public int getTotalContentHeight() {
         int totalContentHeight = 0;
-        for (Enumeration e = getChildren().elements();
-                e.hasMoreElements(); ) {
+        for (Iterator e = getChildren().iterator();
+                e.hasNext(); ) {
             totalContentHeight +=
-                ((AreaContainer)e.nextElement()).getContentHeight();
+                ((AreaContainer)e.next()).getContentHeight();
         }
         return totalContentHeight;
     }
 
     public int getMaxContentHeight() {
         int maxContentHeight = 0;
-        for (Enumeration e = getChildren().elements();
-                e.hasMoreElements(); ) {
-            AreaContainer nextElm = (AreaContainer)e.nextElement();
+        for (Iterator e = getChildren().iterator();
+                e.hasNext(); ) {
+            AreaContainer nextElm = (AreaContainer)e.next();
             if (nextElm.getContentHeight() > maxContentHeight)
                 maxContentHeight = nextElm.getContentHeight();
         }
@@ -111,9 +111,9 @@
 
     public void setPage(Page page) {
         this.page = page;
-        for (Enumeration e = getChildren().elements();
-                e.hasMoreElements(); ) {
-            ((AreaContainer)e.nextElement()).setPage(page);
+        for (Iterator e = getChildren().iterator();
+                e.hasNext(); ) {
+            ((AreaContainer)e.next()).setPage(page);
         }
     }
 
--- org__src\org\apache\fop\render\AbstractRenderer.java	Mon Oct 28 
11:40:58 2002
+++ src\org\apache\fop\render\AbstractRenderer.java	Mon Oct 28 11:40:57 2002
@@ -24,7 +24,7 @@
 // Java
 import java.io.IOException;
 import java.io.OutputStream;
-import java.util.Enumeration;
+import java.util.Iterator;
 
 /**
  * Abstract base class for all renderers.
@@ -53,9 +53,9 @@
     }
 
     public void renderSpanArea(SpanArea area) {
-        Enumeration e = area.getChildren().elements();
-        while (e.hasMoreElements()) {
-            Box b = (Box)e.nextElement();
+        Iterator e = area.getChildren().iterator();
+        while (e.hasNext()) {
+            Box b = (Box)e.next();
             b.render(this);    // column areas
         }
 
@@ -313,9 +313,9 @@
         renderAreaContainer(area.getFootnoteReferenceArea());
 
         // main reference area
-        Enumeration e = area.getMainReferenceArea().getChildren().elements();
-        while (e.hasMoreElements()) {
-            Box b = (Box)e.nextElement();
+        Iterator e = area.getMainReferenceArea().getChildren().iterator();
+        while (e.hasNext()) {
+            Box b = (Box)e.next();
             b.render(this);    // span areas
         }
 
@@ -357,9 +357,9 @@
         this.currentXPosition = this.currentAreaContainerXPosition;
         doFrame(area);
 
-        Enumeration e = area.getChildren().elements();
-        while (e.hasMoreElements()) {
-            Box b = (Box)e.nextElement();
+        Iterator e = area.getChildren().iterator();
+        while (e.hasNext()) {
+            Box b = (Box)e.next();
             b.render(this);
         }
         // Restore previous origin
@@ -391,9 +391,9 @@
         this.currentYPosition -= (area.getPaddingTop()
                                   + area.getBorderTopWidth());
         doFrame(area);
-        Enumeration e = area.getChildren().elements();
-        while (e.hasMoreElements()) {
-            Box b = (Box)e.nextElement();
+        Iterator e = area.getChildren().iterator();
+        while (e.hasNext()) {
+            Box b = (Box)e.next();
             b.render(this);
         }
         this.currentYPosition -= (area.getPaddingBottom()
@@ -416,9 +416,9 @@
 
         int bl = this.currentYPosition;
 
-        Enumeration e = area.getChildren().elements();
-        while (e.hasMoreElements()) {
-            Box b = (Box)e.nextElement();
+        Iterator e = area.getChildren().iterator();
+        while (e.hasNext()) {
+            Box b = (Box)e.next();
             if (b instanceof InlineArea) {
                 InlineArea ia = (InlineArea)b;
                 this.currentYPosition = ry - ia.getYOffset();
--- org__src\org\apache\fop\render\mif\MIFRenderer.java	Mon Oct 28 11:41:00 2002
+++ src\org\apache\fop\render\mif\MIFRenderer.java	Mon Oct 28 11:41:00 2002
@@ -20,7 +20,6 @@
 import org.apache.fop.datatypes.*;
 import org.apache.fop.svg.*;
 import org.apache.fop.mif.*;
-import org.apache.fop.layout.*;
 import org.apache.fop.image.*;
 
 import org.w3c.dom.*;
--- org__src\org\apache\fop\render\pdf\fonts\MultiByteFont.java	Mon Oct 28 
11:41:09 2002
+++ src\org\apache\fop\render\pdf\fonts\MultiByteFont.java	Mon Oct 28 
11:41:09 2002
@@ -71,19 +71,19 @@
     /**
      * usedGlyphsIndex contains new glyph, original index
      */
-    private Hashtable usedGlyphsIndex = new Hashtable();
+
     int usedGlyphsCount = 0;
 
     public MultiByteFont() {
         // Make sure that the 3 first glyphs are included
         usedGlyphs.put(new Integer(0), new Integer(0));
-        usedGlyphsIndex.put(new Integer(0), new Integer(0));
+        usedGlyphsIndex[ 0] = 0;
         usedGlyphsCount++;
         usedGlyphs.put(new Integer(1), new Integer(1));
-        usedGlyphsIndex.put(new Integer(1), new Integer(1));
+        usedGlyphsIndex[ 1] = 1;
         usedGlyphsCount++;
         usedGlyphs.put(new Integer(2), new Integer(2));
-        usedGlyphsIndex.put(new Integer(2), new Integer(2));
+        usedGlyphsIndex[ 2] = 2;
         usedGlyphsCount++;
 
         // Create a quasiunique prefix for fontname
@@ -93,6 +93,8 @@
         }
         int ctm = (int)(System.currentTimeMillis() & 0xffff);
         namePrefix = new String(cnt + "E" + Integer.toHexString(ctm));
+        for( int i = 0; i < usedGlyphsIndex.length; i++)
+            usedGlyphsIndex[i] = -1;
     }
 
     public final boolean hasKerningInfo() {
@@ -177,9 +179,10 @@
             int[] tmpWidth = new int[usedGlyphsCount];
 
             for (int i = 0; i < usedGlyphsCount; i++) {
-                Integer nw = (Integer)usedGlyphsIndex.get(new Integer(i));
-                int nwx = (nw == null) ? 0 : nw.intValue();
+                int nw = usedGlyphsIndex[ i&0xffff];
+                int nwx = (nw < 0) ? 0 : nw;
                 tmpWidth[i] = width[nwx];
+
             }
             warray.addEntry(0, tmpWidth);
         }
@@ -187,8 +190,7 @@
     }
 
     public boolean isEmbeddable() {
-        return (embedFileName == null && embedResourceName == null) ? false
-               : true;
+        return embedFileName != null || embedResourceName != null;
     }
 
 
@@ -272,11 +274,11 @@
     public int getLastChar() {
         return 255;
     }
-
+    //char,size
+    int usedGlyphsIndex[] = new int[0x10000];
     public int width(int i, int size) {
         if (isEmbeddable()) {
-            Integer idx = (Integer)usedGlyphsIndex.get(new Integer(i));
-            return size * width[idx.intValue()];
+            return size * width[usedGlyphsIndex[ i&0xffff]];
         } else {
             return size * width[i];
         }
@@ -290,19 +292,11 @@
         return arr;
     }
 
-    public Integer reMap(Integer i) {
-        if (isEmbeddable()) {
-            Integer ret = (Integer)usedGlyphsIndex.get(i);
-            if (ret == null)
-                ret = i;
-            return ret;
-        } else {
-            return i;
-        }
-
-    }
-
+    char aChar[] = new char[ 0x10000];
     public char mapChar(char c) {
+        int ind = ((int) c) & 0xFFFF;
+        if( aChar[ ind ] != 0)
+            return aChar[ ind ];
         int idx = (int)c;
         int retIdx = 0;
 
@@ -317,21 +311,18 @@
         if (isEmbeddable()) {
             // Reencode to a new subset font or get
             // the reencoded value
-            Integer newIdx = (Integer)usedGlyphs.get(new Integer(retIdx));
+            Integer newIdx = (Integer)usedGlyphs.get( new Integer(retIdx));
             if (newIdx == null) {
-                usedGlyphs.put(new Integer(retIdx),
-                               new Integer(usedGlyphsCount));
-                usedGlyphsIndex.put(new Integer(usedGlyphsCount),
-                                    new Integer(retIdx));
+                usedGlyphs.put(new Integer(retIdx), new Integer
(usedGlyphsCount));
+                usedGlyphsIndex[ usedGlyphsCount & 0xffff] = retIdx;
                 retIdx = usedGlyphsCount;
-                // System.out.println(c+"("+(int)c+") = "+retIdx);
                 usedGlyphsCount++;
             } else {
                 retIdx = newIdx.intValue();
             }
         }
 
-        return (char)retIdx;
+        return aChar[ ind ] = (char)retIdx;
     }
 
 }
--- org__src\org\apache\fop\render\ps\PSRenderer.java	Mon Oct 28 11:41:11 2002
+++ src\org\apache\fop\render\ps\PSRenderer.java	Mon Oct 28 11:41:11 2002
@@ -770,9 +770,9 @@
 
         String fontWeight = area.getFontState().getFontWeight();
         //comment("% --- LineArea begin font-weight="+fontWeight);
-        Enumeration e = area.getChildren().elements();
-        while (e.hasMoreElements()) {
-            Box b = (Box)e.nextElement();
+        Iterator e = area.getChildren().iterator();
+        while (e.hasNext()) {
+            Box b = (Box)e.next();
             this.currentYPosition = ry - area.getPlacementOffset();
             b.render(this);
         }
--- org__src\org\apache\fop\render\xml\XMLRenderer.java	Mon Oct 28 11:41:13 2002
+++ src\org\apache\fop\render\xml\XMLRenderer.java	Mon Oct 28 11:41:13 2002
@@ -26,7 +26,8 @@
 import java.io.IOException;
 import java.io.PrintWriter;
 import java.io.OutputStream;
-import java.util.Enumeration;
+import java.util.Iterator;
+import java.util.ArrayList;
 import java.util.Hashtable;
 
 /**
@@ -203,9 +204,9 @@
      */
     public void renderAreaContainer(AreaContainer area) {
         writeStartTag("<AreaContainer name=\"" + area.getAreaName() + "\">");
-        Enumeration e = area.getChildren().elements();
-        while (e.hasMoreElements()) {
-            Box b = (Box)e.nextElement();
+        Iterator e = area.getChildren().iterator();
+        while (e.hasNext()) {
+            Box b = (Box)e.next();
             b.render(this);
         }
         writeEndTag("</AreaContainer>");
@@ -218,9 +219,9 @@
      */
     public void renderBodyAreaContainer(BodyAreaContainer area) {
         writeStartTag("<BodyAreaContainer>");
-        Enumeration e = area.getChildren().elements();
-        while (e.hasMoreElements()) {
-            Box b = (Box)e.nextElement();
+        Iterator e = area.getChildren().iterator();
+        while (e.hasNext()) {
+            Box b = (Box)e.next();
             b.render(this);
         }
         writeEndTag("</BodyAreaContainer>");
@@ -233,9 +234,9 @@
      */
     public void renderSpanArea(SpanArea area) {
         writeStartTag("<SpanArea>");
-        Enumeration e = area.getChildren().elements();
-        while (e.hasMoreElements()) {
-            Box b = (Box)e.nextElement();
+        Iterator e = area.getChildren().iterator();
+        while (e.hasNext()) {
+            Box b = (Box)e.next();
             b.render(this);
         }
         writeEndTag("</SpanArea>");
@@ -265,12 +266,12 @@
         writeStartTag(baText.toString());
 
         // write out marker info
-        java.util.Vector markers = area.getMarkers();
+        ArrayList markers = area.getMarkers();
         if (!markers.isEmpty()) {
             writeStartTag("<Markers>");
             for (int m = 0; m < markers.size(); m++) {
                 org.apache.fop.fo.flow.Marker marker =
-                    (org.apache.fop.fo.flow.Marker)markers.elementAt(m);
+                    (org.apache.fop.fo.flow.Marker)markers.get(m);
                 StringBuffer maText = new StringBuffer();
                 maText.append("<Marker marker-class-name=\""
                               + marker.getMarkerClassName() + "\"");
@@ -282,9 +283,9 @@
             writeEndTag("</Markers>");
         }
 
-        Enumeration e = area.getChildren().elements();
-        while (e.hasMoreElements()) {
-            Box b = (Box)e.nextElement();
+        Iterator e = area.getChildren().iterator();
+        while (e.hasNext()) {
+            Box b = (Box)e.next();
             b.render(this);
         }
         writeEndTag("</BlockArea>");
@@ -303,12 +304,12 @@
         writeStartTag(iaText.toString());
 
         // write out marker info
-        java.util.Vector markers = area.getMarkers();
+        ArrayList markers = area.getMarkers();
         if (!markers.isEmpty()) {
             writeStartTag("<Markers>");
             for (int m = 0; m < markers.size(); m++) {
                 org.apache.fop.fo.flow.Marker marker =
-                    (org.apache.fop.fo.flow.Marker)markers.elementAt(m);
+                    (org.apache.fop.fo.flow.Marker)markers.get(m);
                 StringBuffer maText = new StringBuffer();
                 maText.append("<Marker marker-class-name=\""
                               + marker.getMarkerClassName() + "\"");
@@ -320,9 +321,9 @@
             writeEndTag("</Markers>");
         }
 
-        Enumeration e = area.getChildren().elements();
-        while (e.hasMoreElements()) {
-            Box b = (Box)e.nextElement();
+        Iterator e = area.getChildren().iterator();
+        while (e.hasNext()) {
+            Box b = (Box)e.next();
             b.render(this);
         }
         writeEndTag("</InlineArea>");
@@ -416,9 +417,9 @@
             String fontWeight = area.getFontState().getFontWeight();
             writeStartTag("<LineArea font-weight=\"" + fontWeight + "\">");
         }
-        Enumeration e = area.getChildren().elements();
-        while (e.hasMoreElements()) {
-            Box b = (Box)e.nextElement();
+        Iterator e = area.getChildren().iterator();
+        while (e.hasNext()) {
+            Box b = (Box)e.next();
             b.render(this);
         }
         if (!isCoarseXml())
--- org__src\org\apache\fop\svg\SVGElement.java	Mon Oct 28 11:41:20 2002
+++ src\org\apache\fop\svg\SVGElement.java	Mon Oct 28 11:41:19 2002
@@ -92,7 +92,7 @@
      *
      * @return the status of the layout
      */
-    public Status layout(final Area area) throws FOPException {
+    public int layout(final Area area) throws FOPException {
 
         if (!(area instanceof ForeignObjectArea)) {
             // this is an error
@@ -172,16 +172,14 @@
         if (s.length() == 0) {
             s = SVGOMDocument.SVG_SVG_WIDTH_DEFAULT_VALUE;
         }
-        float width = UnitProcessor.svgHorizontalLengthToUserSpace
-                      (s, SVGOMDocument.SVG_WIDTH_ATTRIBUTE, uctx);
+        float width = UnitProcessor.svgHorizontalLengthToUserSpace(s, 
SVGOMDocument.SVG_WIDTH_ATTRIBUTE, uctx);
 
         // 'height' attribute - default is 100%
         s = e.getAttributeNS(null, SVGOMDocument.SVG_HEIGHT_ATTRIBUTE);
         if (s.length() == 0) {
             s = SVGOMDocument.SVG_SVG_HEIGHT_DEFAULT_VALUE;
         }
-        float height = UnitProcessor.svgVerticalLengthToUserSpace
-                       (s, SVGOMDocument.SVG_HEIGHT_ATTRIBUTE, uctx);
+        float height = UnitProcessor.svgVerticalLengthToUserSpace(s, 
SVGOMDocument.SVG_HEIGHT_ATTRIBUTE, uctx);
 
         SVGArea svg = new SVGArea(fs, width, height);
         svg.setSVGDocument(doc);
@@ -198,7 +196,7 @@
         ((SVGOMElement)svgRoot).setSVGContext(null);
 
         /* return status */
-        return new Status(Status.OK);
+        return Status.OK;
     }
 
     private void init() {
Comment 1 Henrik Olsson 2002-10-28 12:39:19 UTC
Created attachment 3627 [details]
Performans tuning fop-0.20.4
Comment 2 Henrik Olsson 2002-10-30 07:23:44 UTC
Created attachment 3658 [details]
performanceTuning.patch
Comment 3 Christian Geisert 2002-11-22 15:15:11 UTC
Committed, thanks for your contribution!

A quick test showed me a 10% speed increase (which isn't that bad either)
and I'm sure memory usage is decreased due to less object creation.

Please send your next patch as diff for current cvs (cvs diff -u  >cool.patch)
as I had to changes some files manually and other have been
already updated to ArrayList etc.

And I noticed a problem with BorderAndPadding.java
(a tablecell in tableunit.fo gets a wrong color)
Comment 4 Henrik Olsson 2002-11-25 10:34:14 UTC
Created attachment 3944 [details]
Correction for BorderAndPadding  wrong color
Comment 5 Henrik Olsson 2002-11-25 10:41:15 UTC
Theres a new patch for the color problems with the cells.
Comment 6 Christian Geisert 2002-11-26 16:33:29 UTC
Fix for BorderAndPadding.java applied.
Comment 7 Glenn Adams 2012-04-01 07:02:32 UTC
batch transition pre-FOP1.0 resolved+fixed bugs to closed+fixed