Skip to content

Commit

Permalink
feat(#5): fix all qulice suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
volodya-lombrozo committed Nov 22, 2023
1 parent 072d3c5 commit 45bbbaa
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/main/java/com/yegor256/Jhome.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Arrays;
import java.util.Locale;

/**
* Finds {@code JAVA_HOME} even if the environment variable is not set.
Expand Down Expand Up @@ -94,11 +95,13 @@ public Path javac() {
* @return The extension.
*/
private static String extension() {
if (System.getProperty("os.name").toLowerCase().contains("windows")) {
return ".exe";
final String result;
if (System.getProperty("os.name").toLowerCase(Locale.getDefault()).contains("windows")) {
result = ".exe";
} else {
return "";
result = "";
}
return result;
}

/**
Expand Down

0 comments on commit 45bbbaa

Please sign in to comment.