|
|
@ -125,7 +125,9 @@ public class PlatformDetector { |
|
|
|
return "google"; |
|
|
|
return "google"; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
throw new UnsatisfiedLinkError("Unsupported vendor: " + getName()); |
|
|
|
//如果if条件全部不符合,就会陷入死循环,代码存在风险
|
|
|
|
|
|
|
|
//throw new UnsatisfiedLinkError("Unsupported vendor: " + getName());
|
|
|
|
|
|
|
|
return StringUtils.EMPTY; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private static String getLinuxOsReleaseId() { |
|
|
|
private static String getLinuxOsReleaseId() { |
|
|
@ -144,7 +146,9 @@ public class PlatformDetector { |
|
|
|
return parseLinuxRedhatReleaseFile(file); |
|
|
|
return parseLinuxRedhatReleaseFile(file); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
throw new UnsatisfiedLinkError("Unsupported linux vendor: " + getName()); |
|
|
|
//linux系统下如果缺失/etc/os-release,/usr/lib/os-release,/etc/redhat-release三个文件,就会和getName方法就会一直互相调用
|
|
|
|
|
|
|
|
//throw new UnsatisfiedLinkError("Unsupported linux vendor: " + getName());
|
|
|
|
|
|
|
|
return StringUtils.EMPTY; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private static String parseLinuxOsReleaseFile(final File file) { |
|
|
|
private static String parseLinuxOsReleaseFile(final File file) { |
|
|
|