Remove trailing whitespace in StopWatch exception messages

This commit is contained in:
Gary Gregory 2024-09-22 08:12:54 -04:00
parent da246244ae
commit c4049be5f7
2 changed files with 8 additions and 7 deletions

View File

@ -52,6 +52,7 @@ The <action> type attribute can be add,update,fix,remove.
<action type="fix" dev="ggregory" due-to="Gary Gregory">Speed up and sanitize StopWatchTest.</action>
<action type="fix" dev="ggregory" due-to="Fabrice Benhamouda">Fix handling of non-ASCII letters and numbers in RandomStringUtils #1273.</action>
<action type="fix" dev="ggregory" due-to="OSS-Fuzz, Gary Gregory">Rewrite ClassUtils.getClass(...) without recursion to avoid StackOverflowError on very long inputs. OSS-Fuzz Issue 42522972: apache-commons-text:StringSubstitutorInterpolatorFuzzer: Security exception in org.apache.commons.lang3.ClassUtils.getClass.</action>
<action type="add" dev="ggregory" due-to="Gary Gregory">Remove trailing whitespace in StopWatch exception messages.</action>
<!-- ADD -->
<action type="add" dev="ggregory" due-to="Gary Gregory">Add Strings and refactor StringUtils.</action>
<action type="add" dev="ggregory" due-to="Gary Gregory">Add StopWatch.run([Failable]Runnable) and get([Failable]Supplier).</action>

View File

@ -578,7 +578,7 @@ public class StopWatch {
*/
public void resume() {
if (runningState != State.SUSPENDED) {
throw new IllegalStateException("Stopwatch must be suspended to resume. ");
throw new IllegalStateException("Stopwatch must be suspended to resume.");
}
startTimeNanos += System.nanoTime() - stopTimeNanos;
runningState = State.RUNNING;
@ -628,7 +628,7 @@ public class StopWatch {
*/
public void split() {
if (runningState != State.RUNNING) {
throw new IllegalStateException("Stopwatch is not running. ");
throw new IllegalStateException("Stopwatch is not running.");
}
stopTimeNanos = System.nanoTime();
splitState = SplitState.SPLIT;
@ -645,10 +645,10 @@ public class StopWatch {
*/
public void start() {
if (runningState == State.STOPPED) {
throw new IllegalStateException("Stopwatch must be reset before being restarted. ");
throw new IllegalStateException("Stopwatch must be reset before being restarted.");
}
if (runningState != State.UNSTARTED) {
throw new IllegalStateException("Stopwatch already started. ");
throw new IllegalStateException("Stopwatch already started.");
}
startTimeNanos = System.nanoTime();
startInstant = Instant.now();
@ -677,7 +677,7 @@ public class StopWatch {
*/
public void stop() {
if (runningState != State.RUNNING && runningState != State.SUSPENDED) {
throw new IllegalStateException("Stopwatch is not running. ");
throw new IllegalStateException("Stopwatch is not running.");
}
if (runningState == State.RUNNING) {
stopTimeNanos = System.nanoTime();
@ -697,7 +697,7 @@ public class StopWatch {
*/
public void suspend() {
if (runningState != State.RUNNING) {
throw new IllegalStateException("Stopwatch must be running to suspend. ");
throw new IllegalStateException("Stopwatch must be running to suspend.");
}
stopTimeNanos = System.nanoTime();
stopInstant = Instant.now();
@ -749,7 +749,7 @@ public class StopWatch {
*/
public void unsplit() {
if (splitState != SplitState.SPLIT) {
throw new IllegalStateException("Stopwatch has not been split. ");
throw new IllegalStateException("Stopwatch has not been split.");
}
splitState = SplitState.UNSPLIT;
}