snehashisp commented on code in PR #18325: URL: https://github.com/apache/kafka/pull/18325#discussion_r2069361342
########## connect/runtime/src/test/java/org/apache/kafka/connect/runtime/isolation/TestPlugins.java: ########## @@ -477,6 +480,27 @@ private static void compileJavaSources(Path sourceDir, Path binDir) throws IOExc if (!success) { throw new RuntimeException("Failed to compile test plugin:\n" + writer); } + } finally { + if (!replacements.isEmpty()) { + sourceFiles.forEach(File::delete); + } + } + } + + private static File copyAndReplace(File source, Map<String, String> replacements) throws RuntimeException { + if (replacements.isEmpty()) { + return source; + } Review Comment: Updated this. When replacements are present we needed to clean up the temporary java files with the replacements, hence this code flow. But with the suggestion of using `deleteOnExit` this check is no longer required. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: jira-unsubscr...@kafka.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org