fix: Compilation Error

This commit is contained in:
huanghongxun
2021-05-19 00:45:21 +08:00
parent 1e3a5f9515
commit f55fe0fc45
3 changed files with 5 additions and 11 deletions

View File

@@ -18,6 +18,7 @@
package org.jackhuang.hmcl.game;
import org.jackhuang.hmcl.util.Lang;
import org.jackhuang.hmcl.util.platform.Architecture;
import org.jackhuang.hmcl.util.platform.OperatingSystem;
import java.util.regex.Pattern;
@@ -71,7 +72,7 @@ public final class OSRestriction {
return false;
if (arch != null)
return !Lang.test(() -> !Pattern.compile(arch).matcher(OperatingSystem.SYSTEM_ARCHITECTURE).matches());
return !Lang.test(() -> !Pattern.compile(arch).matcher(Architecture.SYSTEM_ARCHITECTURE).matches());
return true;
}

View File

@@ -44,15 +44,10 @@ public enum Platform {
return bit;
}
/**
* True if current Java Environment is 64-bit.
*/
public static final boolean IS_64_BIT = OperatingSystem.SYSTEM_ARCHITECTURE.contains("64");
/**
* The platform of current Java Environment.
*/
public static final Platform PLATFORM = IS_64_BIT ? BIT_64 : BIT_32;
public static final Platform PLATFORM = Architecture.CURRENT.getPlatform();
/**
* The json serializer to {@link Platform}.