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:02:16 UTC

(commons-collections) 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-collections.git


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

commit 7f0ec2c9e89085f819d150608739fd98a3de87ef
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Wed Apr 15 08:02:10 2026 -0400

    No need to end exception messages with an exclamation!
---
 .../java/org/apache/commons/collections4/list/LazyList.java  |  4 ++--
 .../java/org/apache/commons/collections4/list/TreeList.java  |  2 +-
 .../commons/collections4/trie/AbstractPatriciaTrie.java      | 12 ++++++------
 .../collection/PredicatedCollectionBuilderTest.java          |  4 ++--
 4 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/src/main/java/org/apache/commons/collections4/list/LazyList.java b/src/main/java/org/apache/commons/collections4/list/LazyList.java
index 1883bafa4..02f3df99b 100644
--- a/src/main/java/org/apache/commons/collections4/list/LazyList.java
+++ b/src/main/java/org/apache/commons/collections4/list/LazyList.java
@@ -137,7 +137,7 @@ public class LazyList<E> extends AbstractSerializableListDecorator<E> {
         if (transformer != null) {
             return transformer.apply(index);
         }
-        throw new IllegalStateException("Factory and Transformer are both null!");
+        throw new IllegalStateException("Factory and Transformer are both null.");
     }
 
     /**
@@ -185,7 +185,7 @@ public class LazyList<E> extends AbstractSerializableListDecorator<E> {
         if (transformer != null) {
             return new LazyList<>(sub, transformer);
         }
-        throw new IllegalStateException("Factory and Transformer are both null!");
+        throw new IllegalStateException("Factory and Transformer are both null.");
     }
 
 }
diff --git a/src/main/java/org/apache/commons/collections4/list/TreeList.java b/src/main/java/org/apache/commons/collections4/list/TreeList.java
index 57c15b24e..f2552dc7f 100644
--- a/src/main/java/org/apache/commons/collections4/list/TreeList.java
+++ b/src/main/java/org/apache/commons/collections4/list/TreeList.java
@@ -302,7 +302,7 @@ public class TreeList<E> extends AbstractList<E> {
                 }
                 return rotateLeft();
             default:
-                throw new IllegalStateException("tree inconsistent!");
+                throw new IllegalStateException("tree inconsistent.");
             }
         }
 
diff --git a/src/main/java/org/apache/commons/collections4/trie/AbstractPatriciaTrie.java b/src/main/java/org/apache/commons/collections4/trie/AbstractPatriciaTrie.java
index 4de933dc9..78d2368a5 100644
--- a/src/main/java/org/apache/commons/collections4/trie/AbstractPatriciaTrie.java
+++ b/src/main/java/org/apache/commons/collections4/trie/AbstractPatriciaTrie.java
@@ -743,7 +743,7 @@ public abstract class AbstractPatriciaTrie<K, V> extends AbstractBitwiseTrie<K,
                                 final K toKey, final boolean toInclusive) {
 
             if (fromKey == null && toKey == null) {
-                throw new IllegalArgumentException("must have a from or to!");
+                throw new IllegalArgumentException("must have a from or to.");
             }
 
             if (fromKey != null && toKey != null && getKeyAnalyzer().compare(fromKey, toKey) > 0) {
@@ -1976,7 +1976,7 @@ public abstract class AbstractPatriciaTrie<K, V> extends AbstractBitwiseTrie<K,
      */
     TrieEntry<K, V> previousEntry(final TrieEntry<K, V> start) {
         if (start.predecessor == null) {
-            throw new IllegalArgumentException("must have come from somewhere!");
+            throw new IllegalArgumentException("must have come from somewhere.");
         }
 
         if (start.predecessor.right == start) {
@@ -2156,10 +2156,10 @@ public abstract class AbstractPatriciaTrie<K, V> extends AbstractBitwiseTrie<K,
      */
     private void removeExternalEntry(final TrieEntry<K, V> h) {
         if (h == root) {
-            throw new IllegalArgumentException("Cannot delete root Entry!");
+            throw new IllegalArgumentException("Cannot delete root Entry.");
         }
         if (!h.isExternalNode()) {
-            throw new IllegalArgumentException(h + " is not an external Entry!");
+            throw new IllegalArgumentException(h + " is not an external Entry.");
         }
 
         final TrieEntry<K, V> parent = h.parent;
@@ -2189,10 +2189,10 @@ public abstract class AbstractPatriciaTrie<K, V> extends AbstractBitwiseTrie<K,
      */
     private void removeInternalEntry(final TrieEntry<K, V> h) {
         if (h == root) {
-            throw new IllegalArgumentException("Cannot delete root Entry!");
+            throw new IllegalArgumentException("Cannot delete root Entry.");
         }
         if (!h.isInternalNode()) {
-            throw new IllegalArgumentException(h + " is not an internal Entry!");
+            throw new IllegalArgumentException(h + " is not an internal Entry.");
         }
 
         final TrieEntry<K, V> p = h.predecessor;
diff --git a/src/test/java/org/apache/commons/collections4/collection/PredicatedCollectionBuilderTest.java b/src/test/java/org/apache/commons/collections4/collection/PredicatedCollectionBuilderTest.java
index acbfd4aa2..c34be5da6 100644
--- a/src/test/java/org/apache/commons/collections4/collection/PredicatedCollectionBuilderTest.java
+++ b/src/test/java/org/apache/commons/collections4/collection/PredicatedCollectionBuilderTest.java
@@ -48,13 +48,13 @@ class PredicatedCollectionBuilderTest {
         collection.add("test2");
         assertEquals(2, collection.size());
 
-        assertThrows(IllegalArgumentException.class, () -> collection.add(null), "Expecting IllegalArgumentException for failing predicate!");
+        assertThrows(IllegalArgumentException.class, () -> collection.add(null), "Expecting IllegalArgumentException for failing predicate.");
 
     }
 
     private void checkPredicatedCollection2(final Collection<Integer> collection) {
         assertEquals(2, collection.size());
-        assertThrows(IllegalArgumentException.class, () -> collection.add(4), "Expecting IllegalArgumentException for failing predicate!");
+        assertThrows(IllegalArgumentException.class, () -> collection.add(4), "Expecting IllegalArgumentException for failing predicate.");
         assertEquals(2, collection.size());
 
         collection.add(5);