< prev index next >

test/jdk/jdk/internal/platform/docker/TestDockerCpuMetrics.java

Print this page
@  rev 57586 : Review changes
|
~

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018, 2020, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 only, as
  * published by the Free Software Foundation.

@@ -76,14 +76,14 @@
 
             testCpuThrottling(0.5);// --cpus=<value>
 
             int[] cpuSetMems = Metrics.systemMetrics().getCpuSetMems();
             String memNodes = null;
-            if (cpuSetMems.length > 1) {
+            if (cpuSetMems != null && cpuSetMems.length > 1) {
                 int endNode = (cpuSetMems[cpuSetMems.length - 1] - cpuSetMems[0]) / 2 + cpuSetMems[0];
                 memNodes = cpuSetMems[0] + "-" + endNode;
-            } else if (cpuSetMems.length == 1) {
+            } else if (cpuSetMems != null && cpuSetMems.length == 1) {
                 memNodes = cpuSetMems[0] + "";
             }
 
             if(memNodes != null)
                 testCpuSetMems(memNodes);
< prev index next >