SONAR suggestions - prevent truncation of arithmetic expressions
Change-Id: I4694c0c3183b991a4f0db793f584bc77a5fb7d60
diff --git a/cli/src/main/java/org/onosproject/cli/net/AddTestFlowsCommand.java b/cli/src/main/java/org/onosproject/cli/net/AddTestFlowsCommand.java
index 403c006..004ebfa 100644
--- a/cli/src/main/java/org/onosproject/cli/net/AddTestFlowsCommand.java
+++ b/cli/src/main/java/org/onosproject/cli/net/AddTestFlowsCommand.java
@@ -87,7 +87,7 @@
FlowRuleOperations.Builder remove = FlowRuleOperations.builder();
for (Device d : devices) {
- for (int i = 0; i < flowsPerDevice; i++) {
+ for (long i = 0; i < flowsPerDevice; i++) {
sbuilder = DefaultTrafficSelector.builder();
sbuilder.matchEthSrc(MacAddress.valueOf(RandomUtils.nextInt() * i))
diff --git a/cli/src/main/java/org/onosproject/cli/net/IntentCycleCommand.java b/cli/src/main/java/org/onosproject/cli/net/IntentCycleCommand.java
index cdc8d79..db86d5f 100644
--- a/cli/src/main/java/org/onosproject/cli/net/IntentCycleCommand.java
+++ b/cli/src/main/java/org/onosproject/cli/net/IntentCycleCommand.java
@@ -121,7 +121,7 @@
TrafficTreatment treatment = DefaultTrafficTreatment.emptyTreatment();
List<Intent> intents = Lists.newArrayList();
- for (int i = 0; i < count; i++) {
+ for (long i = 0; i < count; i++) {
TrafficSelector selector = selectorBldr
.matchEthSrc(MacAddress.valueOf(i + keyOffset))
.build();
diff --git a/cli/src/main/java/org/onosproject/cli/net/IntentPushTestCommand.java b/cli/src/main/java/org/onosproject/cli/net/IntentPushTestCommand.java
index 92209d7..0b28f92 100644
--- a/cli/src/main/java/org/onosproject/cli/net/IntentPushTestCommand.java
+++ b/cli/src/main/java/org/onosproject/cli/net/IntentPushTestCommand.java
@@ -134,7 +134,7 @@
TrafficTreatment treatment = DefaultTrafficTreatment.emptyTreatment();
List<Intent> intents = Lists.newArrayList();
- for (int i = 0; i < count; i++) {
+ for (long i = 0; i < count; i++) {
TrafficSelector selector = selectorBldr
.matchEthSrc(MacAddress.valueOf(i + keyOffset))
.build();
@@ -167,7 +167,7 @@
try {
// In this way with the tests in place the timeout will be
// 61 seconds.
- if (latch.await(1000 + count * 60, TimeUnit.MILLISECONDS)) {
+ if (latch.await(1000L + count * 60L, TimeUnit.MILLISECONDS)) {
printResults(count);
} else {
print("Failure: %d intents not installed", latch.getCount());
diff --git a/cli/src/main/java/org/onosproject/cli/net/WipeOutCommand.java b/cli/src/main/java/org/onosproject/cli/net/WipeOutCommand.java
index e137d00..cd42752 100644
--- a/cli/src/main/java/org/onosproject/cli/net/WipeOutCommand.java
+++ b/cli/src/main/java/org/onosproject/cli/net/WipeOutCommand.java
@@ -96,7 +96,7 @@
intentsToWithdrawn.forEach(intentService::withdraw);
try {
// Wait 1.5 seconds for each Intent
- completableFuture.get(intentsToWithdrawn.size() * 1500, TimeUnit.MILLISECONDS);
+ completableFuture.get(intentsToWithdrawn.size() * 1500L, TimeUnit.MILLISECONDS);
} catch (InterruptedException e) {
print("Got interrupted exception while withdrawn Intents " + e.toString());
} catch (ExecutionException e) {