(SIGAR-216) avoid ArrayIndexOutOfBoundsException in Sigar.getCpuPercList() when number of CPUs has decreased

This commit is contained in:
Ian Springer 2010-05-12 13:46:10 -04:00 committed by Doug MacEachern
parent 4e0b8c02d0
commit e43244a6e9
1 changed files with 1 additions and 1 deletions

View File

@ -373,7 +373,7 @@ public class Sigar implements SigarProxy {
CpuPerc[] perc =
new CpuPerc[curLen < oldLen ? curLen : oldLen];
for (int i=0; i<curLen; i++) {
for (int i=0; i<perc.length; i++) {
perc[i] =
CpuPerc.fetch(this, oldCpuList[i],
this.lastCpuList[i]);