(SIGAR-216) avoid ArrayIndexOutOfBoundsException in Sigar.getCpuPercList() when number of CPUs has decreased
This commit is contained in:
parent
4e0b8c02d0
commit
e43244a6e9
|
@ -373,7 +373,7 @@ public class Sigar implements SigarProxy {
|
||||||
CpuPerc[] perc =
|
CpuPerc[] perc =
|
||||||
new CpuPerc[curLen < oldLen ? curLen : oldLen];
|
new CpuPerc[curLen < oldLen ? curLen : oldLen];
|
||||||
|
|
||||||
for (int i=0; i<curLen; i++) {
|
for (int i=0; i<perc.length; i++) {
|
||||||
perc[i] =
|
perc[i] =
|
||||||
CpuPerc.fetch(this, oldCpuList[i],
|
CpuPerc.fetch(this, oldCpuList[i],
|
||||||
this.lastCpuList[i]);
|
this.lastCpuList[i]);
|
||||||
|
|
Loading…
Reference in New Issue