6363import org .osgi .framework .BundleException ;
6464import org .osgi .framework .BundleReference ;
6565
66- import java . lang .management .OperatingSystemMXBean ;
66+ import com . sun .management .OperatingSystemMXBean ;
6767
6868import jakarta .servlet .ServletContext ;
6969import lucee .commons .collection .AccessOrderLimitedSizeMap ;
@@ -1146,7 +1146,7 @@ public static long getTotalBytes() throws ApplicationException {
11461146
11471147 public static double getCpuUsage (long time ) throws ApplicationException {
11481148 if (time < 1 ) throw new ApplicationException ("time has to be bigger than 0" );
1149- OperatingSystemMXBean osBean = ManagementFactory .getOperatingSystemMXBean ();
1149+ OperatingSystemMXBean osBean = ( OperatingSystemMXBean ) ManagementFactory .getOperatingSystemMXBean ();
11501150 double cpuBefore = osBean .getProcessCpuTime ();
11511151 long timeBeforeNano = System .nanoTime ();
11521152 sleep (time );
@@ -1158,7 +1158,7 @@ public static double getCpuUsage(long time) throws ApplicationException {
11581158 }
11591159
11601160 public static float getCpuPercentage () {
1161- OperatingSystemMXBean osBean = ManagementFactory .getOperatingSystemMXBean ();
1161+ OperatingSystemMXBean osBean = ( OperatingSystemMXBean ) ManagementFactory .getOperatingSystemMXBean ();
11621162 int max = 50 ;
11631163 float res = 0 ;
11641164 while (true ) {
@@ -1177,7 +1177,7 @@ public static float getCpuPercentage() {
11771177 }
11781178
11791179 private synchronized static PhysicalMemory physical () throws ApplicationException {
1180- OperatingSystemMXBean osBean = ManagementFactory .getOperatingSystemMXBean ();
1180+ OperatingSystemMXBean osBean = ( OperatingSystemMXBean ) ManagementFactory .getOperatingSystemMXBean ();
11811181 try {
11821182 long totalPhysicalMemory = osBean .getTotalPhysicalMemorySize ();
11831183 long freePhysicalMemory = osBean .getFreePhysicalMemorySize ();
0 commit comments