From 67d9faf16f07f5e808909b949c7e9aeadf9d7788 Mon Sep 17 00:00:00 2001 From: Tim te Beek Date: Wed, 23 Oct 2024 19:31:30 +0000 Subject: [PATCH] refactor: Kill your Zombie code Use this link to re-run the recipe: https://app.moderne.io/builder/mybR2aHWC?organizationId=T3BlblJld3JpdGU%3D Co-authored-by: Moderne --- .../org/openrewrite/codehaus/plexus/PlexusFileUtils.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/org/openrewrite/codehaus/plexus/PlexusFileUtils.java b/src/main/java/org/openrewrite/codehaus/plexus/PlexusFileUtils.java index 992fd9b..b9e53fd 100644 --- a/src/main/java/org/openrewrite/codehaus/plexus/PlexusFileUtils.java +++ b/src/main/java/org/openrewrite/codehaus/plexus/PlexusFileUtils.java @@ -61,12 +61,12 @@ void after(String dir) throws Exception { description = "Replace Plexus `FileUtils.fileExists(String fileName)` with JDK provided API.") static class FileExistsString { @BeforeTemplate - boolean before(String fileName) throws Exception { + boolean before(String fileName) { return FileUtils.fileExists(fileName); } @AfterTemplate - boolean after(String fileName) throws Exception { + boolean after(String fileName) { return new File(fileName).exists(); } } @@ -76,12 +76,12 @@ boolean after(String fileName) throws Exception { description = "Replace Plexus `FileUtils.getFile(String fileName)` with JDK provided API.") static class GetFile { @BeforeTemplate - File before(String fileName) throws Exception { + File before(String fileName) { return FileUtils.getFile(fileName); } @AfterTemplate - File after(String fileName) throws Exception { + File after(String fileName) { return new File(fileName); } }