Fix some sonar suggestions

- use long arithmetic for long expressions
- exit routine after determining that a pointer is null

Change-Id: I755b1533773f6838e88ba94ced376f30576c275b
This commit is contained in:
Ray Milkey 2018-06-18 08:54:51 -07:00
parent 10f0d51401
commit cc7a176d85
3 changed files with 4 additions and 3 deletions

View File

@ -469,6 +469,7 @@ public class LumentumNetconfRoadmFlowRuleProgrammable extends AbstractHandlerBeh
if (pair == null) {
log.error("Lumentum RPC delete-connection, connection not found on the local cache");
throw new IllegalStateException("Lumentum RPC delete-connection, connection not found on the local cache");
}
String module = pair.getLeft().toString();

View File

@ -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);
}

View File

@ -182,14 +182,14 @@ public class LumentumWaveReadyDiscovery extends AbstractHandlerBehaviour impleme
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,