From 913498b5b8e5b9e9344aaab09642be5a8cd931aa Mon Sep 17 00:00:00 2001 From: Jeremy Landis Date: Sun, 20 Oct 2024 03:11:02 -0400 Subject: [PATCH] [ci] Combine if statement --- .../org/codehaus/mojo/spotbugs/ResourceHelper.groovy | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/main/groovy/org/codehaus/mojo/spotbugs/ResourceHelper.groovy b/src/main/groovy/org/codehaus/mojo/spotbugs/ResourceHelper.groovy index e15dc8bf..155a03ad 100644 --- a/src/main/groovy/org/codehaus/mojo/spotbugs/ResourceHelper.groovy +++ b/src/main/groovy/org/codehaus/mojo/spotbugs/ResourceHelper.groovy @@ -91,23 +91,19 @@ final class ResourceHelper { private File getResourceAsFile(String name, String outputPath) { // Optimization for File to File fetches File f = FileResourceLoader.getResourceAsFile(name, outputPath, outputDirectory) - if (f != null) { return f } - // End optimization File outputResourceFile if (outputPath == null) { outputResourceFile = Files.createTempFile("plexus-resources", "tmp") + } else if (outputDirectory != null) { + outputResourceFile = new File(outputDirectory, outputPath) } else { - if (outputDirectory != null) { - outputResourceFile = new File(outputDirectory, outputPath) - } else { - outputResourceFile = new File(outputPath) - } + outputResourceFile = new File(outputPath) } try (InputStream is = new BufferedInputStream(resourceManager.getResourceAsInputStream(name))) {