Index: src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfAttributes.java
===================================================================
--- src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfAttributes.java	(revision 985806)
+++ src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfAttributes.java	(working copy)
@@ -37,8 +37,8 @@
  *  @author Bertrand Delacretaz bdelacretaz@codeconsult.ch
  */
 
-public class RtfAttributes
-implements java.lang.Cloneable {
+public class RtfAttributes implements Cloneable {
+
     private HashMap values = new HashMap();
 
     /**
@@ -106,12 +106,9 @@
         return values.toString() + "(" + super.toString() + ")";
     }
 
-    /**
-     * implement cloning
-     * @return cloned Object
-     */
-    public Object clone() {
-        final RtfAttributes result = new RtfAttributes();
+    /** {@inheritDoc} */
+    public Object clone() throws CloneNotSupportedException {
+        RtfAttributes result = (RtfAttributes) super.clone();
         result.values = (HashMap)values.clone();
 
         // Added by Normand Masse
Index: src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTable.java
===================================================================
--- src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTable.java	(revision 985806)
+++ src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTable.java	(working copy)
@@ -29,6 +29,8 @@
 import java.io.IOException;
 import java.io.Writer;
 
+import org.apache.fop.apps.FOPException;
+
 /**  Container for RtfRow elements
  *  @author Bertrand Delacretaz bdelacretaz@codeconsult.ch
  */
@@ -84,11 +86,16 @@
      * @param attrs attributs of new RtfTableRow
      * @return new RtfTableRow
      * @throws IOException for I/O problems
+     * @throws FOPException if attributes cannot be cloned
      */
-    public RtfTableRow newTableRow(RtfAttributes attrs) throws IOException {
+    public RtfTableRow newTableRow(RtfAttributes attrs) throws IOException, FOPException {
         RtfAttributes attr = null;
         if (attrib != null) {
-            attr = (RtfAttributes) attrib.clone ();
+            try {
+                attr = (RtfAttributes) attrib.clone ();
+            } catch (CloneNotSupportedException e) {
+                throw new FOPException(e);
+            }
             attr.set (attrs);
         } else {
             attr = attrs;
Index: src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfParagraph.java
===================================================================
--- src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfParagraph.java	(revision 985806)
+++ src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfParagraph.java	(working copy)
@@ -30,6 +30,8 @@
 import java.io.IOException;
 import java.util.List;
 
+import org.apache.fop.apps.FOPException;
+
 /**  Model of an RTF paragraph, which can contain RTF text elements.
  *  @author Bertrand Delacretaz bdelacretaz@codeconsult.ch
  *  @author Andreas Putz a.putz@skynamics.com
@@ -91,12 +93,17 @@
     /**
      * IRtfTextContainer requirement: return a copy of our attributes
      * @return a copy of this paragraphs attributes
+     * @throws FOPException if attributes cannot be cloned
      */
-    public RtfAttributes getTextContainerAttributes() {
+    public RtfAttributes getTextContainerAttributes() throws FOPException {
         if (attrib == null) {
             return null;
         }
-        return (RtfAttributes)this.attrib.clone();
+        try {
+            return (RtfAttributes)this.attrib.clone();
+        } catch (CloneNotSupportedException e) {
+            throw new FOPException(e);
+        }
     }
 
     /**
Index: src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfHyperLink.java
===================================================================
--- src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfHyperLink.java	(revision 985806)
+++ src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfHyperLink.java	(working copy)
@@ -29,6 +29,8 @@
 import java.io.Writer;
 import java.io.IOException;
 
+import org.apache.fop.apps.FOPException;
+
 /**
  * Creates an hyperlink.
  * This class belongs to the <fo:basic-link> tag processing.
@@ -158,12 +160,17 @@
     /**
      * IRtfTextContainer requirement:
      * @return a copy of our attributes
+     * @throws FOPException if attributes cannot be cloned
      */
-    public RtfAttributes getTextContainerAttributes() {
+    public RtfAttributes getTextContainerAttributes() throws FOPException {
         if (attrib == null) {
             return null;
         }
-        return (RtfAttributes) this.attrib.clone ();
+        try {
+            return (RtfAttributes) this.attrib.clone ();
+        } catch (CloneNotSupportedException e) {
+            throw new FOPException(e);
+        }
     }
 
 
Index: src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTableRow.java
===================================================================
--- src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTableRow.java	(revision 985806)
+++ src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTableRow.java	(working copy)
@@ -30,6 +30,8 @@
 import java.io.Writer;
 import java.util.Iterator;
 
+import org.apache.fop.apps.FOPException;
+
 /**  Container for RtfTableCell elements
  *  @author Bertrand Delacretaz bdelacretaz@codeconsult.ch
  *  @author Andreas Putz a.putz@skynamics.com
@@ -104,15 +106,20 @@
      * @param cellWidth width of new cell
      * @return new RtfTableCell
      * @throws IOException for I/O problems
+     * @throws FOPException if attributes cannot be cloned
      */
     public RtfTableCell newTableCellMergedHorizontally (int cellWidth,
-           RtfAttributes attrs) throws IOException {
+           RtfAttributes attrs) throws IOException, FOPException {
         highestCell++;
         // Added by Normand Masse
         // Inherit attributes from base cell for merge
         RtfAttributes wAttributes = null;
         if (attrs != null) {
-            wAttributes = (RtfAttributes)attrs.clone();
+            try {
+                wAttributes = (RtfAttributes)attrs.clone();
+            } catch (CloneNotSupportedException e) {
+                throw new FOPException(e);
+            }
         }
 
         cell = new RtfTableCell(this, writer, cellWidth, wAttributes, highestCell);
Index: src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfFootnote.java
===================================================================
--- src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfFootnote.java	(revision 985806)
+++ src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfFootnote.java	(working copy)
@@ -41,8 +41,7 @@
      * Create an RTF list item as a child of given container with default attributes.
      * @param parent a container
      * @param w a writer
-     * @return a text run
-     * @throw IOException if not caught
+     * @throws IOException if not caught
      */
     RtfFootnote(RtfContainer parent, Writer w) throws IOException {
         super(parent, w);
Index: src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfText.java
===================================================================
--- src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfText.java	(revision 985806)
+++ src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfText.java	(working copy)
@@ -29,6 +29,8 @@
 import java.io.IOException;
 import java.io.Writer;
 
+import org.apache.fop.apps.FOPException;
+
 /**  Model of a text run (a piece of text with attributes) in an RTF document
  *  @author Bertrand Delacretaz bdelacretaz@codeconsult.ch
  */
@@ -238,12 +240,18 @@
     }
 
     /** IRtfTextContainer requirement:
-     * @return a copy of our attributes */
-    public RtfAttributes getTextContainerAttributes() {
+     * @return a copy of our attributes 
+     * @throws FOPException if attributes cannot be cloned
+     */
+    public RtfAttributes getTextContainerAttributes() throws FOPException {
         if (attrib == null) {
             return null;
         }
-        return (RtfAttributes)this.attrib.clone();
+        try {
+            return (RtfAttributes)this.attrib.clone();
+        } catch (CloneNotSupportedException e) {
+            throw new FOPException(e);
+        }
     }
 
     /** direct access to our text */
Index: src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfTextContainer.java
===================================================================
--- src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfTextContainer.java	(revision 985806)
+++ src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfTextContainer.java	(working copy)
@@ -28,6 +28,8 @@
 
 import java.io.IOException;
 
+import org.apache.fop.apps.FOPException;
+
 /**  Interface for RtfElements that can contain RtfText elements
  *  @author Bertrand Delacretaz bdelacretaz@codeconsult.ch
  */
@@ -59,6 +61,7 @@
     /**
      * Text containers usually provide default attributes for all texts that they contain.
      * @return a copy of the container's attributes.
+     * @throws FOPException if attributes cannot be obtained
      */
-    RtfAttributes getTextContainerAttributes();
+    RtfAttributes getTextContainerAttributes() throws FOPException;
 }
Index: src/java/org/apache/fop/render/rtf/TextAttributesConverter.java
===================================================================
--- src/java/org/apache/fop/render/rtf/TextAttributesConverter.java	(revision 985806)
+++ src/java/org/apache/fop/render/rtf/TextAttributesConverter.java	(working copy)
@@ -442,7 +442,7 @@
     /**
      * Reads background-color from bl and writes it to rtfAttr.
      *
-     * @param bph the CommonBorderPaddingBackground from which the properties are read
+     * @param bpb the CommonBorderPaddingBackground from which the properties are read
      * @param rtfAttr the RtfAttributes object the attributes are written to
      */
     private static void attrBackgroundColor(CommonBorderPaddingBackground bpb,
Index: src/java/org/apache/fop/render/intermediate/IFGraphicContext.java
===================================================================
--- src/java/org/apache/fop/render/intermediate/IFGraphicContext.java	(revision 985806)
+++ src/java/org/apache/fop/render/intermediate/IFGraphicContext.java	(working copy)
@@ -22,6 +22,7 @@
 import java.awt.Dimension;
 import java.awt.Rectangle;
 import java.awt.geom.AffineTransform;
+import java.util.ArrayList;
 import java.util.List;
 
 import org.apache.xmlgraphics.java2d.GraphicContext;
@@ -29,11 +30,11 @@
 /**
  * Specialized graphic context class for the intermediate format renderer.
  */
-public class IFGraphicContext extends GraphicContext {
+public class IFGraphicContext extends GraphicContext implements Cloneable {
 
     private static final AffineTransform[] EMPTY_TRANSFORM_ARRAY = new AffineTransform[0];
 
-    private List groupList = new java.util.ArrayList();
+    private List groupList = new ArrayList();
 
     /**
      * Default constructor.
@@ -48,14 +49,28 @@
      */
     protected IFGraphicContext(IFGraphicContext graphicContext) {
         super(graphicContext);
-        //We don't clone groupDepth!
+        //We don't clone groupList!
     }
 
-    /** {@inheritDoc} */
+    /**
+     * {@inheritDoc}
+     * use the following method as soon as the superclass in XGC uses super.clone
+     */
     public Object clone() {
         return new IFGraphicContext(this);
     }
 
+    /**
+     *  {@inheritDoc}
+     *  use this method as soon as the superclass in XGC uses super.clone
+     */
+    /*public Object clone() throws CloneNotSupportedException {
+        IFGraphicContext ifgc = (IFGraphicContext) super.clone();
+        //We don't clone groupList!
+        ifgc.groupList = new ArrayList();
+        return ifgc;
+    }*/
+
     /** @param group a group */
     public void pushGroup(Group group) {
         //this.groupDepth++;
Index: src/java/org/apache/fop/render/awt/AWTRenderer.java
===================================================================
--- src/java/org/apache/fop/render/awt/AWTRenderer.java	(revision 985806)
+++ src/java/org/apache/fop/render/awt/AWTRenderer.java	(working copy)
@@ -125,8 +125,9 @@
 
     /**
      * {@inheritDoc}
+     * @throws FOPException thrown by java2DRenderer
      */
-    public void renderPage(PageViewport pageViewport) throws IOException {
+    public void renderPage(PageViewport pageViewport) throws IOException, FOPException {
 
         super.renderPage(pageViewport);
         if (statusListener != null) {
Index: src/java/org/apache/fop/render/java2d/Java2DRenderer.java
===================================================================
--- src/java/org/apache/fop/render/java2d/Java2DRenderer.java	(revision 985806)
+++ src/java/org/apache/fop/render/java2d/Java2DRenderer.java	(working copy)
@@ -263,10 +263,15 @@
      * @param pageViewport the <code>PageViewport</code> object supplied by
      * the Area Tree
      * @throws IOException In case of an I/O error
+     * @throws FOPException if cloning of pageViewport is not supported
      * @see org.apache.fop.render.Renderer
      */
-    public void renderPage(PageViewport pageViewport) throws IOException {
-        rememberPage((PageViewport)pageViewport.clone());
+    public void renderPage(PageViewport pageViewport) throws IOException, FOPException {
+        try {
+            rememberPage((PageViewport)pageViewport.clone());
+        } catch (CloneNotSupportedException e) {
+            throw new FOPException(e);
+        }
         //The clone() call is necessary as we store the page for later. Otherwise, the
         //RenderPagesModel calls PageViewport.clear() to release memory as early as possible.
         currentPageNumber++;
Index: src/java/org/apache/fop/hyphenation/CharVector.java
===================================================================
--- src/java/org/apache/fop/hyphenation/CharVector.java	(revision 985806)
+++ src/java/org/apache/fop/hyphenation/CharVector.java	(working copy)
@@ -99,9 +99,9 @@
     }
 
     /** {@inheritDoc} */
-    public Object clone() {
-        CharVector cv = new CharVector((char[])array.clone(), blockSize);
-        cv.n = this.n;
+    public Object clone() throws CloneNotSupportedException {
+        CharVector cv = (CharVector) super.clone();
+        cv.array = (char[])array.clone();
         return cv;
     }
 
Index: src/java/org/apache/fop/hyphenation/TernaryTree.java
===================================================================
--- src/java/org/apache/fop/hyphenation/TernaryTree.java	(revision 985806)
+++ src/java/org/apache/fop/hyphenation/TernaryTree.java	(working copy)
@@ -48,7 +48,7 @@
  * patterns which will be keys in this tree. The strings patterns
  * are usually small (from 2 to 5 characters), but each char in the
  * tree is stored in a node. Thus memory usage is the main concern.
- * We will sacrify 'elegance' to keep memory requirenments to the
+ * We will sacrify 'elegance' to keep memory requirements to the
  * minimum. Using java's char type as pointer (yes, I know pointer
  * it is a forbidden word in java) we can keep the size of the node
  * to be just 8 bytes (3 pointers and the data char). This gives
@@ -402,16 +402,13 @@
     }
 
     /** {@inheritDoc} */
-    public Object clone() {
-        TernaryTree t = new TernaryTree();
+    public Object clone() throws CloneNotSupportedException {
+        TernaryTree t = (TernaryTree) super.clone();
         t.lo = (char[])this.lo.clone();
         t.hi = (char[])this.hi.clone();
         t.eq = (char[])this.eq.clone();
         t.sc = (char[])this.sc.clone();
         t.kv = (CharVector)this.kv.clone();
-        t.root = this.root;
-        t.freenode = this.freenode;
-        t.length = this.length;
 
         return t;
     }
Index: src/java/org/apache/fop/tools/anttasks/FileCompare.java
===================================================================
--- src/java/org/apache/fop/tools/anttasks/FileCompare.java	(revision 985806)
+++ src/java/org/apache/fop/tools/anttasks/FileCompare.java	(working copy)
@@ -119,13 +119,13 @@
 
     /**
      * Does a file size compare of two files
-     * @param file1 the first file to compare
-     * @param file2 the second file to compare
+     * @param oldFile the first file to compare
+     * @param newFile the second file to compare
      * @return true if files are same length, false otherwise
      */
     private static boolean compareFileSize(File oldFile, File newFile) {
         return oldFile.length() == newFile.length();
-    }    // end: compareBytes
+    }
 
     private boolean filesExist(File oldFile, File newFile) {
         if (!oldFile.exists()) {
Index: src/java/org/apache/fop/area/BodyRegion.java
===================================================================
--- src/java/org/apache/fop/area/BodyRegion.java	(revision 985806)
+++ src/java/org/apache/fop/area/BodyRegion.java	(working copy)
@@ -136,19 +136,11 @@
         return getBPD() - usedBPD;
     }
 
-    /**
-     * Clone this object.
-     *
-     * @return a shallow copy of this object
-     */
-    public Object clone() {
-        BodyRegion br = new BodyRegion(getRegionClass(), getRegionName(), regionViewport,
-                getColumnCount(), getColumnGap());
-        br.setCTM(getCTM());
-        br.setIPD(getIPD());
-        br.beforeFloat = beforeFloat;
-        br.mainReference = mainReference;
-        br.footnote = footnote;
+    /** {@inheritDoc} */
+    public Object clone() throws CloneNotSupportedException {
+        BodyRegion br = (BodyRegion) super.clone();
+        br.mainReference = new MainReference(br);
         return br;
     }
+
 }
Index: src/java/org/apache/fop/area/PageViewport.java
===================================================================
--- src/java/org/apache/fop/area/PageViewport.java	(revision 985806)
+++ src/java/org/apache/fop/area/PageViewport.java	(working copy)
@@ -20,6 +20,7 @@
 package org.apache.fop.area;
 
 import java.awt.Rectangle;
+import java.awt.geom.Rectangle2D;
 import java.io.IOException;
 import java.io.ObjectInputStream;
 import java.io.ObjectOutputStream;
@@ -33,6 +34,7 @@
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
+import org.apache.fop.apps.FOPException;
 import org.apache.fop.fo.Constants;
 import org.apache.fop.fo.pagination.SimplePageMaster;
 
@@ -113,8 +115,9 @@
     /**
      * Copy constructor.
      * @param original the original PageViewport to copy from
+     * @throws FOPException when cloning of the page is not supported
      */
-    public PageViewport(PageViewport original) {
+    public PageViewport(PageViewport original) throws FOPException {
         if (original.extensionAttachments != null) {
             setExtensionAttachments(original.extensionAttachments);
         }
@@ -124,7 +127,11 @@
         this.pageIndex = original.pageIndex;
         this.pageNumber = original.pageNumber;
         this.pageNumberString = original.pageNumberString;
-        this.page = (Page)original.page.clone();
+        try {
+            this.page = (Page) original.page.clone();
+        } catch (CloneNotSupportedException e) {
+            throw new FOPException(e);
+        }
         this.viewArea = new Rectangle(original.viewArea);
         this.simplePageMasterName = original.simplePageMasterName;
         this.blank = original.blank;
@@ -546,13 +553,12 @@
         }
     }
 
-    /**
-     * Clone this page.
-     * Used by the page master to create a copy of an original page.
-     * @return a copy of this page and associated viewports
-     */
-    public Object clone() {
-        return new PageViewport(this);
+    /** {@inheritDoc} */
+    public Object clone() throws CloneNotSupportedException {
+        PageViewport pvp = (PageViewport) super.clone();
+        pvp.page = (Page) page.clone();
+        pvp.viewArea = (Rectangle) viewArea.clone();
+        return pvp;
     }
 
     /**
Index: src/java/org/apache/fop/area/Page.java
===================================================================
--- src/java/org/apache/fop/area/Page.java	(revision 985806)
+++ src/java/org/apache/fop/area/Page.java	(working copy)
@@ -61,10 +61,9 @@
     private boolean fakeNonEmpty = false;
 
     /**
-     *  Empty constructor, for cloning
+     *  Empty constructor
      */
-    public Page() {
-    }
+    public Page() { }
 
     /**
      * Constructor
@@ -251,14 +250,9 @@
         }
     }
 
-    /**
-     * Clone this page.
-     * This returns a new page with a clone of all the regions.
-     *
-     * @return a new clone of this page
-     */
-    public Object clone() {
-        Page p = new Page();
+    /** {@inheritDoc} */
+    public Object clone() throws CloneNotSupportedException {
+        Page p = (Page) super.clone();
         if (regionBefore != null) {
             p.regionBefore = (RegionViewport)regionBefore.clone();
         }
Index: src/java/org/apache/fop/area/AreaTreeObject.java
===================================================================
--- src/java/org/apache/fop/area/AreaTreeObject.java	(revision 985806)
+++ src/java/org/apache/fop/area/AreaTreeObject.java	(working copy)
@@ -19,7 +19,9 @@
 
 package org.apache.fop.area;
 
+import java.util.ArrayList;
 import java.util.Collections;
+import java.util.HashMap;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
@@ -31,7 +33,7 @@
 /**
  * Abstract base class for all area tree objects.
  */
-public abstract class AreaTreeObject {
+public abstract class AreaTreeObject implements Cloneable {
 
     /** Foreign attributes */
     protected Map foreignAttributes = null;
@@ -39,6 +41,18 @@
     /** Extension attachments */
     protected List/*<ExtensionAttachment>*/ extensionAttachments = null;
 
+    /** {@inheritDoc} */
+    public Object clone() throws CloneNotSupportedException {
+        AreaTreeObject ato = (AreaTreeObject) super.clone();
+        if (foreignAttributes != null) {
+            ato.foreignAttributes = (Map) ((HashMap) foreignAttributes).clone();
+        }
+        if (extensionAttachments != null) {
+            ato.extensionAttachments = (List) ((ArrayList) extensionAttachments).clone();
+        }
+        return ato;
+    }
+
     /**
      * Sets a foreign attribute.
      * @param name the qualified name of the attribute
@@ -46,7 +60,7 @@
      */
     public void setForeignAttribute(QName name, String value) {
         if (this.foreignAttributes == null) {
-            this.foreignAttributes = new java.util.HashMap();
+            this.foreignAttributes = new HashMap();
         }
         this.foreignAttributes.put(name, value);
     }
@@ -92,7 +106,7 @@
 
     private void prepareExtensionAttachmentContainer() {
         if (this.extensionAttachments == null) {
-            this.extensionAttachments = new java.util.ArrayList/*<ExtensionAttachment>*/();
+            this.extensionAttachments = new ArrayList/*<ExtensionAttachment>*/();
         }
     }
 
Index: src/java/org/apache/fop/area/RegionReference.java
===================================================================
--- src/java/org/apache/fop/area/RegionReference.java	(revision 985806)
+++ src/java/org/apache/fop/area/RegionReference.java	(working copy)
@@ -134,17 +134,10 @@
         addChildArea(block);
     }
 
-    /**
-     * Clone this region.
-     * This is used when cloning the page by the page master.
-     *
-     * @return a copy of this region reference area
-     */
-    public Object clone() {
-        RegionReference rr = new RegionReference(regionClass, regionName, regionViewport);
-        rr.ctm = ctm;
-        rr.setIPD(getIPD());
-        rr.blocks = (ArrayList)blocks.clone();
+    /** {@inheritDoc} */
+    public Object clone() throws CloneNotSupportedException {
+        RegionReference rr = (RegionReference) super.clone();
+        rr.blocks = (ArrayList) blocks.clone();
         return rr;
     }
 
Index: src/java/org/apache/fop/area/Area.java
===================================================================
--- src/java/org/apache/fop/area/Area.java	(revision 985806)
+++ src/java/org/apache/fop/area/Area.java	(working copy)
@@ -20,6 +20,7 @@
 package org.apache.fop.area;
 
 import java.io.Serializable;
+import java.util.HashMap;
 import java.util.Map;
 
 import org.apache.commons.logging.Log;
@@ -37,7 +38,7 @@
 /**
  * Base object for all areas.
  */
-public class Area extends AreaTreeObject implements Serializable {
+public class Area extends AreaTreeObject implements Serializable, Cloneable {
     // stacking directions
     /**
      * Stacking left to right
@@ -137,6 +138,15 @@
     protected static Log log = LogFactory.getLog(Area.class);
 
 
+    /** {@inheritDoc} */
+    public Object clone() throws CloneNotSupportedException {
+        Area area = (Area) super.clone();
+        if (props != null) {
+            area.props = (Map) ((HashMap) props).clone();
+        }
+        return area;
+    }
+
     /**
      * Get the area class of this area.
      *
@@ -377,7 +387,7 @@
      */
     public void addTrait(Object traitCode, Object prop) {
         if (props == null) {
-            props = new java.util.HashMap(20);
+            props = new HashMap(20);
         }
         props.put(traitCode, prop);
     }
Index: src/java/org/apache/fop/area/RegionViewport.java
===================================================================
--- src/java/org/apache/fop/area/RegionViewport.java	(revision 985806)
+++ src/java/org/apache/fop/area/RegionViewport.java	(working copy)
@@ -106,21 +106,11 @@
         setRegionReference((RegionReference) in.readObject());
     }
 
-    /**
-     * Clone this region viewport.
-     * Used when creating a copy from the page master.
-     *
-     * @return a new copy of this region viewport
-     */
-    public Object clone() {
-        RegionViewport rv = new RegionViewport((Rectangle2D)viewArea.clone());
-        rv.regionReference = (RegionReference)regionReference.clone();
-        if (props != null) {
-            rv.props = new HashMap(props);
-        }
-        if (foreignAttributes != null) {
-            rv.foreignAttributes = new HashMap(foreignAttributes);
-        }
+    /** {@inheritDoc} */
+    public Object clone() throws CloneNotSupportedException {
+        RegionViewport rv = (RegionViewport) super.clone();
+        rv.viewArea = (Rectangle2D) viewArea.clone();
+        rv.regionReference = (RegionReference) regionReference.clone();
         return rv;
     }
 }
Index: src/codegen/unicode/java/org/apache/fop/hyphenation/UnicodeClasses.java
===================================================================
--- src/codegen/unicode/java/org/apache/fop/hyphenation/UnicodeClasses.java	(revision 985806)
+++ src/codegen/unicode/java/org/apache/fop/hyphenation/UnicodeClasses.java	(working copy)
@@ -50,7 +50,7 @@
  * The methods fromJava and fromTeX are commented out because they are not Java 1.4 compliant.
  */
 public final class UnicodeClasses {
-    
+
     /** directory containing unicode properties files */
     public static final String UNICODE_DIR = "http://www.unicode.org/Public/UNIDATA/";
 
@@ -73,7 +73,7 @@
         w.write("<!--   in 'src/java/org/apache/fop/hyphenation'   -->\n");
         w.write("<!-- * commit the changed file                    -->\n");
     }
-    
+
     /**
      * Generate classes.xml from Java's compiled-in Unicode Character Database
      * @param hexcode whether to prefix each class with the hexcode (only for debugging purposes)
@@ -99,7 +99,7 @@
         ow.write("<classes>\n");
         // loop over the first Unicode plane
         for (int code = Character.MIN_VALUE; code <= maxChar; ++code) {
-            
+
             // skip surrogate area
             if (code == Character.MIN_SURROGATE) {
                 code = Character.MAX_SURROGATE;
@@ -114,7 +114,7 @@
                     || Character.getType(code) == Character.OTHER_LETTER)) {
                 continue;
             }
-            
+
             // skip a number of blocks
             Character.UnicodeBlock ubi = Character.UnicodeBlock.of(code);
             if (ubi.equals(Character.UnicodeBlock.SUPERSCRIPTS_AND_SUBSCRIPTS)
@@ -146,21 +146,21 @@
         ow.flush();
         ow.close();
     }
-    
-    
+
+
     /**
      * The column numbers in the UCD file
      */
     public static final int UNICODE = 0, GENERAL_CATEGORY = 2, SIMPLE_UPPERCASE_MAPPING = 12,
     SIMPLE_LOWERCASE_MAPPING = 13, SIMPLE_TITLECASE_MAPPING = 14, NUM_FIELDS = 15;
-    
+
     /**
      * Generate classes.xml from Unicode Character Database files
      * @param hexcode whether to prefix each class with the hexcode (only for debugging purposes)
      * @param unidataPath path to the directory with UCD files  
      * @param outfilePath output file
      * @throws IOException if the input files are not found
-     * @throws URISyntaxException 
+     * @throws URISyntaxException if unidataPath cannot be converted to a URI
      */
     public static void fromUCD(boolean hexcode, String unidataPath, String outfilePath)
     throws IOException, URISyntaxException {
@@ -175,7 +175,7 @@
             throw new FileNotFoundException
             ("URI with file or http scheme required for UNIDATA input directory");
         }
-        
+
         File f = new File(outfilePath);
         if (f.exists()) {
             f.delete();
@@ -183,7 +183,7 @@
         f.createNewFile();
         FileOutputStream fw = new FileOutputStream(f);
         OutputStreamWriter ow = new OutputStreamWriter(fw, "utf-8");
-        
+
         URI inuri = unidata.resolve("Blocks.txt");
         InputStream inis = null;
         if (scheme.equals("file")) {
@@ -253,7 +253,7 @@
                 if (j < blockNames.length) {
                     continue;
                 }
-            
+
                 int uppercode = -1, titlecode = -1;
                 if (!"".equals(fields[SIMPLE_UPPERCASE_MAPPING])) {
                     uppercode = Integer.parseInt(fields[SIMPLE_UPPERCASE_MAPPING], 16);
@@ -345,7 +345,7 @@
         inbr.close();
     }
 
-    
+
     /**
      * @param args [--hexcode] [--java|--ucd|--tex] outfile [infile]
      * @throws IOException if the input file cannot be found
@@ -375,7 +375,7 @@
         if (++i < args.length) {
             infile = args[i];
         }
-        
+
         if (type.equals("java") && infile != null) {
                 System.err.println("Type java does not allow an infile");
                 System.exit(1);
