From c623a3252e1c6f2576287ad3fb6f4e588632d9e2 Mon Sep 17 00:00:00 2001 From: Michael Peter Christen Date: Fri, 23 Apr 2021 09:11:03 +0200 Subject: [PATCH] fix for jdk 14 bug --- source/net/yacy/cora/util/Memory.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source/net/yacy/cora/util/Memory.java b/source/net/yacy/cora/util/Memory.java index 3f348198b..3a1334d91 100644 --- a/source/net/yacy/cora/util/Memory.java +++ b/source/net/yacy/cora/util/Memory.java @@ -116,8 +116,8 @@ public class Memory { * a negative value if not available. */ public static double getSystemCpuLoad() { - com.sun.management.OperatingSystemMXBean operatingSystemMXBean = (com.sun.management.OperatingSystemMXBean) ManagementFactory.getOperatingSystemMXBean(); - return operatingSystemMXBean.getCpuLoad(); // getSystemCpuLoad is deprecated, getCpuLoad is the replacement + com.sun.management.OperatingSystemMXBean operatingSystemMXBean = (com.sun.management.OperatingSystemMXBean) ManagementFactory.getOperatingSystemMXBean(); + return operatingSystemMXBean.getSystemCpuLoad(); } /** @@ -136,8 +136,8 @@ public class Memory { * a negative value if not available. */ public static double getProcessCpuLoad() { - com.sun.management.OperatingSystemMXBean operatingSystemMXBean = (com.sun.management.OperatingSystemMXBean) ManagementFactory.getOperatingSystemMXBean(); - return operatingSystemMXBean.getProcessCpuLoad(); + com.sun.management.OperatingSystemMXBean operatingSystemMXBean = (com.sun.management.OperatingSystemMXBean) ManagementFactory.getOperatingSystemMXBean(); + return operatingSystemMXBean.getProcessCpuLoad(); } public static Map status() {