diff --git a/fop-core/src/main/java/org/apache/fop/fonts/autodetect/FontFileFinder.java b/fop-core/src/main/java/org/apache/fop/fonts/autodetect/FontFileFinder.java index e6b9a2c9e8a..11b18ef34f7 100644 --- a/fop-core/src/main/java/org/apache/fop/fonts/autodetect/FontFileFinder.java +++ b/fop-core/src/main/java/org/apache/fop/fonts/autodetect/FontFileFinder.java @@ -84,10 +84,8 @@ protected static IOFileFilter getDirectoryFilter() { 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()); } /** diff --git a/fop-core/src/test/java/org/apache/fop/accessibility/pdf/MissingLanguageWarningTestCase.java b/fop-core/src/test/java/org/apache/fop/accessibility/pdf/MissingLanguageWarningTestCase.java index 02551c8da9f..7a95300fad0 100644 --- a/fop-core/src/test/java/org/apache/fop/accessibility/pdf/MissingLanguageWarningTestCase.java +++ b/fop-core/src/test/java/org/apache/fop/accessibility/pdf/MissingLanguageWarningTestCase.java @@ -79,7 +79,7 @@ public void setUp() throws Exception { 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 diff --git a/fop-core/src/test/java/org/apache/fop/events/EventProcessingTestCase.java b/fop-core/src/test/java/org/apache/fop/events/EventProcessingTestCase.java index 77883710483..0addf16dc1b 100644 --- a/fop-core/src/test/java/org/apache/fop/events/EventProcessingTestCase.java +++ b/fop-core/src/test/java/org/apache/fop/events/EventProcessingTestCase.java @@ -79,7 +79,7 @@ public void doTest(InputStream inStream, URI fopConf, String expectedEventID, St 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()); diff --git a/fop-core/src/test/java/org/apache/fop/events/FlowNamedNotMappedTestCase.java b/fop-core/src/test/java/org/apache/fop/events/FlowNamedNotMappedTestCase.java index 12d23dac375..3e6ba3aafc9 100644 --- a/fop-core/src/test/java/org/apache/fop/events/FlowNamedNotMappedTestCase.java +++ b/fop-core/src/test/java/org/apache/fop/events/FlowNamedNotMappedTestCase.java @@ -64,7 +64,7 @@ public void testFlowNamedNotMapped() throws Exception { 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(); diff --git a/fop-core/src/test/java/org/apache/fop/fonts/FontSelectorTestCase.java b/fop-core/src/test/java/org/apache/fop/fonts/FontSelectorTestCase.java index 10c907296b5..90671d59dd2 100644 --- a/fop-core/src/test/java/org/apache/fop/fonts/FontSelectorTestCase.java +++ b/fop-core/src/test/java/org/apache/fop/fonts/FontSelectorTestCase.java @@ -148,7 +148,7 @@ private CommonFont makeCommonFont() throws PropertyException { @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()); diff --git a/fop-core/src/test/java/org/apache/fop/intermediate/AbstractIntermediateTest.java b/fop-core/src/test/java/org/apache/fop/intermediate/AbstractIntermediateTest.java index 35b84be4872..598bcfbb4f2 100644 --- a/fop-core/src/test/java/org/apache/fop/intermediate/AbstractIntermediateTest.java +++ b/fop-core/src/test/java/org/apache/fop/intermediate/AbstractIntermediateTest.java @@ -192,7 +192,7 @@ public void testParserToPDF() throws Exception { out = new FileOutputStream(tgtFile); out = new BufferedOutputStream(out); } else { - out = NullOutputStream.NULL_OUTPUT_STREAM; + out = NullOutputStream.INSTANCE; } try { Source src = new DOMSource(intermediate); diff --git a/fop-core/src/test/java/org/apache/fop/memory/MemoryEater.java b/fop-core/src/test/java/org/apache/fop/memory/MemoryEater.java index 788b101b883..428f53eac48 100644 --- a/fop-core/src/test/java/org/apache/fop/memory/MemoryEater.java +++ b/fop-core/src/test/java/org/apache/fop/memory/MemoryEater.java @@ -77,7 +77,7 @@ private void eatMemory(int callIndex, File foFile, int replicatorRepeats, FopFac 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); diff --git a/fop-core/src/test/java/org/apache/fop/render/RendererFactoryTestCase.java b/fop-core/src/test/java/org/apache/fop/render/RendererFactoryTestCase.java index c2597ad7e0e..90afb97cdc0 100644 --- a/fop-core/src/test/java/org/apache/fop/render/RendererFactoryTestCase.java +++ b/fop-core/src/test/java/org/apache/fop/render/RendererFactoryTestCase.java @@ -112,18 +112,18 @@ public void testFOEventHandlerLevel() throws Exception { 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 void testFOEventHandlerLevel() throws Exception { } 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); diff --git a/fop-core/src/test/java/org/apache/fop/threading/FOPTestbed.java b/fop-core/src/test/java/org/apache/fop/threading/FOPTestbed.java index bfc341920fd..5dc87d9c12b 100644 --- a/fop-core/src/test/java/org/apache/fop/threading/FOPTestbed.java +++ b/fop-core/src/test/java/org/apache/fop/threading/FOPTestbed.java @@ -266,7 +266,7 @@ public void execute() throws Exception { 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); diff --git a/fop-core/src/test/java/org/apache/fop/visual/BatchDiffer.java b/fop-core/src/test/java/org/apache/fop/visual/BatchDiffer.java index c9a2d477ecc..8a4b44b7aae 100644 --- a/fop-core/src/test/java/org/apache/fop/visual/BatchDiffer.java +++ b/fop-core/src/test/java/org/apache/fop/visual/BatchDiffer.java @@ -175,7 +175,7 @@ public void runBatch(Configuration cfg) { manualFilter = manualFilter + '*'; } filter = new AndFileFilter( - new WildcardFileFilter(manualFilter), filter); + WildcardFileFilter.builder().setWildcards(manualFilter).get(), filter); } int maxfiles = cfg.getChild("max-files").getValueAsInteger(-1);