]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Copy attributes since some XML parsers might reuse the Attributes instance.
authorJeremias Maerki <jeremias@apache.org>
Thu, 21 Oct 2010 14:12:07 +0000 (14:12 +0000)
committerJeremias Maerki <jeremias@apache.org>
Thu, 21 Oct 2010 14:12:07 +0000 (14:12 +0000)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1026006 13f79535-47bb-0310-9956-ffa450edef68

src/java/org/apache/fop/render/afp/extensions/AFPExtensionHandler.java
src/java/org/apache/fop/render/pdf/extensions/PDFExtensionHandler.java
src/java/org/apache/fop/render/ps/extensions/PSExtensionHandler.java

index 5652a49bfee58bd98efdb0c0446c65dbde966cb0..f2e77ec3325ee183bf91e83745cebc398de0eedf 100644 (file)
@@ -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)
index d285904a89e1bc54de1b4f2083f8d926dca7e565..04c95545c2bc1ff7c5cc917982fcbc9527c89747 100644 (file)
@@ -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
index dee918f194425edcd1b8164b2c8e88785e61fb27..bf970d0a6134851ba3c0cd58c25974d6889031d7 100644 (file)
@@ -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)