diff --git a/checkstyle-suppressions.xml b/checkstyle-suppressions.xml index 8f686b44..6ade8556 100644 --- a/checkstyle-suppressions.xml +++ b/checkstyle-suppressions.xml @@ -16,6 +16,24 @@ + + + + + + + + + + diff --git a/pom.xml b/pom.xml index b3a462eb..df07dace 100644 --- a/pom.xml +++ b/pom.xml @@ -292,7 +292,7 @@ com.puppycrawl.tools checkstyle - 13.4.2 + 14.3.0 diff --git a/src/main/java/net/bramp/ffmpeg/FFmpeg.java b/src/main/java/net/bramp/ffmpeg/FFmpeg.java index 760317e7..e021206b 100644 --- a/src/main/java/net/bramp/ffmpeg/FFmpeg.java +++ b/src/main/java/net/bramp/ffmpeg/FFmpeg.java @@ -134,7 +134,7 @@ public boolean isFFmpeg() throws IOException { * @throws IllegalArgumentException if this is not the official ffmpeg binary. * @throws IOException If a I/O error occurs while executing ffmpeg. */ - private void checkIfFFmpeg() throws IllegalArgumentException, IOException { + private void checkIfFfmpeg() throws IllegalArgumentException, IOException { if (!isFFmpeg()) { throw new IllegalArgumentException( "This binary '" + path + "' is not a supported version of ffmpeg"); @@ -143,7 +143,7 @@ private void checkIfFFmpeg() throws IllegalArgumentException, IOException { /** Returns the list of supported codecs. */ public synchronized @Nonnull List codecs() throws IOException { - checkIfFFmpeg(); + checkIfFfmpeg(); if (this.codecs == null) { codecs = new ArrayList<>(); @@ -173,7 +173,7 @@ private void checkIfFFmpeg() throws IllegalArgumentException, IOException { /** Returns the list of supported filters. */ public synchronized @Nonnull List filters() throws IOException { - checkIfFFmpeg(); + checkIfFfmpeg(); if (this.filters == null) { filters = new ArrayList<>(); @@ -213,7 +213,7 @@ private void checkIfFFmpeg() throws IllegalArgumentException, IOException { /** Returns the list of supported formats. */ public synchronized @Nonnull List formats() throws IOException { - checkIfFFmpeg(); + checkIfFfmpeg(); if (this.formats == null) { formats = new ArrayList<>(); @@ -242,7 +242,7 @@ private void checkIfFFmpeg() throws IllegalArgumentException, IOException { /** Returns the list of supported pixel formats. */ public synchronized List pixelFormats() throws IOException { - checkIfFFmpeg(); + checkIfFfmpeg(); if (this.pixelFormats == null) { pixelFormats = new ArrayList<>(); @@ -275,7 +275,7 @@ public synchronized List pixelFormats() throws IOException { /** Returns the list of supported channel layouts. */ public synchronized List channelLayouts() throws IOException { - checkIfFFmpeg(); + checkIfFfmpeg(); if (this.channelLayouts == null) { Process p = runFunc.run(ImmutableList.of(path, "-layouts")); @@ -305,7 +305,7 @@ protected ProgressParser createProgressParser(ProgressListener listener) throws @Override public void run(List args) throws IOException { - checkIfFFmpeg(); + checkIfFfmpeg(); super.run(args); } diff --git a/src/main/java/net/bramp/ffmpeg/FFprobe.java b/src/main/java/net/bramp/ffmpeg/FFprobe.java index e33e1b9e..95af0201 100644 --- a/src/main/java/net/bramp/ffmpeg/FFprobe.java +++ b/src/main/java/net/bramp/ffmpeg/FFprobe.java @@ -77,7 +77,7 @@ public FFmpegProbeResult probe( // TODO: Add Probe Inputstream /** Probes media using the supplied arguments and returns the result. */ public FFmpegProbeResult probe(List args) throws IOException { - checkIfFFprobe(); + checkIfFfprobe(); Process p = runFunc.run(path(args)); try { @@ -118,7 +118,7 @@ public boolean isFFprobe() throws IOException { * @throws IllegalArgumentException if this is not the official ffprobe binary. * @throws IOException If a I/O error occurs while executing ffprobe. */ - private void checkIfFFprobe() throws IllegalArgumentException, IOException { + private void checkIfFfprobe() throws IllegalArgumentException, IOException { if (!isFFprobe()) { throw new IllegalArgumentException( "This binary '" + path + "' is not a supported version of ffprobe"); @@ -127,7 +127,7 @@ private void checkIfFFprobe() throws IllegalArgumentException, IOException { @Override public void run(List args) throws IOException { - checkIfFFprobe(); + checkIfFfprobe(); super.run(args); } diff --git a/src/test/java/net/bramp/ffmpeg/FFmpegTest.java b/src/test/java/net/bramp/ffmpeg/FFmpegTest.java index ffe97d61..eb7b066d 100644 --- a/src/test/java/net/bramp/ffmpeg/FFmpegTest.java +++ b/src/test/java/net/bramp/ffmpeg/FFmpegTest.java @@ -2,6 +2,7 @@ import static org.hamcrest.Matchers.hasItem; import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; import static org.mockito.Mockito.*; import static org.mockito.hamcrest.MockitoHamcrest.argThat; @@ -60,6 +61,7 @@ public static List argThatHasItem(T s) { public void testVersion() throws Exception { assertEquals("ffmpeg version 0.10.9-7:0.10.9-1~raring1", ffmpeg.version()); assertEquals("ffmpeg version 0.10.9-7:0.10.9-1~raring1", ffmpeg.version()); + assertTrue(ffmpeg.isFFmpeg()); verify(runFunc, times(1)).run(argThatHasItem("-version")); } diff --git a/src/test/java/net/bramp/ffmpeg/FFprobeTest.java b/src/test/java/net/bramp/ffmpeg/FFprobeTest.java index 68fb5792..6b89d860 100644 --- a/src/test/java/net/bramp/ffmpeg/FFprobeTest.java +++ b/src/test/java/net/bramp/ffmpeg/FFprobeTest.java @@ -88,6 +88,7 @@ public void testVersion() throws Exception { "ffprobe version 3.0.2 Copyright (c) 2007-2016 the FFmpeg developers", ffprobe.version()); assertEquals( "ffprobe version 3.0.2 Copyright (c) 2007-2016 the FFmpeg developers", ffprobe.version()); + assertTrue(ffprobe.isFFprobe()); verify(runFunc, times(1)).run(argThatHasItem("-version")); }