mirror of
https://github.com/JetBrains/JetBrainsRuntime.git
synced 2025-12-06 09:29:38 +01:00
8334490: Normalize string with locale invariant toLowerCase()
Backport-of: 265a0f5547
This commit is contained in:
committed by
Sergey Shelomentsev
parent
762bd8880e
commit
4bb1a39674
@@ -35,6 +35,7 @@ import java.security.PrivilegedAction;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
import static java.util.Locale.ROOT;
|
||||
|
||||
public class Platform {
|
||||
public static final String vmName = privilegedGetProperty("java.vm.name");
|
||||
@@ -134,7 +135,7 @@ public class Platform {
|
||||
}
|
||||
|
||||
private static boolean isOs(String osname) {
|
||||
return osName.toLowerCase().startsWith(osname.toLowerCase());
|
||||
return osName.toLowerCase(ROOT).startsWith(osname.toLowerCase(ROOT));
|
||||
}
|
||||
|
||||
public static String getOsName() {
|
||||
@@ -175,15 +176,15 @@ public class Platform {
|
||||
}
|
||||
|
||||
public static boolean isDebugBuild() {
|
||||
return (jdkDebug.toLowerCase().contains("debug"));
|
||||
return (jdkDebug.toLowerCase(ROOT).contains("debug"));
|
||||
}
|
||||
|
||||
public static boolean isSlowDebugBuild() {
|
||||
return (jdkDebug.toLowerCase().equals("slowdebug"));
|
||||
return (jdkDebug.toLowerCase(ROOT).equals("slowdebug"));
|
||||
}
|
||||
|
||||
public static boolean isFastDebugBuild() {
|
||||
return (jdkDebug.toLowerCase().equals("fastdebug"));
|
||||
return (jdkDebug.toLowerCase(ROOT).equals("fastdebug"));
|
||||
}
|
||||
|
||||
public static String getVMVersion() {
|
||||
@@ -350,8 +351,8 @@ public class Platform {
|
||||
}
|
||||
|
||||
public static boolean isOracleLinux7() {
|
||||
if (System.getProperty("os.name").toLowerCase().contains("linux") &&
|
||||
System.getProperty("os.version").toLowerCase().contains("el")) {
|
||||
if (System.getProperty("os.name").toLowerCase(ROOT).contains("linux") &&
|
||||
System.getProperty("os.version").toLowerCase(ROOT).contains("el")) {
|
||||
Pattern p = Pattern.compile("el(\\d+)");
|
||||
Matcher m = p.matcher(System.getProperty("os.version"));
|
||||
if (m.find()) {
|
||||
|
||||
Reference in New Issue
Block a user