refactor: Combining nested if statement.
@@ -41,11 +41,9 @@ public class NugetInspectorExecutableLocator {
File executable = new File(extractedZip, executableName);
if (executable.exists()) {
logger.debug("Found it: " + executable);
- if (!executable.canExecute()) {
- if (!executable.setExecutable(true)) {
+ if (!executable.canExecute() && !executable.setExecutable(true)) {
throw new DetectableException("Unable to set project inspector to executable: " + executable);
}
- }
return executable;
} else {
logger.debug("Could not find executable: " + executable);
