Skip to content

Commit

Permalink
Merge pull request spotbugs#898 from hazendaz/maven-api
Browse files Browse the repository at this point in the history
[ci] Combine if statement
  • Loading branch information
hazendaz authored Oct 20, 2024
2 parents 78f47d0 + 913498b commit 535da14
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/main/groovy/org/codehaus/mojo/spotbugs/ResourceHelper.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -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))) {
Expand Down

0 comments on commit 535da14

Please sign in to comment.