Fix SONAR problems
Change-Id: Id79866971b7b2c894babe45a69f22f44cf3584db
diff --git a/apps/segmentrouting/app/src/main/java/org/onosproject/segmentrouting/pwaas/L2TunnelHandler.java b/apps/segmentrouting/app/src/main/java/org/onosproject/segmentrouting/pwaas/L2TunnelHandler.java
index 3a89a21..044ad41 100644
--- a/apps/segmentrouting/app/src/main/java/org/onosproject/segmentrouting/pwaas/L2TunnelHandler.java
+++ b/apps/segmentrouting/app/src/main/java/org/onosproject/segmentrouting/pwaas/L2TunnelHandler.java
@@ -129,7 +129,7 @@
private final int code;
private final String description;
- public int nextId;
+ protected int nextId;
Result(int code, String description) {
this.code = code;
diff --git a/drivers/server/src/main/java/org/onosproject/drivers/server/BasicServerDriver.java b/drivers/server/src/main/java/org/onosproject/drivers/server/BasicServerDriver.java
index fa8ee63..ba16a3a 100644
--- a/drivers/server/src/main/java/org/onosproject/drivers/server/BasicServerDriver.java
+++ b/drivers/server/src/main/java/org/onosproject/drivers/server/BasicServerDriver.java
@@ -160,7 +160,7 @@
try {
result = jsonNode.get(attribute).asText();
} catch (Exception ex) {
- throw new RuntimeException(
+ throw new IllegalArgumentException(
"Failed to read JSON attribute: " + attribute
);
}
diff --git a/drivers/server/src/main/java/org/onosproject/drivers/server/ServerDevicesDiscovery.java b/drivers/server/src/main/java/org/onosproject/drivers/server/ServerDevicesDiscovery.java
index 3adb0b4..694320d 100644
--- a/drivers/server/src/main/java/org/onosproject/drivers/server/ServerDevicesDiscovery.java
+++ b/drivers/server/src/main/java/org/onosproject/drivers/server/ServerDevicesDiscovery.java
@@ -305,7 +305,7 @@
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 @@
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 @@
// 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."
);