From 0ab09b31419f8ae92114e4cffc358003999cc226 Mon Sep 17 00:00:00 2001 From: Mark Lassau Date: Fri, 8 Sep 2023 13:16:57 +1000 Subject: [PATCH 01/11] Issue 357: Detect ffmpeg bug and ignore test that can't pass --- .../kokorin/jaffree/ffmpeg/FFmpegTest.java | 34 ++++++++++++++----- 1 file changed, 25 insertions(+), 9 deletions(-) diff --git a/src/test/java/com/github/kokorin/jaffree/ffmpeg/FFmpegTest.java b/src/test/java/com/github/kokorin/jaffree/ffmpeg/FFmpegTest.java index e4533d15..fdc4e57f 100644 --- a/src/test/java/com/github/kokorin/jaffree/ffmpeg/FFmpegTest.java +++ b/src/test/java/com/github/kokorin/jaffree/ffmpeg/FFmpegTest.java @@ -13,6 +13,7 @@ import org.hamcrest.core.AllOf; import org.hamcrest.core.StringContains; import org.junit.Assert; +import org.junit.Assume; import org.junit.Ignore; import org.junit.Rule; import org.junit.Test; @@ -379,16 +380,31 @@ public void testSizeLimit() throws Exception { Path tempDir = Files.createTempDirectory("jaffree"); Path outputPath = tempDir.resolve(Artifacts.VIDEO_MP4.getFileName()); - FFmpegResult result = FFmpeg.atPath(Config.FFMPEG_BIN) - .addInput(UrlInput.fromPath(Artifacts.VIDEO_MP4)) - .addOutput(UrlOutput - .toPath(outputPath) - .copyAllCodecs() - .setSizeLimit(1_000_000L) - ) - .execute(); + final AtomicBoolean muxingErrorDetected = new AtomicBoolean(false); + OutputListener outputListener = message -> { + if (message.endsWith("Error muxing a packet")) { + LOGGER.warn("Detected a muxing error, which indicates ffmpeg bug #10327"); + muxingErrorDetected.set(true); + } + }; - Assert.assertNotNull(result); + try { + FFmpegResult result = FFmpeg.atPath(Config.FFMPEG_BIN) + .addInput(UrlInput.fromPath(Artifacts.VIDEO_MP4)) + .setOutputListener(outputListener) + .addOutput(UrlOutput + .toPath(outputPath) + .copyAllCodecs() + .setSizeLimit(1_000_000L) + ) + .execute(); + Assert.assertNotNull(result); + } catch (JaffreeAbnormalExitException ex) { + // Detect ffmpeg bug "Error muxing a packet when limit file size parameter is set" + // https://trac.ffmpeg.org/ticket/10327 + Assume.assumeFalse("Hit ffmpeg bug #10327 - we will ignore this test", muxingErrorDetected.get()); + Assert.fail("Abnormal exit for limit file size"); + } long outputSize = Files.size(outputPath); assertTrue(outputSize > 900_000); From d6097ada8cc90980dd92484ac4b2433d0fa57014 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 9 Sep 2023 11:28:55 +0300 Subject: [PATCH 02/11] Build(deps): Bump maven-compiler-plugin from 3.8.1 to 3.11.0 (#345) Bumps [maven-compiler-plugin](https://github.com/apache/maven-compiler-plugin) from 3.8.1 to 3.11.0. - [Release notes](https://github.com/apache/maven-compiler-plugin/releases) - [Commits](https://github.com/apache/maven-compiler-plugin/compare/maven-compiler-plugin-3.8.1...maven-compiler-plugin-3.11.0) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-compiler-plugin dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 7847960c..04e3b500 100644 --- a/pom.xml +++ b/pom.xml @@ -212,7 +212,7 @@ org.apache.maven.plugins maven-compiler-plugin - 3.8.1 + 3.11.0 8 8 From 4d5886eb619d541866d524c69c9b56a02536dee8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 9 Sep 2023 11:29:22 +0300 Subject: [PATCH 03/11] Build(deps): Bump maven-javadoc-plugin from 3.3.1 to 3.5.0 (#342) Bumps [maven-javadoc-plugin](https://github.com/apache/maven-javadoc-plugin) from 3.3.1 to 3.5.0. - [Release notes](https://github.com/apache/maven-javadoc-plugin/releases) - [Commits](https://github.com/apache/maven-javadoc-plugin/compare/maven-javadoc-plugin-3.3.1...maven-javadoc-plugin-3.5.0) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-javadoc-plugin dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 04e3b500..e8fbe0c9 100644 --- a/pom.xml +++ b/pom.xml @@ -164,7 +164,7 @@ org.apache.maven.plugins maven-javadoc-plugin - 3.3.1 + 3.5.0 8 From 19aebf0306deec63c4fab437047090b0b6269dd0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 9 Sep 2023 11:45:54 +0300 Subject: [PATCH 04/11] Build(deps): Bump actions/cache from 1 to 3.0.11 (#322) Bumps [actions/cache](https://github.com/actions/cache) from 1 to 3.0.11. - [Release notes](https://github.com/actions/cache/releases) - [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md) - [Commits](https://github.com/actions/cache/compare/v1...v3.0.11) --- updated-dependencies: - dependency-name: actions/cache dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/codeql-analysis.yml | 2 +- .github/workflows/release.yml | 2 +- .github/workflows/sonar-analysis.yml | 4 ++-- .github/workflows/tests.yml | 6 +++--- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 515cd2d3..aa55b1a6 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -57,7 +57,7 @@ jobs: # Prefix the list here with "+" to use these queries and those in the config file. # queries: ./path/to/local/query, your-org/your-repo/queries@main - - uses: actions/cache@v2 + - uses: actions/cache@v3 with: # be careful not to include ~/.m2/settings.xml which contains credentials path: | diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5c78412a..25941dee 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -24,7 +24,7 @@ jobs: distribution: 'adopt' java-version: 11 - - uses: actions/cache@v2 + - uses: actions/cache@v3 with: # be careful not to include ~/.m2/settings.xml which contains credentials path: | diff --git a/.github/workflows/sonar-analysis.yml b/.github/workflows/sonar-analysis.yml index 430ab7db..53dd89db 100644 --- a/.github/workflows/sonar-analysis.yml +++ b/.github/workflows/sonar-analysis.yml @@ -39,13 +39,13 @@ jobs: run: sudo apt-get update && sudo apt-get install -y ffmpeg && ffmpeg -version - name: Cache SonarCloud packages - uses: actions/cache@v1 + uses: actions/cache@v3 with: path: ~/.sonar/cache key: ${{ runner.os }}-sonar restore-keys: ${{ runner.os }}-sonar - - uses: actions/cache@v2 + - uses: actions/cache@v3 with: # be careful not to include ~/.m2/settings.xml which contains credentials path: | diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 834e6bba..d07f294a 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -39,7 +39,7 @@ jobs: java-version: ${{ matrix.java-version }} - name: Cache Maven Packages - uses: actions/cache@v2 + uses: actions/cache@v3 with: # be careful not to include ~/.m2/settings.xml which contains credentials path: | @@ -49,7 +49,7 @@ jobs: restore-keys: ${{ runner.os }}-m2 - name: Cache Test Artifacts - uses: actions/cache@v2 + uses: actions/cache@v3 with: path: | .artifacts @@ -93,7 +93,7 @@ jobs: - name: Set up RANDOM GPG key run: gpg --quick-generate-key --batch --passphrase '' test42 - - uses: actions/cache@v2 + - uses: actions/cache@v3 with: # be careful not to include ~/.m2/settings.xml which contains credentials path: | From 540616a9f2c3e648b9e3241204a1a4b7ec78e8ba Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 9 Sep 2023 11:47:33 +0300 Subject: [PATCH 05/11] Build(deps): Bump actions/checkout from 2 to 4 (#360) Bumps [actions/checkout](https://github.com/actions/checkout) from 2 to 4. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v2...v4) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/codeql-analysis.yml | 2 +- .github/workflows/release.yml | 2 +- .github/workflows/sonar-analysis.yml | 2 +- .github/workflows/tests.yml | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index aa55b1a6..36843b01 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -40,7 +40,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v4 - uses: actions/setup-java@v2 with: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 25941dee..fc926342 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -17,7 +17,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - uses: actions/setup-java@v2 with: diff --git a/.github/workflows/sonar-analysis.yml b/.github/workflows/sonar-analysis.yml index 53dd89db..f5e3277c 100644 --- a/.github/workflows/sonar-analysis.yml +++ b/.github/workflows/sonar-analysis.yml @@ -26,7 +26,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index d07f294a..5adee0e2 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -30,7 +30,7 @@ jobs: fail-fast: false steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Set up JDK uses: actions/setup-java@v2 @@ -82,7 +82,7 @@ jobs: test-release: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Set up JDK uses: actions/setup-java@v2 From 6bdf52877d1a75f4d74fa55f467e90e0b63d09b0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 9 Sep 2023 12:28:37 +0300 Subject: [PATCH 06/11] Build(deps): Bump actions/setup-java from 2 to 3.2.0 (#300) * Build(deps): Bump actions/setup-java from 2 to 3.2.0 Bumps [actions/setup-java](https://github.com/actions/setup-java) from 2 to 3.2.0. - [Release notes](https://github.com/actions/setup-java/releases) - [Commits](https://github.com/actions/setup-java/compare/v2...v3.2.0) --- updated-dependencies: - dependency-name: actions/setup-java dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] * Sonar JDK version and distribution --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Denis Kokorin --- .github/workflows/codeql-analysis.yml | 2 +- .github/workflows/release.yml | 2 +- .github/workflows/sonar-analysis.yml | 7 ++++--- .github/workflows/tests.yml | 4 ++-- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 36843b01..b1732a18 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -42,7 +42,7 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 - - uses: actions/setup-java@v2 + - uses: actions/setup-java@v3 with: distribution: 'adopt' java-version: 8 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index fc926342..b049672e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -19,7 +19,7 @@ jobs: steps: - uses: actions/checkout@v4 - - uses: actions/setup-java@v2 + - uses: actions/setup-java@v3 with: distribution: 'adopt' java-version: 11 diff --git a/.github/workflows/sonar-analysis.yml b/.github/workflows/sonar-analysis.yml index f5e3277c..972982e2 100644 --- a/.github/workflows/sonar-analysis.yml +++ b/.github/workflows/sonar-analysis.yml @@ -30,10 +30,11 @@ jobs: with: fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis - - name: Set up JDK 11 - uses: actions/setup-java@v1 + - name: Set up JDK + uses: actions/setup-java@v3 with: - java-version: 11 + distribution: 'adopt' + java-version: 17 - name: Install ffmpeg on Ubuntu run: sudo apt-get update && sudo apt-get install -y ffmpeg && ffmpeg -version diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 5adee0e2..fda833c4 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -33,7 +33,7 @@ jobs: - uses: actions/checkout@v4 - name: Set up JDK - uses: actions/setup-java@v2 + uses: actions/setup-java@v3 with: distribution: 'adopt' java-version: ${{ matrix.java-version }} @@ -85,7 +85,7 @@ jobs: - uses: actions/checkout@v4 - name: Set up JDK - uses: actions/setup-java@v2 + uses: actions/setup-java@v3 with: distribution: 'adopt' java-version: 11 From 6b24b5ecda7ec6c7a2016fc0ae892c0a7e6b65bc Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 9 Sep 2023 12:29:06 +0300 Subject: [PATCH 07/11] Build(deps): Bump com.puppycrawl.tools:checkstyle from 9.2.1 to 10.12.3 (#359) * Build(deps): Bump com.puppycrawl.tools:checkstyle from 9.2.1 to 10.12.3 Bumps [com.puppycrawl.tools:checkstyle](https://github.com/checkstyle/checkstyle) from 9.2.1 to 10.12.3. - [Release notes](https://github.com/checkstyle/checkstyle/releases) - [Commits](https://github.com/checkstyle/checkstyle/compare/checkstyle-9.2.1...checkstyle-10.12.3) --- updated-dependencies: - dependency-name: com.puppycrawl.tools:checkstyle dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] * Use JDK 17 in CodeQL Analysis --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Denis Kokorin --- .github/workflows/codeql-analysis.yml | 2 +- pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index b1732a18..c62690d8 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -45,7 +45,7 @@ jobs: - uses: actions/setup-java@v3 with: distribution: 'adopt' - java-version: 8 + java-version: 17 # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL diff --git a/pom.xml b/pom.xml index e8fbe0c9..fe97d6f5 100644 --- a/pom.xml +++ b/pom.xml @@ -251,7 +251,7 @@ com.puppycrawl.tools checkstyle - 9.2.1 + 10.12.3 From 96a47f18975e3b1f051972b49e6bf8cf1ed60749 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 9 Sep 2023 12:29:51 +0300 Subject: [PATCH 08/11] Build(deps): Bump nexus-staging-maven-plugin from 1.6.8 to 1.6.13 (#297) Bumps nexus-staging-maven-plugin from 1.6.8 to 1.6.13. --- updated-dependencies: - dependency-name: org.sonatype.plugins:nexus-staging-maven-plugin dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index fe97d6f5..02eb3274 100644 --- a/pom.xml +++ b/pom.xml @@ -194,7 +194,7 @@ org.sonatype.plugins nexus-staging-maven-plugin - 1.6.8 + 1.6.13 true ossrh From 68d134178fd1c72169fe95b93cd6d8e49e9509ef Mon Sep 17 00:00:00 2001 From: Mark Lassau <46333827+marklassau@users.noreply.github.com> Date: Sun, 10 Sep 2023 22:31:36 +1000 Subject: [PATCH 09/11] Issue 355: ProcessHandler configurable executor timeout (#356) * Issue 355: Allow an application developer to override the default Executor Timeout value * Issue 355: PR feedback: use int param instead of allowing nulls + 0 timeout means indefinite wait --- .../github/kokorin/jaffree/ffmpeg/FFmpeg.java | 36 ++++++++++++++++--- .../jaffree/process/ProcessHandler.java | 24 ++++++++++--- 2 files changed, 51 insertions(+), 9 deletions(-) diff --git a/src/main/java/com/github/kokorin/jaffree/ffmpeg/FFmpeg.java b/src/main/java/com/github/kokorin/jaffree/ffmpeg/FFmpeg.java index 0a3f8177..0edf7932 100644 --- a/src/main/java/com/github/kokorin/jaffree/ffmpeg/FFmpeg.java +++ b/src/main/java/com/github/kokorin/jaffree/ffmpeg/FFmpeg.java @@ -59,6 +59,7 @@ public class FFmpeg { private LogLevel logLevel = LogLevel.INFO; private String contextName = null; + private Integer executorTimeoutMillis = null; private final Path executable; @@ -387,6 +388,26 @@ public FFmpeg setContextName(final String contextName) { return this; } + /** + * Overrides the default {@link com.github.kokorin.jaffree.process.Executor} timeout. + *

+ * Most normal use cases will easily complete within the default timeout. It is not recommended + * to set an explicit timeout value unless you have actually experienced unwanted timeouts. + *

+ * A value of 0 will disable the timeout. + * That is, Jaffree will wait indefinitely for the Executor to complete. + * + * @param executorTimeoutMillis the custom executor timeout in milliseconds + * @return this + */ + public FFmpeg setExecutorTimeoutMillis(final int executorTimeoutMillis) { + if (executorTimeoutMillis < 0) { + throw new IllegalArgumentException("Executor timeout cannot be negative"); + } + this.executorTimeoutMillis = executorTimeoutMillis; + return this; + } + /** * Starts synchronous ffmpeg execution. *

@@ -480,11 +501,16 @@ protected ProcessHandler createProcessHandler() { helpers.add(progressHelper); } - return new ProcessHandler(executable, contextName) - .setStdErrReader(createStdErrReader(outputListener)) - .setStdOutReader(createStdOutReader()) - .setHelpers(helpers) - .setArguments(buildArguments()); + ProcessHandler processHandler = + new ProcessHandler(executable, contextName) + .setStdErrReader(createStdErrReader(outputListener)) + .setStdOutReader(createStdOutReader()) + .setHelpers(helpers) + .setArguments(buildArguments()); + if (executorTimeoutMillis != null) { + processHandler.setExecutorTimeoutMillis(executorTimeoutMillis); + } + return processHandler; } /** diff --git a/src/main/java/com/github/kokorin/jaffree/process/ProcessHandler.java b/src/main/java/com/github/kokorin/jaffree/process/ProcessHandler.java index a7e5b3e3..73e8012f 100644 --- a/src/main/java/com/github/kokorin/jaffree/process/ProcessHandler.java +++ b/src/main/java/com/github/kokorin/jaffree/process/ProcessHandler.java @@ -49,8 +49,9 @@ public class ProcessHandler { private List helpers = null; private Stopper stopper = null; private List arguments = Collections.emptyList(); + private int executorTimeoutMillis = DEFAULT_EXECUTOR_TIMEOUT_MILLIS; - private static final int EXECUTOR_TIMEOUT_MILLIS = 10_000; + private static final int DEFAULT_EXECUTOR_TIMEOUT_MILLIS = 10_000; private static final Logger LOGGER = LoggerFactory.getLogger(ProcessHandler.class); /** @@ -120,6 +121,20 @@ public synchronized ProcessHandler setArguments(final List arguments) return this; } + /** + * Overrides the default Executor timeout. + *

+ * A value of 0 is interpreted as "wait indefinitely". + * + * @param executorTimeoutMillis the new Executor timeout in milliseconds + */ + public void setExecutorTimeoutMillis(final int executorTimeoutMillis) { + if (executorTimeoutMillis < 0) { + throw new IllegalArgumentException("Executor timeout cannot be negative"); + } + this.executorTimeoutMillis = executorTimeoutMillis; + } + /** * Executes a program. *

@@ -180,7 +195,7 @@ protected T interactWithProcess(final Process process) { status = process.waitFor(); LOGGER.info("Process has finished with status: {}", status); - waitForExecutorToStop(executor, EXECUTOR_TIMEOUT_MILLIS); + waitForExecutorToStop(executor, executorTimeoutMillis); } catch (InterruptedException e) { LOGGER.warn("Process has been interrupted"); if (stopper != null) { @@ -308,9 +323,10 @@ private static void waitForExecutorToStop(final Executor executor, final long ti throws InterruptedException { LOGGER.debug("Waiting for Executor to stop"); - long waitStarted = System.currentTimeMillis(); + final long waitStarted = System.currentTimeMillis(); do { - if (System.currentTimeMillis() - waitStarted > timeoutMillis) { + // Zero timeout means "wait indefinitely" + if (timeoutMillis > 0 && System.currentTimeMillis() - waitStarted > timeoutMillis) { LOGGER.warn("Executor hasn't stopped in {} millis, won't wait longer", timeoutMillis); break; From a2f1171e1fd64aab43e15fe4d01dd38e9f936026 Mon Sep 17 00:00:00 2001 From: Mark Lassau <46333827+marklassau@users.noreply.github.com> Date: Sun, 10 Sep 2023 22:43:05 +1000 Subject: [PATCH 10/11] Replace Integer with int and make it final to ensure no-ones breaks the code (#362) --- .../com/github/kokorin/jaffree/process/ProcessHandler.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/github/kokorin/jaffree/process/ProcessHandler.java b/src/main/java/com/github/kokorin/jaffree/process/ProcessHandler.java index 73e8012f..4ed9d280 100644 --- a/src/main/java/com/github/kokorin/jaffree/process/ProcessHandler.java +++ b/src/main/java/com/github/kokorin/jaffree/process/ProcessHandler.java @@ -187,7 +187,7 @@ public synchronized T execute() { */ protected T interactWithProcess(final Process process) { AtomicReference resultRef = new AtomicReference<>(); - Integer status = null; + final int status; Executor executor = startExecution(process, resultRef); try { @@ -213,7 +213,7 @@ protected T interactWithProcess(final Process process) { "Failed to execute, exception appeared in one of helper threads", exceptions); } - if (!Integer.valueOf(0).equals(status)) { + if (status != 0) { throw new JaffreeAbnormalExitException( "Process execution has ended with non-zero status: " + status + ". Check logs for detailed error message.", From 0d1bc3314b4387301e73c5b23ebadc26d6279441 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 10 Sep 2023 15:43:48 +0300 Subject: [PATCH 11/11] Build(deps): Bump github/codeql-action from 1 to 2 (#301) Bumps [github/codeql-action](https://github.com/github/codeql-action) from 1 to 2. - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/v1...v2) --- updated-dependencies: - dependency-name: github/codeql-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/codeql-analysis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index c62690d8..ab9e636d 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -49,7 +49,7 @@ jobs: # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/init@v1 + uses: github/codeql-action/init@v2 with: languages: ${{ matrix.language }} # If you wish to specify custom queries, you can do so here or in a config file. @@ -70,4 +70,4 @@ jobs: run: bash mvnw clean install -B -DskipTests - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v1 + uses: github/codeql-action/analyze@v2