SONAR suggestions - prevent truncation of arithmetic expressions
Change-Id: I4694c0c3183b991a4f0db793f584bc77a5fb7d60
diff --git a/core/net/src/main/java/org/onosproject/cluster/impl/ConfigFileBasedClusterMetadataProvider.java b/core/net/src/main/java/org/onosproject/cluster/impl/ConfigFileBasedClusterMetadataProvider.java
index cd21490..99920f9 100644
--- a/core/net/src/main/java/org/onosproject/cluster/impl/ConfigFileBasedClusterMetadataProvider.java
+++ b/core/net/src/main/java/org/onosproject/cluster/impl/ConfigFileBasedClusterMetadataProvider.java
@@ -182,7 +182,7 @@
}
private Versioned<ClusterMetadata> blockForMetadata(String metadataUrl) {
- int iterations = 0;
+ long iterations = 0;
for (;;) {
try {
Versioned<ClusterMetadata> metadata = fetchMetadata(metadataUrl);
diff --git a/core/net/src/main/java/org/onosproject/net/flow/impl/FlowRuleManager.java b/core/net/src/main/java/org/onosproject/net/flow/impl/FlowRuleManager.java
index 994303e..9c1a31a 100644
--- a/core/net/src/main/java/org/onosproject/net/flow/impl/FlowRuleManager.java
+++ b/core/net/src/main/java/org/onosproject/net/flow/impl/FlowRuleManager.java
@@ -474,7 +474,7 @@
return true;
}
- final long timeout = storedRule.timeout() * 1000;
+ final long timeout = storedRule.timeout() * 1000L;
final long currentTime = System.currentTimeMillis();
// Checking flow with hardTimeout
@@ -484,7 +484,7 @@
firstSeen.put(storedRule, currentTime);
} else {
Long first = firstSeen.get(storedRule);
- final long hardTimeout = storedRule.hardTimeout() * 1000;
+ final long hardTimeout = storedRule.hardTimeout() * 1000L;
if ((currentTime - first) > hardTimeout) {
return false;
}
diff --git a/core/net/src/main/java/org/onosproject/net/intent/impl/IntentCleanup.java b/core/net/src/main/java/org/onosproject/net/intent/impl/IntentCleanup.java
index 021e3ac..21c3efc 100644
--- a/core/net/src/main/java/org/onosproject/net/intent/impl/IntentCleanup.java
+++ b/core/net/src/main/java/org/onosproject/net/intent/impl/IntentCleanup.java
@@ -160,8 +160,8 @@
}
};
// Convert to ms
- periodMs = period * 1_000;
- periodMsForStuck = INSTALLING_WITHDRAWING_PERIOD * 1000;
+ periodMs = period * 1_000L;
+ periodMsForStuck = INSTALLING_WITHDRAWING_PERIOD * 1000L;
// Schedule the executions
timer.scheduleAtFixedRate(timerTask, periodMs, periodMs);
}