You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2026/04/15 12:16:19 UTC

(commons-lang) branch master updated: No need to end exception messages with an exclamation!

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


The following commit(s) were added to refs/heads/master by this push:
     new 23a730b8e No need to end exception messages with an exclamation!
23a730b8e is described below

commit 23a730b8ed392ba424cc275df793dcae88f4cebe
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Wed Apr 15 08:16:13 2026 -0400

    No need to end exception messages with an exclamation!
---
 .../org/apache/commons/lang3/concurrent/BackgroundInitializer.java    | 4 ++--
 .../apache/commons/lang3/concurrent/MultiBackgroundInitializer.java   | 2 +-
 src/main/java/org/apache/commons/lang3/concurrent/TimedSemaphore.java | 2 +-
 src/test/java/org/apache/commons/lang3/StringUtilsAbbreviateTest.java | 2 +-
 src/test/java/org/apache/commons/lang3/text/StrSubstitutorTest.java   | 4 ++--
 5 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/src/main/java/org/apache/commons/lang3/concurrent/BackgroundInitializer.java b/src/main/java/org/apache/commons/lang3/concurrent/BackgroundInitializer.java
index 2be935ad0..e0ab8b155 100644
--- a/src/main/java/org/apache/commons/lang3/concurrent/BackgroundInitializer.java
+++ b/src/main/java/org/apache/commons/lang3/concurrent/BackgroundInitializer.java
@@ -300,7 +300,7 @@ public final synchronized ExecutorService getExternalExecutor() {
      */
     public synchronized Future<T> getFuture() {
         if (future == null) {
-            throw new IllegalStateException("start() must be called first!");
+            throw new IllegalStateException("start() must be called first.");
         }
         return future;
     }
@@ -377,7 +377,7 @@ public synchronized boolean isStarted() {
      */
     public final synchronized void setExternalExecutor(final ExecutorService externalExecutor) {
         if (isStarted()) {
-            throw new IllegalStateException("Cannot set ExecutorService after start()!");
+            throw new IllegalStateException("Cannot set ExecutorService after start().");
         }
         this.externalExecutor = externalExecutor;
     }
diff --git a/src/main/java/org/apache/commons/lang3/concurrent/MultiBackgroundInitializer.java b/src/main/java/org/apache/commons/lang3/concurrent/MultiBackgroundInitializer.java
index 813155b25..68fa95d58 100644
--- a/src/main/java/org/apache/commons/lang3/concurrent/MultiBackgroundInitializer.java
+++ b/src/main/java/org/apache/commons/lang3/concurrent/MultiBackgroundInitializer.java
@@ -255,7 +255,7 @@ public void addInitializer(final String name, final BackgroundInitializer<?> bac
         Objects.requireNonNull(backgroundInitializer, "backgroundInitializer");
         synchronized (this) {
             if (isStarted()) {
-                throw new IllegalStateException("addInitializer() must not be called after start()!");
+                throw new IllegalStateException("addInitializer() must not be called after start().");
             }
             childInitializers.put(name, backgroundInitializer);
         }
diff --git a/src/main/java/org/apache/commons/lang3/concurrent/TimedSemaphore.java b/src/main/java/org/apache/commons/lang3/concurrent/TimedSemaphore.java
index 941f40399..d25f1e135 100644
--- a/src/main/java/org/apache/commons/lang3/concurrent/TimedSemaphore.java
+++ b/src/main/java/org/apache/commons/lang3/concurrent/TimedSemaphore.java
@@ -421,7 +421,7 @@ public synchronized boolean isShutdown() {
      */
     private void prepareAcquire() {
         if (isShutdown()) {
-            throw new IllegalStateException("TimedSemaphore is shut down!");
+            throw new IllegalStateException("TimedSemaphore is shut down.");
         }
         if (task == null) {
             task = startTimer();
diff --git a/src/test/java/org/apache/commons/lang3/StringUtilsAbbreviateTest.java b/src/test/java/org/apache/commons/lang3/StringUtilsAbbreviateTest.java
index cf947ee11..a48f023a2 100644
--- a/src/test/java/org/apache/commons/lang3/StringUtilsAbbreviateTest.java
+++ b/src/test/java/org/apache/commons/lang3/StringUtilsAbbreviateTest.java
@@ -140,7 +140,7 @@ void testAbbreviate_StringStringIntInt() {
         assertEquals("cde", StringUtils.abbreviate("abcdefg", "", 2, 3));
         assertIllegalArgumentException(() -> StringUtils.abbreviate("abcdefghij", "::", 0, 2),
                 "StringUtils.abbreviate expecting IllegalArgumentException");
-        assertIllegalArgumentException(() -> StringUtils.abbreviate("abcdefghij", "!!!", 5, 6),
+        assertIllegalArgumentException(() -> StringUtils.abbreviate("abcdefghij", "!!.", 5, 6),
                 "StringUtils.abbreviate expecting IllegalArgumentException");
         final String raspberry = "raspberry peach";
         assertEquals("raspberry peach", StringUtils.abbreviate(raspberry, "--", 12, 15));
diff --git a/src/test/java/org/apache/commons/lang3/text/StrSubstitutorTest.java b/src/test/java/org/apache/commons/lang3/text/StrSubstitutorTest.java
index 251b5ba7f..b5a175680 100644
--- a/src/test/java/org/apache/commons/lang3/text/StrSubstitutorTest.java
+++ b/src/test/java/org/apache/commons/lang3/text/StrSubstitutorTest.java
@@ -204,11 +204,11 @@ void testCyclicReplacement() {
         map.put("critterColor", "brown");
         map.put("critterType", "${animal}");
         final StrSubstitutor sub = new StrSubstitutor(map);
-        assertThrows(IllegalStateException.class, () -> sub.replace("The ${animal} jumps over the ${target}."), "Cyclic replacement was not detected!");
+        assertThrows(IllegalStateException.class, () -> sub.replace("The ${animal} jumps over the ${target}."), "Cyclic replacement was not detected.");
         // also check even when default value is set.
         map.put("critterType", "${animal:-fox}");
         final StrSubstitutor sub2 = new StrSubstitutor(map);
-        assertThrows(IllegalStateException.class, () -> sub2.replace("The ${animal} jumps over the ${target}."), "Cyclic replacement was not detected!");
+        assertThrows(IllegalStateException.class, () -> sub2.replace("The ${animal} jumps over the ${target}."), "Cyclic replacement was not detected.");
     }
 
     @Test