This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-lang.git

commit c4049be5f7e7ab076ae99793d647a0e0926c843c
Author: Gary Gregory <garydgreg...@gmail.com>
AuthorDate: Sun Sep 22 08:12:54 2024 -0400

    Remove trailing whitespace in StopWatch exception messages
---
 src/changes/changes.xml                                    |  1 +
 src/main/java/org/apache/commons/lang3/time/StopWatch.java | 14 +++++++-------
 2 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index 17afee8a0..647ec3a62 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -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>
diff --git a/src/main/java/org/apache/commons/lang3/time/StopWatch.java 
b/src/main/java/org/apache/commons/lang3/time/StopWatch.java
index 5b81fa94c..86eea98ca 100644
--- a/src/main/java/org/apache/commons/lang3/time/StopWatch.java
+++ b/src/main/java/org/apache/commons/lang3/time/StopWatch.java
@@ -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;
     }

Reply via email to