Fix SONAR problems

Change-Id: Id79866971b7b2c894babe45a69f22f44cf3584db
This commit is contained in:
Ray Milkey 2018-02-26 12:48:23 -08:00
parent b31c4c54f9
commit 067c44bcba
3 changed files with 5 additions and 5 deletions

View File

@ -129,7 +129,7 @@ public interface L2TunnelHandler {
private final int code;
private final String description;
public int nextId;
protected int nextId;
Result(int code, String description) {
this.code = code;

View File

@ -160,7 +160,7 @@ public class BasicServerDriver extends AbstractHandlerBehaviour {
try {
result = jsonNode.get(attribute).asText();
} catch (Exception ex) {
throw new RuntimeException(
throw new IllegalArgumentException(
"Failed to read JSON attribute: " + attribute
);
}

View File

@ -305,7 +305,7 @@ public class ServerDevicesDiscovery extends BasicServerDriver
String portTypeStr = get(nn, NIC_PARAM_PORT_TYPE);
Port.Type portType = PORT_TYPE_MAP.get(portTypeStr);
if (portType == null) {
throw new RuntimeException(
throw new IllegalArgumentException(
portTypeStr + " is not a valid port type for NIC " + nicId
);
}
@ -313,7 +313,7 @@ public class ServerDevicesDiscovery extends BasicServerDriver
String hwAddr = get(nn, NIC_PARAM_HW_ADDR);
JsonNode tagNode = nicObjNode.path(NIC_PARAM_RX_FILTER);
if (tagNode == null) {
throw new RuntimeException(
throw new IllegalArgumentException(
"The Rx filters of NIC " + nicId + " are not reported"
);
}
@ -723,7 +723,7 @@ public class ServerDevicesDiscovery extends BasicServerDriver
// And verify that this is the traffic class we want to monitor
if (!id.equals(tcId.toString())) {
throw new RuntimeException(
throw new IllegalStateException(
"Failed to retrieve monitoring data for traffic class " + tcId +
". Traffic class ID does not agree."
);