SONAR suggestions - prevent truncation of arithmetic expressions

Change-Id: I4694c0c3183b991a4f0db793f584bc77a5fb7d60
diff --git a/apps/actn-mdsc/tetunnel-ctl/src/main/java/org/onosproject/actn/mdsc/tetunnelctl/TeTunnelCtl.java b/apps/actn-mdsc/tetunnel-ctl/src/main/java/org/onosproject/actn/mdsc/tetunnelctl/TeTunnelCtl.java
index 5415e83..77961ed 100644
--- a/apps/actn-mdsc/tetunnel-ctl/src/main/java/org/onosproject/actn/mdsc/tetunnelctl/TeTunnelCtl.java
+++ b/apps/actn-mdsc/tetunnel-ctl/src/main/java/org/onosproject/actn/mdsc/tetunnelctl/TeTunnelCtl.java
@@ -254,7 +254,7 @@
 
     private TeTunnelKey getNextTeTunnelKey(TeTopologyKey key) {
         //FIXME need a better way to get a te tunnel id
-        long teTunnelId = teTunnelService.getTeTunnels(key).size() + 1;
+        long teTunnelId = teTunnelService.getTeTunnels(key).size() + 1L;
         return new TeTunnelKey(key, teTunnelId);
     }
 
diff --git a/apps/cpman/app/src/main/java/org/onosproject/cpman/gui/CpmanViewMessageHandler.java b/apps/cpman/app/src/main/java/org/onosproject/cpman/gui/CpmanViewMessageHandler.java
index 8f64844..873d23d 100644
--- a/apps/cpman/app/src/main/java/org/onosproject/cpman/gui/CpmanViewMessageHandler.java
+++ b/apps/cpman/app/src/main/java/org/onosproject/cpman/gui/CpmanViewMessageHandler.java
@@ -179,7 +179,7 @@
                     local.put(StringUtils.lowerCase(cmt.name()), data.get(cmt)[i]);
                 }
 
-                String calculated = time.minusMinutes(numOfDp - i).format(TIME_FORMAT);
+                String calculated = time.minusMinutes((long) numOfDp - i).format(TIME_FORMAT);
 
                 local.put(LABEL, calculated);
                 populateMetric(cm.addDataPoint(calculated), local);
diff --git a/apps/openstacknetworking/src/main/java/org/onosproject/openstacknetworking/impl/OpenstackRoutingSnatHandler.java b/apps/openstacknetworking/src/main/java/org/onosproject/openstacknetworking/impl/OpenstackRoutingSnatHandler.java
index 217a981..a07cdef 100644
--- a/apps/openstacknetworking/src/main/java/org/onosproject/openstacknetworking/impl/OpenstackRoutingSnatHandler.java
+++ b/apps/openstacknetworking/src/main/java/org/onosproject/openstacknetworking/impl/OpenstackRoutingSnatHandler.java
@@ -86,7 +86,7 @@
 
     private static final String ERR_PACKETIN = "Failed to handle packet in: ";
     private static final String ERR_UNSUPPORTED_NET_TYPE = "Unsupported network type";
-    private static final long TIME_OUT_SNAT_PORT_MS = 120 * 1000;
+    private static final long TIME_OUT_SNAT_PORT_MS = 120L * 1000L;
     private static final int TP_PORT_MINIMUM_NUM = 65000;
     private static final int TP_PORT_MAXIMUM_NUM = 65535;
 
diff --git a/apps/segmentrouting/src/main/java/org/onosproject/segmentrouting/DefaultRoutingHandler.java b/apps/segmentrouting/src/main/java/org/onosproject/segmentrouting/DefaultRoutingHandler.java
index fd57f09..72243bb 100644
--- a/apps/segmentrouting/src/main/java/org/onosproject/segmentrouting/DefaultRoutingHandler.java
+++ b/apps/segmentrouting/src/main/java/org/onosproject/segmentrouting/DefaultRoutingHandler.java
@@ -64,7 +64,7 @@
  */
 public class DefaultRoutingHandler {
     private static final int MAX_CONSTANT_RETRY_ATTEMPTS = 5;
-    private static final int RETRY_INTERVAL_MS = 250;
+    private static final long RETRY_INTERVAL_MS = 250L;
     private static final int RETRY_INTERVAL_SCALE = 1;
     private static final long STABLITY_THRESHOLD = 10; //secs
     private static final int UPDATE_INTERVAL = 5; //secs
diff --git a/apps/test/demo/src/main/java/org/onosproject/demo/DemoInstaller.java b/apps/test/demo/src/main/java/org/onosproject/demo/DemoInstaller.java
index 369a3af..3772bdb 100644
--- a/apps/test/demo/src/main/java/org/onosproject/demo/DemoInstaller.java
+++ b/apps/test/demo/src/main/java/org/onosproject/demo/DemoInstaller.java
@@ -588,7 +588,7 @@
             FlowRuleOperations.Builder remove = FlowRuleOperations.builder();
 
             for (Device d : devices) {
-                for (int i = 0; i < this.flowPerDevice; i++) {
+                for (long i = 0; i < this.flowPerDevice; i++) {
                     sbuilder = DefaultTrafficSelector.builder();
 
                     sbuilder.matchEthSrc(MacAddress.valueOf(RandomUtils.nextInt() * i))
@@ -771,7 +771,7 @@
                 TrafficTreatment.Builder tbuilder = DefaultTrafficTreatment.builder();
                 tbuilder.add(Instructions.createOutput(PortNumber.portNumber(2)));
                 TrafficSelector.Builder sbuilder = DefaultTrafficSelector.builder();
-                sbuilder.matchInPort(PortNumber.portNumber(i + 3));
+                sbuilder.matchInPort(PortNumber.portNumber(i + 3L));
                 sbuilder.matchEthDst(MacAddress.valueOf("12:00:00:00:00:10"));
 
                 FilteringObjective.Builder fobBuilder = DefaultFilteringObjective.builder();
diff --git a/apps/test/intent-perf/src/main/java/org/onosproject/intentperf/IntentPerfInstaller.java b/apps/test/intent-perf/src/main/java/org/onosproject/intentperf/IntentPerfInstaller.java
index 639ee84..f7e46cc 100644
--- a/apps/test/intent-perf/src/main/java/org/onosproject/intentperf/IntentPerfInstaller.java
+++ b/apps/test/intent-perf/src/main/java/org/onosproject/intentperf/IntentPerfInstaller.java
@@ -288,7 +288,7 @@
         }
 
         try {
-            workers.awaitTermination(5 * cyclePeriod, TimeUnit.MILLISECONDS);
+            workers.awaitTermination(5L * cyclePeriod, TimeUnit.MILLISECONDS);
         } catch (InterruptedException e) {
             log.warn("Failed to stop worker", e);
         }
diff --git a/apps/virtualbng/src/main/java/org/onosproject/virtualbng/VbngConfigurationManager.java b/apps/virtualbng/src/main/java/org/onosproject/virtualbng/VbngConfigurationManager.java
index 1e8a5ed..c09d7cc 100644
--- a/apps/virtualbng/src/main/java/org/onosproject/virtualbng/VbngConfigurationManager.java
+++ b/apps/virtualbng/src/main/java/org/onosproject/virtualbng/VbngConfigurationManager.java
@@ -167,7 +167,7 @@
                 return publicIpAddress;
             }
 
-            int prefixLen = prefix.getKey().prefixLength();
+            double prefixLen = prefix.getKey().prefixLength();
             int availableIpNum = (int) Math.pow(2,
                     IpPrefix.MAX_INET_MASK_LENGTH - prefixLen) - 1;
             for (int i = 1; i <= availableIpNum; i++) {
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) {
diff --git a/core/api/src/main/java/org/onosproject/net/behaviour/trafficcontrol/DefaultTokenBucket.java b/core/api/src/main/java/org/onosproject/net/behaviour/trafficcontrol/DefaultTokenBucket.java
index 8313f3f..ec3b24f 100644
--- a/core/api/src/main/java/org/onosproject/net/behaviour/trafficcontrol/DefaultTokenBucket.java
+++ b/core/api/src/main/java/org/onosproject/net/behaviour/trafficcontrol/DefaultTokenBucket.java
@@ -143,7 +143,7 @@
 
         private long rate;
         // Default to 2 * MTU
-        private long burstSize = 2 * 1500;
+        private long burstSize = 2L * 1500L;
         private Action action;
         private short dscp;
         private Type type;
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);
         }
diff --git a/core/store/primitives/src/main/java/org/onosproject/store/primitives/impl/TransactionManager.java b/core/store/primitives/src/main/java/org/onosproject/store/primitives/impl/TransactionManager.java
index 198c1ae..7d8d4c4 100644
--- a/core/store/primitives/src/main/java/org/onosproject/store/primitives/impl/TransactionManager.java
+++ b/core/store/primitives/src/main/java/org/onosproject/store/primitives/impl/TransactionManager.java
@@ -48,7 +48,7 @@
     private final PartitionService partitionService;
     private final List<PartitionId> sortedPartitions;
     private final AsyncConsistentMap<TransactionId, Transaction.State> transactions;
-    private final int cacheSize;
+    private final long cacheSize;
     private final int buckets;
     private final Map<PartitionId, Cache<String, CachedMap>> partitionCache = Maps.newConcurrentMap();
 
diff --git a/drivers/default/src/main/java/org/onosproject/driver/pipeline/SpringOpenTTP.java b/drivers/default/src/main/java/org/onosproject/driver/pipeline/SpringOpenTTP.java
index 2a5a024..4376295 100644
--- a/drivers/default/src/main/java/org/onosproject/driver/pipeline/SpringOpenTTP.java
+++ b/drivers/default/src/main/java/org/onosproject/driver/pipeline/SpringOpenTTP.java
@@ -144,7 +144,7 @@
         // ONOS-3579 workaround, let core threads die out on idle
         if (GROUP_CHECKER instanceof ScheduledThreadPoolExecutor) {
             ScheduledThreadPoolExecutor executor = (ScheduledThreadPoolExecutor) GROUP_CHECKER;
-            executor.setKeepAliveTime(CHECK_DELAY * 2, TimeUnit.MILLISECONDS);
+            executor.setKeepAliveTime(CHECK_DELAY * 2L, TimeUnit.MILLISECONDS);
             executor.allowCoreThreadTimeOut(true);
         }
     }
diff --git a/drivers/juniper/src/main/java/org/onosproject/drivers/juniper/JuniperUtils.java b/drivers/juniper/src/main/java/org/onosproject/drivers/juniper/JuniperUtils.java
index f8fb3e4..4f23b79 100644
--- a/drivers/juniper/src/main/java/org/onosproject/drivers/juniper/JuniperUtils.java
+++ b/drivers/juniper/src/main/java/org/onosproject/drivers/juniper/JuniperUtils.java
@@ -426,7 +426,7 @@
         Matcher matcher = SPEED_PATTERN.matcher(s);
         if (matcher.matches()) {
             // numeric
-            int n = Integer.parseInt(matcher.group(1));
+            long n = Long.parseLong(matcher.group(1));
             String unit = matcher.group(2);
             if ("m".equalsIgnoreCase(unit)) {
                 // Mbps
diff --git a/drivers/lumentum/src/main/java/org/onosproject/drivers/lumentum/LumentumRoadmDiscovery.java b/drivers/lumentum/src/main/java/org/onosproject/drivers/lumentum/LumentumRoadmDiscovery.java
index 79c9181..44220c1 100644
--- a/drivers/lumentum/src/main/java/org/onosproject/drivers/lumentum/LumentumRoadmDiscovery.java
+++ b/drivers/lumentum/src/main/java/org/onosproject/drivers/lumentum/LumentumRoadmDiscovery.java
@@ -99,7 +99,7 @@
                                     .set(AnnotationKeys.PORT_NAME, portDirection + "-" + portNumber)
                                     .build();
                             PortDescription p = omsPortDescription(
-                                    PortNumber.portNumber(ports.size() + 1),
+                                    PortNumber.portNumber(ports.size() + 1L),
                                     true,
                                     LumentumSnmpDevice.START_CENTER_FREQ,
                                     LumentumSnmpDevice.END_CENTER_FREQ,
@@ -117,7 +117,7 @@
                 .set(AnnotationKeys.PORT_NAME, "LINE IN")
                 .build();
         ports.add(omsPortDescription(
-                PortNumber.portNumber(ports.size() + 1),
+                PortNumber.portNumber(ports.size() + 1L),
                 true,
                 LumentumSnmpDevice.START_CENTER_FREQ,
                 LumentumSnmpDevice.END_CENTER_FREQ,
@@ -129,7 +129,7 @@
                 .set(AnnotationKeys.PORT_NAME, "LINE OUT")
                 .build();
         ports.add(omsPortDescription(
-                PortNumber.portNumber(ports.size() + 1),
+                PortNumber.portNumber(ports.size() + 1L),
                 true,
                 LumentumSnmpDevice.START_CENTER_FREQ,
                 LumentumSnmpDevice.END_CENTER_FREQ,
diff --git a/drivers/lumentum/src/main/java/org/onosproject/drivers/lumentum/LumentumWaveReadyDiscovery.java b/drivers/lumentum/src/main/java/org/onosproject/drivers/lumentum/LumentumWaveReadyDiscovery.java
index 5bd629f..3ced845 100644
--- a/drivers/lumentum/src/main/java/org/onosproject/drivers/lumentum/LumentumWaveReadyDiscovery.java
+++ b/drivers/lumentum/src/main/java/org/onosproject/drivers/lumentum/LumentumWaveReadyDiscovery.java
@@ -182,14 +182,14 @@
         Arrays.stream(s.split("\"\"")).forEach(p -> {
             if (p.contains(EIGHTFIFTY)) {
                 PortDescription cltPort = oduCltPortDescription(
-                        PortNumber.portNumber(ports.size() + 1),
+                        PortNumber.portNumber(ports.size() + 1L),
                         true,
                         CltSignalType.CLT_10GBE,
                         extractAnnotations(p));
                 ports.add(cltPort);
             } else {
                 PortDescription netPort = ochPortDescription(
-                        PortNumber.portNumber(ports.size() + 1),
+                        PortNumber.portNumber(ports.size() + 1L),
                         true,
                         OduSignalType.ODU2e,
                         true,
diff --git a/incubator/net/src/main/java/org/onosproject/incubator/net/virtual/impl/VirtualNetworkFlowRuleManager.java b/incubator/net/src/main/java/org/onosproject/incubator/net/virtual/impl/VirtualNetworkFlowRuleManager.java
index 237c3e8..3408394 100644
--- a/incubator/net/src/main/java/org/onosproject/incubator/net/virtual/impl/VirtualNetworkFlowRuleManager.java
+++ b/incubator/net/src/main/java/org/onosproject/incubator/net/virtual/impl/VirtualNetworkFlowRuleManager.java
@@ -418,7 +418,7 @@
                 return true;
             }
 
-            final long timeout = storedRule.timeout() * 1000;
+            final long timeout = storedRule.timeout() * 1000L;
             final long currentTime = System.currentTimeMillis();
 
             // Checking flow with hardTimeout
@@ -428,7 +428,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/protocols/bgp/ctl/src/main/java/org/onosproject/bgp/controller/impl/BgpKeepAliveTimer.java b/protocols/bgp/ctl/src/main/java/org/onosproject/bgp/controller/impl/BgpKeepAliveTimer.java
index 919e9af..5c66b13 100644
--- a/protocols/bgp/ctl/src/main/java/org/onosproject/bgp/controller/impl/BgpKeepAliveTimer.java
+++ b/protocols/bgp/ctl/src/main/java/org/onosproject/bgp/controller/impl/BgpKeepAliveTimer.java
@@ -49,7 +49,7 @@
     public BgpKeepAliveTimer(BgpChannelHandler h, int seconds) {
         this.handler = h;
         this.keepAliveTimer = new Timer();
-        this.keepAliveTimer.schedule(new SendKeepAlive(), 0, seconds * 1000);
+        this.keepAliveTimer.schedule(new SendKeepAlive(), 0, seconds * 1000L);
     }
 
     /**
diff --git a/protocols/lisp/ctl/src/main/java/org/onosproject/lisp/ctl/impl/LispExpireMapDatabase.java b/protocols/lisp/ctl/src/main/java/org/onosproject/lisp/ctl/impl/LispExpireMapDatabase.java
index 036e334..aab371b 100644
--- a/protocols/lisp/ctl/src/main/java/org/onosproject/lisp/ctl/impl/LispExpireMapDatabase.java
+++ b/protocols/lisp/ctl/src/main/java/org/onosproject/lisp/ctl/impl/LispExpireMapDatabase.java
@@ -39,7 +39,7 @@
  */
 public final class LispExpireMapDatabase implements LispMappingDatabase {
 
-    private static final long MINUTE_TO_MS_UNIT = 60 * 1000;
+    private static final long MINUTE_TO_MS_UNIT = 60L * 1000L;
 
     private static final Logger log = getLogger(LispExpireMapDatabase.class);
 
diff --git a/protocols/tl1/ctl/src/main/java/org/onosproject/tl1/impl/DefaultTl1Controller.java b/protocols/tl1/ctl/src/main/java/org/onosproject/tl1/impl/DefaultTl1Controller.java
index 30e7224..70ccf1f 100644
--- a/protocols/tl1/ctl/src/main/java/org/onosproject/tl1/impl/DefaultTl1Controller.java
+++ b/protocols/tl1/ctl/src/main/java/org/onosproject/tl1/impl/DefaultTl1Controller.java
@@ -245,7 +245,7 @@
                     // ctag is just in front of it
                     int ctag = Integer.parseInt(words[i - 1]);
                     // We return everything that follows to the caller (this will lose line breaks and such)
-                    String result = Arrays.stream(words).skip(i + 1).collect(Collectors.joining());
+                    String result = Arrays.stream(words).skip(i + 1L).collect(Collectors.joining());
                     // Set future when command is executed, good or bad
                     Map<Integer, CompletableFuture<String>> msg = msgMap.get(ctx.channel());
                     if (msg != null) {
diff --git a/providers/openflow/device/src/main/java/org/onosproject/provider/of/device/impl/OpenFlowDeviceProvider.java b/providers/openflow/device/src/main/java/org/onosproject/provider/of/device/impl/OpenFlowDeviceProvider.java
index 66ded21..b007af1 100644
--- a/providers/openflow/device/src/main/java/org/onosproject/provider/of/device/impl/OpenFlowDeviceProvider.java
+++ b/providers/openflow/device/src/main/java/org/onosproject/provider/of/device/impl/OpenFlowDeviceProvider.java
@@ -419,7 +419,7 @@
 
     //TODO consider renaming KBPS and MBPS (as they are used to convert by division)
     private static final long KBPS = 1_000;
-    private static final long MBPS = 1_000 * 1_000;
+    private static final long MBPS = 1_000L * 1_000L;
     private static final Frequency FREQ50 = Frequency.ofGHz(50);
     private static final Frequency FREQ191_7 = Frequency.ofGHz(191_700);
     private static final Frequency FREQ4_4 = Frequency.ofGHz(4_400);
diff --git a/providers/openflow/device/src/main/java/org/onosproject/provider/of/device/impl/PortStatsCollector.java b/providers/openflow/device/src/main/java/org/onosproject/provider/of/device/impl/PortStatsCollector.java
index cb83948..a17a690 100644
--- a/providers/openflow/device/src/main/java/org/onosproject/provider/of/device/impl/PortStatsCollector.java
+++ b/providers/openflow/device/src/main/java/org/onosproject/provider/of/device/impl/PortStatsCollector.java
@@ -36,7 +36,7 @@
 
     private final Logger log = getLogger(getClass());
 
-    private static final int SECONDS = 1000;
+    private static final long SECONDS = 1000L;
 
     private OpenFlowSwitch sw;
     private Timer timer;
diff --git a/providers/openflow/flow/src/main/java/org/onosproject/provider/of/flow/impl/FlowStatsCollector.java b/providers/openflow/flow/src/main/java/org/onosproject/provider/of/flow/impl/FlowStatsCollector.java
index 6f24fd2..f2e7137 100644
--- a/providers/openflow/flow/src/main/java/org/onosproject/provider/of/flow/impl/FlowStatsCollector.java
+++ b/providers/openflow/flow/src/main/java/org/onosproject/provider/of/flow/impl/FlowStatsCollector.java
@@ -35,7 +35,7 @@
 
     private final Logger log = getLogger(getClass());
 
-    public static final int SECONDS = 1000;
+    public static final long SECONDS = 1000L;
 
     private final OpenFlowSwitch sw;
     private Timer timer;
diff --git a/providers/openflow/flow/src/main/java/org/onosproject/provider/of/flow/impl/TableStatisticsCollector.java b/providers/openflow/flow/src/main/java/org/onosproject/provider/of/flow/impl/TableStatisticsCollector.java
index ee3f0c9..73dabeb 100644
--- a/providers/openflow/flow/src/main/java/org/onosproject/provider/of/flow/impl/TableStatisticsCollector.java
+++ b/providers/openflow/flow/src/main/java/org/onosproject/provider/of/flow/impl/TableStatisticsCollector.java
@@ -33,7 +33,7 @@
 
     private final Logger log = getLogger(getClass());
 
-    public static final int SECONDS = 1000;
+    public static final long SECONDS = 1000L;
 
     private final OpenFlowSwitch sw;
     private Timer timer;