Use String.contains instead of String.indexof

This commit is contained in:
Mathis Chenuet
2015-01-25 18:38:27 +00:00
committed by Laurent Clouet
parent 3ea4107dc1
commit 7f10281792

View File

@@ -57,13 +57,13 @@ public abstract class OS {
public static OS getOS() { public static OS getOS() {
String os = System.getProperty("os.name").toLowerCase(); String os = System.getProperty("os.name").toLowerCase();
if (os.indexOf("win") >= 0) { if (os.contains("win")) {
return new Windows(); return new Windows();
} }
else if (os.indexOf("mac") >= 0) { else if (os.contains("mac")) {
return new Mac(); return new Mac();
} }
else if (os.indexOf("nix") >= 0 || os.indexOf("nux") >= 0) { else if (os.contains("nix") || os.contains("nux")) {
return new Linux(); return new Linux();
} }
else { else {