diff options
author | Jeremias Maerki <jeremias@apache.org> | 2010-10-21 14:12:07 +0000 |
---|---|---|
committer | Jeremias Maerki <jeremias@apache.org> | 2010-10-21 14:12:07 +0000 |
commit | 2089591b3d2595369e0d32fb9d2f783c87fa9499 (patch) | |
tree | 7e900c1b91c97973121e8fb544aec1957dbfbd63 /src/java | |
parent | e7e29079203c8f847be894289e9bc177fba06cd8 (diff) | |
download | xmlgraphics-fop-2089591b3d2595369e0d32fb9d2f783c87fa9499.tar.gz xmlgraphics-fop-2089591b3d2595369e0d32fb9d2f783c87fa9499.zip |
Copy attributes since some XML parsers might reuse the Attributes instance.
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1026006 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java')
3 files changed, 6 insertions, 3 deletions
diff --git a/src/java/org/apache/fop/render/afp/extensions/AFPExtensionHandler.java b/src/java/org/apache/fop/render/afp/extensions/AFPExtensionHandler.java index 5652a49bf..f2e77ec33 100644 --- a/src/java/org/apache/fop/render/afp/extensions/AFPExtensionHandler.java +++ b/src/java/org/apache/fop/render/afp/extensions/AFPExtensionHandler.java @@ -24,6 +24,7 @@ import java.net.URISyntaxException; import org.xml.sax.Attributes; import org.xml.sax.SAXException; +import org.xml.sax.helpers.AttributesImpl; import org.xml.sax.helpers.DefaultHandler; import org.apache.commons.logging.Log; @@ -53,7 +54,7 @@ public class AFPExtensionHandler extends DefaultHandler throws SAXException { boolean handled = false; if (AFPExtensionAttachment.CATEGORY.equals(uri)) { - lastAttributes = attributes; + lastAttributes = new AttributesImpl(attributes); handled = true; if (localName.equals(AFPElementMapping.NO_OPERATION) || localName.equals(AFPElementMapping.TAG_LOGICAL_ELEMENT) diff --git a/src/java/org/apache/fop/render/pdf/extensions/PDFExtensionHandler.java b/src/java/org/apache/fop/render/pdf/extensions/PDFExtensionHandler.java index d285904a8..04c95545c 100644 --- a/src/java/org/apache/fop/render/pdf/extensions/PDFExtensionHandler.java +++ b/src/java/org/apache/fop/render/pdf/extensions/PDFExtensionHandler.java @@ -21,6 +21,7 @@ package org.apache.fop.render.pdf.extensions; import org.xml.sax.Attributes; import org.xml.sax.SAXException; +import org.xml.sax.helpers.AttributesImpl; import org.xml.sax.helpers.DefaultHandler; import org.apache.commons.logging.Log; @@ -48,7 +49,7 @@ public class PDFExtensionHandler extends DefaultHandler throws SAXException { boolean handled = false; if (PDFExtensionAttachment.CATEGORY.equals(uri)) { - lastAttributes = attributes; + lastAttributes = new AttributesImpl(attributes); handled = false; if (localName.equals(PDFEmbeddedFileExtensionAttachment.ELEMENT)) { //handled in endElement diff --git a/src/java/org/apache/fop/render/ps/extensions/PSExtensionHandler.java b/src/java/org/apache/fop/render/ps/extensions/PSExtensionHandler.java index dee918f19..bf970d0a6 100644 --- a/src/java/org/apache/fop/render/ps/extensions/PSExtensionHandler.java +++ b/src/java/org/apache/fop/render/ps/extensions/PSExtensionHandler.java @@ -21,6 +21,7 @@ package org.apache.fop.render.ps.extensions; import org.xml.sax.Attributes; import org.xml.sax.SAXException; +import org.xml.sax.helpers.AttributesImpl; import org.xml.sax.helpers.DefaultHandler; import org.apache.commons.logging.Log; @@ -49,7 +50,7 @@ public class PSExtensionHandler extends DefaultHandler throws SAXException { boolean handled = false; if (PSExtensionAttachment.CATEGORY.equals(uri)) { - lastAttributes = attributes; + lastAttributes = new AttributesImpl(attributes); handled = false; if (localName.equals(PSSetupCode.ELEMENT) || localName.equals(PSSetPageDevice.ELEMENT) |