Checkstyle rule to prevent throwing the generic RuntimeException
This is a frequent cause of sonar breakage.
Change-Id: I54e0044447633a61bab560b020b57ed0a6875ebe
diff --git a/utils/misc/src/test/java/org/onlab/util/ManuallyAdvancingTimer.java b/utils/misc/src/test/java/org/onlab/util/ManuallyAdvancingTimer.java
index 1e965de..85eb35f 100644
--- a/utils/misc/src/test/java/org/onlab/util/ManuallyAdvancingTimer.java
+++ b/utils/misc/src/test/java/org/onlab/util/ManuallyAdvancingTimer.java
@@ -295,7 +295,7 @@
currExecTime = TestUtils.getField(currTask, "nextExecutionTime");
} catch (TestUtils.TestUtilsException e) {
e.printStackTrace();
- throw new RuntimeException("Could not get nextExecutionTime");
+ throw new IllegalStateException("Could not get nextExecutionTime");
}
while (currExecTime <= timerKeeper.currentTimeInMillis()) {
if (executeTask(queue.pop())) {
@@ -309,7 +309,7 @@
currExecTime = TestUtils.getField(currTask, "nextExecutionTime");
} catch (TestUtils.TestUtilsException e) {
e.printStackTrace();
- throw new RuntimeException("Could not get nextExecutionTime");
+ throw new IllegalStateException("Could not get nextExecutionTime");
}
}
return totalRun;
@@ -461,7 +461,7 @@
executionTimeTwo = TestUtils.getField(o2, "nextExecutionTime");
} catch (TestUtils.TestUtilsException e) {
e.printStackTrace();
- throw new RuntimeException("Could not get next execution time.");
+ throw new IllegalStateException("Could not get next execution time.");
}
if (executionTimeOne == executionTimeTwo) {
return 0;