From 36b0a3169fb6eb26cd694ca3ec24f3c27fd87efc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Tue, 17 Sep 2019 10:49:24 +0800 Subject: [PATCH] =?UTF-8?q?CHART-10607=20linux=E4=B8=8B=E7=BC=BA=E5=A4=B1?= =?UTF-8?q?=E4=BA=86=E7=B3=BB=E7=BB=9F=E4=BE=9B=E5=BA=94=E5=95=86=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E7=9A=84=E6=96=87=E4=BB=B6=E4=BC=9A=E5=AF=BC=E8=87=B4?= =?UTF-8?q?=E6=A0=88=E6=BA=A2=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fine-j2v8/src/com/eclipsesource/v8/PlatformDetector.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/fine-j2v8/src/com/eclipsesource/v8/PlatformDetector.java b/fine-j2v8/src/com/eclipsesource/v8/PlatformDetector.java index 510bee075..8fa7868d0 100644 --- a/fine-j2v8/src/com/eclipsesource/v8/PlatformDetector.java +++ b/fine-j2v8/src/com/eclipsesource/v8/PlatformDetector.java @@ -125,7 +125,9 @@ public class PlatformDetector { return "google"; } - throw new UnsatisfiedLinkError("Unsupported vendor: " + getName()); + //如果if条件全部不符合,就会陷入死循环,代码存在风险 + //throw new UnsatisfiedLinkError("Unsupported vendor: " + getName()); + return ""; } private static String getLinuxOsReleaseId() { @@ -144,7 +146,9 @@ public class PlatformDetector { 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 ""; } private static String parseLinuxOsReleaseFile(final File file) {