mirror of
https://github.com/opennetworkinglab/onos.git
synced 2025-10-14 17:01:02 +02:00
SONAR suggestions - eliminate lossy arithmetic
Change-Id: I5a02ea407225ee0c9df040b74a8c0dc2ee5d5cb3
This commit is contained in:
parent
ef31005fd2
commit
961b19f66d
@ -263,7 +263,7 @@ public class VbngConfigurationManager implements VbngConfigurationService {
|
||||
|
||||
// Judge whether the prefix of this public IP address is used
|
||||
// up, if so, update the IP prefix status.
|
||||
int prefixLen = prefix.getKey().prefixLength();
|
||||
double prefixLen = prefix.getKey().prefixLength();
|
||||
int availableIpNum = (int) Math.pow(2,
|
||||
IpPrefix.MAX_INET_MASK_LENGTH - prefixLen) - 1;
|
||||
int usedIpNum = 0;
|
||||
|
@ -194,7 +194,7 @@ public class ConfigFileBasedClusterMetadataProvider implements ClusterMetadataPr
|
||||
}
|
||||
|
||||
try {
|
||||
Thread.sleep((int) Math.pow(2, iterations < 7 ? ++iterations : iterations) * 10);
|
||||
Thread.sleep((int) Math.pow(2, iterations < 7 ? ++iterations : iterations) * 10L);
|
||||
} catch (InterruptedException e) {
|
||||
throw Throwables.propagate(e);
|
||||
}
|
||||
|
@ -85,7 +85,7 @@ public class LumentumSnmpDevice {
|
||||
target.setCommunity(new OctetString("public"));
|
||||
target.setAddress(targetAddress);
|
||||
target.setRetries(3);
|
||||
target.setTimeout(1000 * 3);
|
||||
target.setTimeout(1000L * 3L);
|
||||
target.setVersion(SnmpConstants.version2c);
|
||||
target.setMaxSizeRequestPDU(MAX_SIZE_RESPONSE_PDU);
|
||||
}
|
||||
|
@ -65,7 +65,7 @@ class FlowStatsCollector implements SwitchDataCollector {
|
||||
this.pollInterval = pollInterval;
|
||||
task.cancel();
|
||||
task = new InternalTimerTask();
|
||||
timer.scheduleAtFixedRate(task, pollInterval * SECONDS, pollInterval * 1000);
|
||||
timer.scheduleAtFixedRate(task, pollInterval * SECONDS, pollInterval * 1000L);
|
||||
}
|
||||
|
||||
private class InternalTimerTask extends TimerTask {
|
||||
|
@ -63,7 +63,7 @@ class TableStatisticsCollector implements SwitchDataCollector {
|
||||
this.pollInterval = pollInterval;
|
||||
task.cancel();
|
||||
task = new InternalTimerTask();
|
||||
timer.scheduleAtFixedRate(task, pollInterval * SECONDS, pollInterval * 1000);
|
||||
timer.scheduleAtFixedRate(task, pollInterval * SECONDS, pollInterval * 1000L);
|
||||
}
|
||||
|
||||
private class InternalTimerTask extends TimerTask {
|
||||
|
Loading…
x
Reference in New Issue
Block a user