Sonar fixes

- Missing break statement
- integer arithmetic for a long expression

Change-Id: If3d8ef43590cd81073029643057e21ff51b6a1e9
This commit is contained in:
Ray Milkey 2018-07-02 10:22:57 -07:00
parent f325a60933
commit bcc53d3268
2 changed files with 4 additions and 3 deletions

View File

@ -180,6 +180,7 @@ public final class OpenstackSwitchingHandler {
setFlatJumpRules(instPort, false);
setUpstreamRulesForFlat(instPort, false);
setDownstreamRulesForFlat(instPort, false);
break;
default:
log.warn("Unsupported network type {}", type.name());
break;

View File

@ -88,8 +88,8 @@ public class StatsFlowRuleManager implements StatsFlowRuleAdminService {
private static final byte FLOW_TYPE_SONA = 1; // VLAN
private static final int MILLISECONDS = 1000;
private static final int REFRESH_INTERVAL = 5;
private static final long MILLISECONDS = 1000L;
private static final long REFRESH_INTERVAL = 5L;
private ApplicationId appId;
@ -328,7 +328,7 @@ public class StatsFlowRuleManager implements StatsFlowRuleAdminService {
// TODO: need to make the refresh interval configurable
sBuilder.withStartupTime(System.currentTimeMillis())
.withFstPktArrTime(System.currentTimeMillis())
.withLstPktOffset(REFRESH_INTERVAL * MILLISECONDS)
.withLstPktOffset((int) (REFRESH_INTERVAL * MILLISECONDS))
.withCurrAccPkts((int) entry.packets())
.withCurrAccBytes(entry.bytes())
.withErrorPkts((short) 0)