From a407cc3a315536e6b3ea5e52bc34ed603dd75d1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stig=20D=C3=B8ssing?= Date: Mon, 23 Sep 2024 14:28:08 +0200 Subject: [PATCH] KAFKA-17575 Remove unnecessary file.deleteOnExit call (#17226) TestUtils.tempDirectory already registers a shutdown hook for deleting the temp directory. There's no reason to also call File.deleteOnExit, since that just registers another hook to do the same thing. Reviewers: TengYao Chi , Ken Huang , Chia-Ping Tsai --- clients/src/test/java/org/apache/kafka/test/TestUtils.java | 1 - 1 file changed, 1 deletion(-) diff --git a/clients/src/test/java/org/apache/kafka/test/TestUtils.java b/clients/src/test/java/org/apache/kafka/test/TestUtils.java index bf9e948845b..cd4cb19a0dd 100644 --- a/clients/src/test/java/org/apache/kafka/test/TestUtils.java +++ b/clients/src/test/java/org/apache/kafka/test/TestUtils.java @@ -268,7 +268,6 @@ public class TestUtils { } catch (final IOException ex) { throw new RuntimeException("Failed to create a temp dir", ex); } - file.deleteOnExit(); Exit.addShutdownHook("delete-temp-file-shutdown-hook", () -> { try {