mirror of
https://github.com/apache/cloudstack.git
synced 2025-11-03 04:12:31 +01:00
Fix overflow before widening issues reported by Coverity
This commit is contained in:
parent
885e08d476
commit
676b2d1569
@ -107,7 +107,7 @@ public class VirtualMachinePowerStateSyncImpl implements VirtualMachinePowerStat
|
||||
s_logger.debug("Run missing VM report. current time: " + currentTime.getTime());
|
||||
|
||||
// 2 times of sync-update interval for graceful period
|
||||
long milliSecondsGracefullPeriod = PingInterval.value() * 2000;
|
||||
long milliSecondsGracefullPeriod = PingInterval.value() * 2000L;
|
||||
|
||||
for (VMInstanceVO instance : vmsThatAreMissingReport) {
|
||||
|
||||
|
||||
@ -43,8 +43,8 @@ import org.apache.cloudstack.usage.UsageTypes;
|
||||
|
||||
import com.cloud.alert.AlertManager;
|
||||
import com.cloud.event.EventTypes;
|
||||
import com.cloud.event.UsageEventVO;
|
||||
import com.cloud.event.UsageEventDetailsVO;
|
||||
import com.cloud.event.UsageEventVO;
|
||||
import com.cloud.event.dao.UsageEventDao;
|
||||
import com.cloud.event.dao.UsageEventDetailsDao;
|
||||
import com.cloud.usage.dao.UsageDao;
|
||||
@ -400,7 +400,6 @@ public class UsageManagerImpl extends ManagerBase implements UsageManager, Runna
|
||||
|
||||
boolean success = false;
|
||||
long timeStart = System.currentTimeMillis();
|
||||
long deleteOldStatsTimeMillis = 0L;
|
||||
try {
|
||||
if ((endDateMillis == 0) || (endDateMillis > timeStart)) {
|
||||
endDateMillis = timeStart;
|
||||
@ -433,8 +432,6 @@ public class UsageManagerImpl extends ManagerBase implements UsageManager, Runna
|
||||
|
||||
return;
|
||||
}
|
||||
deleteOldStatsTimeMillis = startDateMillis;
|
||||
|
||||
Date startDate = new Date(startDateMillis);
|
||||
Date endDate = new Date(endDateMillis);
|
||||
if (s_logger.isInfoEnabled()) {
|
||||
@ -1766,7 +1763,7 @@ public class UsageManagerImpl extends ManagerBase implements UsageManager, Runna
|
||||
long now = System.currentTimeMillis();
|
||||
long timeToJob = _jobExecTime.getTimeInMillis() - now;
|
||||
long timeSinceJob = 0;
|
||||
long aggregationDurationMillis = _aggregationDuration * 60 * 1000;
|
||||
long aggregationDurationMillis = _aggregationDuration * 60L * 1000L;
|
||||
long lastSuccess = _usageJobDao.getLastJobSuccessDateMillis();
|
||||
if (lastSuccess > 0) {
|
||||
timeSinceJob = now - lastSuccess;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user