From c8ba03ae2b1dcca8f76e19b606bdcb123331edc9 Mon Sep 17 00:00:00 2001 From: Jason_Khew <29531167+JasonKhew96@users.noreply.github.com> Date: Sat, 11 Sep 2021 10:59:56 +0800 Subject: [PATCH] Fix MEMINFO_PATTERN is null --- .../org/jackhuang/hmcl/util/platform/OperatingSystem.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/HMCLCore/src/main/java/org/jackhuang/hmcl/util/platform/OperatingSystem.java b/HMCLCore/src/main/java/org/jackhuang/hmcl/util/platform/OperatingSystem.java index d4dbc7cc6..49b508bfc 100644 --- a/HMCLCore/src/main/java/org/jackhuang/hmcl/util/platform/OperatingSystem.java +++ b/HMCLCore/src/main/java/org/jackhuang/hmcl/util/platform/OperatingSystem.java @@ -95,6 +95,8 @@ public enum OperatingSystem { private static final String[] INVALID_RESOURCE_BASENAMES; private static final String[] INVALID_RESOURCE_FULLNAMES; + private static final Pattern MEMINFO_PATTERN = Pattern.compile("^(?.*?):\\s+(?\\d+) kB?$"); + static { String name = System.getProperty("os.name").toLowerCase(Locale.US); if (name.contains("win")) @@ -132,8 +134,6 @@ public enum OperatingSystem { } } - private static final Pattern MEMINFO_PATTERN = Pattern.compile("^(?.*?):\\s+(?\\d+) kB?$"); - public static Optional getPhysicalMemoryStatus() { if (CURRENT_OS == LINUX) { try {