]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Update deprecated api usage
authorSimon Steiner <ssteiner@apache.org>
Thu, 10 Oct 2024 09:49:24 +0000 (10:49 +0100)
committerSimon Steiner <ssteiner@apache.org>
Thu, 10 Oct 2024 09:49:24 +0000 (10:49 +0100)
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/fonts/FontSelectorTestCase.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/threading/FOPTestbed.java
fop-core/src/test/java/org/apache/fop/visual/BatchDiffer.java

index e6b9a2c9e8ab8705b170b91d7e7124f79889abc2..11b18ef34f79ee1ffddbafe0a76d4c976617c97c 100644 (file)
@@ -84,10 +84,8 @@ public class FontFileFinder extends DirectoryWalker implements FontFinder {
     protected static IOFileFilter getFileFilter() {
         return FileFilterUtils.and(
                 FileFilterUtils.fileFileFilter(),
-                new WildcardFileFilter(
-                        new String[] {"*.ttf", "*.otf", "*.pfb", "*.ttc"},
-                        IOCase.INSENSITIVE)
-        );
+                WildcardFileFilter.builder().setIoCase(IOCase.INSENSITIVE)
+                        .setWildcards("*.ttf", "*.otf", "*.pfb", "*.ttc").get());
     }
 
     /**
index 02551c8da9fad6fca3d59f7fc4e6c2b666ddf514..7a95300fad03777ae3539d84c5a3da540c474705 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, NullOutputStream.NULL_OUTPUT_STREAM);
+        fop = fopFactory.newFop(MimeConstants.MIME_PDF, userAgent, NullOutputStream.INSTANCE);
     }
 
     @Test
index 77883710483522638918f03277056104cbefc9af..0addf16dc1bee513b1b35088393dc64a6d2b5ecc 100644 (file)
@@ -79,7 +79,7 @@ public class EventProcessingTestCase {
         FOUserAgent userAgent = fopFactory.newFOUserAgent();
 
         userAgent.getEventBroadcaster().addEventListener(eventChecker);
-        Fop fop = fopFactory.newFop(mimeType, userAgent, NullOutputStream.NULL_OUTPUT_STREAM);
+        Fop fop = fopFactory.newFop(mimeType, userAgent, NullOutputStream.INSTANCE);
         Transformer transformer = tFactory.newTransformer();
         Source src = new StreamSource(inStream);
         Result res = new SAXResult(fop.getDefaultHandler());
index 12d23dac37598894ea7257947a9b3b9808542207..3e6ba3aafc96b118a46e2d03bc2ae4dc26aa2522 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, NullOutputStream.NULL_OUTPUT_STREAM);
+        fop = fopFactory.newFop(MimeConstants.MIME_PDF, userAgent, NullOutputStream.INSTANCE);
         Source src = new StreamSource(new FileInputStream("test/events/flowNameNotMapped.fo"));
         SAXResult res = new SAXResult(fop.getDefaultHandler());
         Transformer transformer = TransformerFactory.newInstance().newTransformer();
index 10c907296b5100ae64d55c011a75692da1f378ca..90671d59dd210c21b27a94daf0360cd3c04678ed 100644 (file)
@@ -148,7 +148,7 @@ public class FontSelectorTestCase {
     @Test
     public void testFontCacheWithThreads() throws Exception {
         PrintStream old = System.err;
-        System.setErr(new NullPrintStream());
+        System.setErr(NullPrintStream.INSTANCE);
         ExecutorService executor = Executors.newFixedThreadPool(10);
         for (int i = 0; i < 100000; i++) {
             executor.submit(new FontTask());
index 35b84be4872b631a3533271363231a7e1301ac00..598bcfbb4f2a6c8320fe589afcd9890b1e292862 100644 (file)
@@ -192,7 +192,7 @@ public abstract class AbstractIntermediateTest {
             out = new FileOutputStream(tgtFile);
             out = new BufferedOutputStream(out);
         } else {
-            out = NullOutputStream.NULL_OUTPUT_STREAM;
+            out = NullOutputStream.INSTANCE;
         }
         try {
             Source src = new DOMSource(intermediate);
index 788b101b883c3251b481b4174ce204622b9b877d..428f53eac489d27f0e0cc6ef1e4960fec7b1290a 100644 (file)
@@ -77,7 +77,7 @@ public final class MemoryEater {
         Transformer transformer = replicatorTemplates.newTransformer();
         transformer.setParameter("repeats", replicatorRepeats);
 
-        OutputStream out = NullOutputStream.NULL_OUTPUT_STREAM; //write to /dev/nul
+        OutputStream out = NullOutputStream.INSTANCE; //write to /dev/nul
         try {
             FOUserAgent userAgent = fopFactory.newFOUserAgent();
             Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF, userAgent, out);
index c2597ad7e0e42871fc112d270c065c6d012820c3..90afb97cdc0184812c89dd744697f41a35518363 100644 (file)
@@ -112,18 +112,18 @@ public class RendererFactoryTestCase {
 
         ua = fopFactory.newFOUserAgent();
         foEventHandler = factory.createFOEventHandler(
-                ua, MimeConstants.MIME_PDF, NullOutputStream.NULL_OUTPUT_STREAM);
+                ua, MimeConstants.MIME_PDF, NullOutputStream.INSTANCE);
         assertTrue(foEventHandler instanceof AreaTreeHandler);
 
         ua = fopFactory.newFOUserAgent();
         foEventHandler = factory.createFOEventHandler(
-                ua, MimeConstants.MIME_RTF, NullOutputStream.NULL_OUTPUT_STREAM);
+                ua, MimeConstants.MIME_RTF, NullOutputStream.INSTANCE);
         assertTrue(foEventHandler instanceof RTFHandler);
 
         ua = fopFactory.newFOUserAgent();
         try {
             foEventHandler = factory.createFOEventHandler(
-                    ua, "invalid/format", NullOutputStream.NULL_OUTPUT_STREAM);
+                    ua, "invalid/format", NullOutputStream.INSTANCE);
             fail("Expected UnsupportedOperationException");
         } catch (UnsupportedOperationException uoe) {
             //expected
@@ -139,7 +139,7 @@ public class RendererFactoryTestCase {
         }
 
         ua = fopFactory.newFOUserAgent();
-        overrideFOEventHandler = new RTFHandler(ua, NullOutputStream.NULL_OUTPUT_STREAM);
+        overrideFOEventHandler = new RTFHandler(ua, NullOutputStream.INSTANCE);
         ua.setFOEventHandlerOverride(overrideFOEventHandler);
         foEventHandler = factory.createFOEventHandler(
                 ua, null, null);
index bfc341920fdb0d5dca199918999e1dc4c99c5230..5dc87d9c12b77d40f22ac86dd11db8e95d027840 100644 (file)
@@ -266,7 +266,7 @@ public class FOPTestbed
                 File outfile = new File(outputDir, df.format(num) + fop.getTargetFileExtension());
                 OutputStream out;
                 if (writeToDevNull) {
-                    out = NullOutputStream.NULL_OUTPUT_STREAM;
+                    out = NullOutputStream.INSTANCE;
                 } else {
                     out = new java.io.FileOutputStream(outfile);
                     out = new java.io.BufferedOutputStream(out);
index c9a2d477eccc2e46d02af29c96140ac6120d9125..8a4b44b7aaee3d164ade010e7c5917537765d0db 100644 (file)
@@ -175,7 +175,7 @@ public class BatchDiffer {
                     manualFilter = manualFilter + '*';
                 }
                 filter = new AndFileFilter(
-                        new WildcardFileFilter(manualFilter), filter);
+                        WildcardFileFilter.builder().setWildcards(manualFilter).get(), filter);
             }
 
             int maxfiles = cfg.getChild("max-files").getValueAsInteger(-1);