]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Fix compile warnings
authorSimon Steiner <ssteiner@apache.org>
Thu, 3 Feb 2022 15:00:46 +0000 (15:00 +0000)
committerSimon Steiner <ssteiner@apache.org>
Thu, 3 Feb 2022 15:00:46 +0000 (15:00 +0000)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1897728 13f79535-47bb-0310-9956-ffa450edef68

fop-core/src/main/java/org/apache/fop/fonts/autodetect/FontFileFinder.java
fop-core/src/test/java/org/apache/fop/accessibility/pdf/MissingLanguageWarningTestCase.java
fop-core/src/test/java/org/apache/fop/events/EventProcessingTestCase.java
fop-core/src/test/java/org/apache/fop/events/FlowNamedNotMappedTestCase.java
fop-core/src/test/java/org/apache/fop/intermediate/AbstractIntermediateTest.java
fop-core/src/test/java/org/apache/fop/memory/MemoryEater.java
fop-core/src/test/java/org/apache/fop/render/RendererFactoryTestCase.java
fop-core/src/test/java/org/apache/fop/render/ps/ImageHandlingTestCase.java
fop-core/src/test/java/org/apache/fop/render/ps/svg/GradientTestCase.java
fop-core/src/test/java/org/apache/fop/threading/FOPTestbed.java

index 8100c4b9bfa3e469731cfa5bdec6e3e6296cfbfd..e6b9a2c9e8ab8705b170b91d7e7124f79889abc2 100644 (file)
@@ -71,7 +71,7 @@ public class FontFileFinder extends DirectoryWalker implements FontFinder {
      * @return IOFileFilter font directory filter
      */
     protected static IOFileFilter getDirectoryFilter() {
-        return FileFilterUtils.andFileFilter(
+        return FileFilterUtils.and(
                 FileFilterUtils.directoryFileFilter(),
                 FileFilterUtils.notFileFilter(FileFilterUtils.prefixFileFilter("."))
         );
@@ -82,7 +82,7 @@ public class FontFileFinder extends DirectoryWalker implements FontFinder {
      * @return IOFileFilter font file filter
      */
     protected static IOFileFilter getFileFilter() {
-        return FileFilterUtils.andFileFilter(
+        return FileFilterUtils.and(
                 FileFilterUtils.fileFileFilter(),
                 new WildcardFileFilter(
                         new String[] {"*.ttf", "*.otf", "*.pfb", "*.ttc"},
index c5d1611940d0967a7b964e3f9b77b499c5b6fd5b..97383e9e2f14d4c9a62b3fb9a752c15a5b6ca2f5 100644 (file)
@@ -79,7 +79,7 @@ public class MissingLanguageWarningTestCase {
         userAgent.setAccessibility(true);
         eventChecker = new MissingLanguageEventChecker();
         userAgent.getEventBroadcaster().addEventListener(eventChecker);
-        fop = fopFactory.newFop(MimeConstants.MIME_PDF, userAgent, new NullOutputStream());
+        fop = fopFactory.newFop(MimeConstants.MIME_PDF, userAgent, NullOutputStream.NULL_OUTPUT_STREAM);
     }
 
     @Test
index 5e96883ece0643371c0365352614e5562adf913a..77883710483522638918f03277056104cbefc9af 100644 (file)
@@ -79,7 +79,7 @@ public class EventProcessingTestCase {
         FOUserAgent userAgent = fopFactory.newFOUserAgent();
 
         userAgent.getEventBroadcaster().addEventListener(eventChecker);
-        Fop fop = fopFactory.newFop(mimeType, userAgent, new NullOutputStream());
+        Fop fop = fopFactory.newFop(mimeType, userAgent, NullOutputStream.NULL_OUTPUT_STREAM);
         Transformer transformer = tFactory.newTransformer();
         Source src = new StreamSource(inStream);
         Result res = new SAXResult(fop.getDefaultHandler());
index 802c974502b218fcf9e6afac2bc6ef67d52a55ca..12d23dac37598894ea7257947a9b3b9808542207 100644 (file)
@@ -64,7 +64,7 @@ public class FlowNamedNotMappedTestCase {
         FOUserAgent userAgent = fopFactory.newFOUserAgent();
         flowChecker = new FlowNameNotMappedEventChecker();
         userAgent.getEventBroadcaster().addEventListener(flowChecker);
-        fop = fopFactory.newFop(MimeConstants.MIME_PDF, userAgent, new NullOutputStream());
+        fop = fopFactory.newFop(MimeConstants.MIME_PDF, userAgent, NullOutputStream.NULL_OUTPUT_STREAM);
         Source src = new StreamSource(new FileInputStream("test/events/flowNameNotMapped.fo"));
         SAXResult res = new SAXResult(fop.getDefaultHandler());
         Transformer transformer = TransformerFactory.newInstance().newTransformer();
index 1ebf698667166e8a13f9802e7fe7569d60154f69..35b84be4872b631a3533271363231a7e1301ac00 100644 (file)
@@ -192,7 +192,7 @@ public abstract class AbstractIntermediateTest {
             out = new FileOutputStream(tgtFile);
             out = new BufferedOutputStream(out);
         } else {
-            out = new NullOutputStream();
+            out = NullOutputStream.NULL_OUTPUT_STREAM;
         }
         try {
             Source src = new DOMSource(intermediate);
index 537003b6e8d9df5c91a8018cdbeb6a54e781021f..788b101b883c3251b481b4174ce204622b9b877d 100644 (file)
@@ -77,7 +77,7 @@ public final class MemoryEater {
         Transformer transformer = replicatorTemplates.newTransformer();
         transformer.setParameter("repeats", replicatorRepeats);
 
-        OutputStream out = new NullOutputStream(); //write to /dev/nul
+        OutputStream out = NullOutputStream.NULL_OUTPUT_STREAM; //write to /dev/nul
         try {
             FOUserAgent userAgent = fopFactory.newFOUserAgent();
             Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF, userAgent, out);
index 1fa4ae0fa93c610bf7cce2907b9a8e5eef026eb1..c2597ad7e0e42871fc112d270c065c6d012820c3 100644 (file)
@@ -112,18 +112,18 @@ public class RendererFactoryTestCase {
 
         ua = fopFactory.newFOUserAgent();
         foEventHandler = factory.createFOEventHandler(
-                ua, MimeConstants.MIME_PDF, new NullOutputStream());
+                ua, MimeConstants.MIME_PDF, NullOutputStream.NULL_OUTPUT_STREAM);
         assertTrue(foEventHandler instanceof AreaTreeHandler);
 
         ua = fopFactory.newFOUserAgent();
         foEventHandler = factory.createFOEventHandler(
-                ua, MimeConstants.MIME_RTF, new NullOutputStream());
+                ua, MimeConstants.MIME_RTF, NullOutputStream.NULL_OUTPUT_STREAM);
         assertTrue(foEventHandler instanceof RTFHandler);
 
         ua = fopFactory.newFOUserAgent();
         try {
             foEventHandler = factory.createFOEventHandler(
-                    ua, "invalid/format", new NullOutputStream());
+                    ua, "invalid/format", NullOutputStream.NULL_OUTPUT_STREAM);
             fail("Expected UnsupportedOperationException");
         } catch (UnsupportedOperationException uoe) {
             //expected
@@ -139,7 +139,7 @@ public class RendererFactoryTestCase {
         }
 
         ua = fopFactory.newFOUserAgent();
-        overrideFOEventHandler = new RTFHandler(ua, new NullOutputStream());
+        overrideFOEventHandler = new RTFHandler(ua, NullOutputStream.NULL_OUTPUT_STREAM);
         ua.setFOEventHandlerOverride(overrideFOEventHandler);
         foEventHandler = factory.createFOEventHandler(
                 ua, null, null);
index 3c05e9ad7baeeae97b7605d32be70c7f7c003db0..c8baf8ad7efebb3079152ec632081086bea923cc 100644 (file)
@@ -184,7 +184,7 @@ public class ImageHandlingTestCase extends AbstractPostScriptTest {
                 + "rotate=\"30 30 0 15\">Hello SVG with FOP</text>\n"
                 + "</svg>";
         SAXSVGDocumentFactory factory = new SAXSVGDocumentFactory(null);
-        Document doc = factory.createDocument(null, IOUtils.toInputStream(svg));
+        Document doc = factory.createDocument(null, IOUtils.toInputStream(svg, "utf-8"));
         ByteArrayOutputStream bos = new ByteArrayOutputStream();
         new PSImageHandlerSVG().handleImage(
                 new PSRenderingContext(ua, new PSGenerator(bos), new FontInfo()),
index 35b3bc9b7d3d33f4b2ff63d8021ad7225e6b7309..80e40dbfd326381c0becd91cdaa883b5d376322b 100644 (file)
@@ -68,7 +68,7 @@ public class GradientTestCase {
         svgGraphics2D.setGraphicContext(new GraphicContext());
         svgGraphics2D.translate(100, 100);
         svgGraphics2D.applyPaint(gradient, true);
-        String expected = IOUtils.toString(getClass().getResourceAsStream(expectedResourceName));
+        String expected = IOUtils.toString(getClass().getResourceAsStream(expectedResourceName), "utf-8");
         assertEquals(expected.replace("\r", ""), out.toString());
     }
 
index 7f6319ba8dc579dc939dec8266d4619764d5c707..bfc341920fdb0d5dca199918999e1dc4c99c5230 100644 (file)
@@ -266,7 +266,7 @@ public class FOPTestbed
                 File outfile = new File(outputDir, df.format(num) + fop.getTargetFileExtension());
                 OutputStream out;
                 if (writeToDevNull) {
-                    out = new NullOutputStream();
+                    out = NullOutputStream.NULL_OUTPUT_STREAM;
                 } else {
                     out = new java.io.FileOutputStream(outfile);
                     out = new java.io.BufferedOutputStream(out);