You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2023/06/01 18:55:11 UTC

[commons-imaging] branch master updated: Simplify API

This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-imaging.git


The following commit(s) were added to refs/heads/master by this push:
     new 4671c3dd Simplify API
4671c3dd is described below

commit 4671c3dd4d0e7b7003280d1ef4dbf56ec139185a
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Thu Jun 1 14:55:07 2023 -0400

    Simplify API
---
 .../java/org/apache/commons/imaging/bytesource/ByteSource.java |  4 ----
 .../commons/imaging/formats/tiff/TiffImageParserTest.java      | 10 +++++++---
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/src/main/java/org/apache/commons/imaging/bytesource/ByteSource.java b/src/main/java/org/apache/commons/imaging/bytesource/ByteSource.java
index 0e83a67c..a5043459 100644
--- a/src/main/java/org/apache/commons/imaging/bytesource/ByteSource.java
+++ b/src/main/java/org/apache/commons/imaging/bytesource/ByteSource.java
@@ -36,10 +36,6 @@ public abstract class ByteSource {
         return new ByteSourceFile(file);
     }
 
-    public static ByteSource file(final String file) {
-        return file(new File(file));
-    }
-
     public static ByteSource inputStream(final InputStream is, final String name) {
         return new ByteSourceInputStream(is, name);
     }
diff --git a/src/test/java/org/apache/commons/imaging/formats/tiff/TiffImageParserTest.java b/src/test/java/org/apache/commons/imaging/formats/tiff/TiffImageParserTest.java
index febf4dbf..1d692cd4 100644
--- a/src/test/java/org/apache/commons/imaging/formats/tiff/TiffImageParserTest.java
+++ b/src/test/java/org/apache/commons/imaging/formats/tiff/TiffImageParserTest.java
@@ -19,6 +19,8 @@ package org.apache.commons.imaging.formats.tiff;
 
 import static org.junit.jupiter.api.Assertions.assertThrows;
 
+import java.io.File;
+
 import org.apache.commons.imaging.ImagingFormatException;
 import org.apache.commons.imaging.bytesource.ByteSource;
 import org.junit.jupiter.api.Test;
@@ -30,8 +32,10 @@ public class TiffImageParserTest {
 
     @Test
     public void testOssFuzzIssue53669() {
-        assertThrows(ImagingFormatException.class, () -> new TiffImageParser().getBufferedImage(ByteSource.file(
-                "src/test/resources/images/tiff/oss-fuzz-53669/clusterfuzz-testcase-minimized-ImagingTiffFuzzer-5965016805539840.tiff"),
-                null));
+        assertThrows(ImagingFormatException.class,
+                () -> new TiffImageParser().getBufferedImage(
+                        ByteSource.file(new File(
+                                "src/test/resources/images/tiff/oss-fuzz-53669/clusterfuzz-testcase-minimized-ImagingTiffFuzzer-5965016805539840.tiff")),
+                        null));
     }
 }