]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Bugzilla #43464:
authorJeremias Maerki <jeremias@apache.org>
Fri, 5 Oct 2007 12:34:33 +0000 (12:34 +0000)
committerJeremias Maerki <jeremias@apache.org>
Fri, 5 Oct 2007 12:34:33 +0000 (12:34 +0000)
There is no need to cast the sources into a StreamSource to determine
the SystemId. With this cast DOMSources or other non-StreamSources lead in a
ClassCastException.
Submitted by: Bruno Feurer <dev.at.brunof.com>

git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@582230 13f79535-47bb-0310-9956-ffa450edef68

src/java/org/apache/fop/render/PrintRendererConfigurator.java
status.xml

index d9b92296594f59dec29ec9c2bab325110e511a75..0b352c3a17e554302877de78bebc989b240d191c 100644 (file)
@@ -25,7 +25,7 @@ import java.net.URL;
 import java.util.Iterator;
 import java.util.List;
 
-import javax.xml.transform.stream.StreamSource;
+import javax.xml.transform.Source;
 
 import org.apache.avalon.framework.configuration.Configuration;
 import org.apache.avalon.framework.configuration.ConfigurationException;
@@ -247,7 +247,7 @@ public class PrintRendererConfigurator extends AbstractRendererConfigurator
             return null;
         }
         if (embedUrl != null) {
-            StreamSource source = (StreamSource)fontResolver.resolve(embedUrl);
+            Source source = fontResolver.resolve(embedUrl);
             if (source == null) {
                 LogUtil.handleError(log,
                         "Failed to resolve font with embed-url '" + embedUrl + "'", strict);
@@ -256,7 +256,7 @@ public class PrintRendererConfigurator extends AbstractRendererConfigurator
             embedUrl = source.getSystemId(); // absolute path/url
         }
         if (metricsUrl != null) {
-            StreamSource source = (StreamSource)fontResolver.resolve(metricsUrl);
+            Source source = fontResolver.resolve(metricsUrl);
             if (source == null) {
                 LogUtil.handleError(log,
                         "Failed to resolve font with metric-url '" + metricsUrl + "'", strict);
index f9fb720d717841394375aafc80de9c4ade4e986e..f04c2b08149f039b7c263dbace67bbaddfd1854f 100644 (file)
@@ -28,6 +28,9 @@
 
   <changes>
     <release version="FOP Trunk">
+      <action context="Code" dev="JM" type="fix" fixes-bug="43464" due-to="Bruno Feurer">
+        Fix to avoid a ClassCastException in renderer configuration.
+      </action>
       <action context="Code" dev="JM" type="fix" fixes-bug="43439" due-to="Adrian Cumiskey">
         Fixed the restoration of the TLE values from the intermediate format 
         for the AFP extension elements.