Skip to content

Commit 23a730b

Browse files
committed
No need to end exception messages with an exclamation!
1 parent 7138b8c commit 23a730b

5 files changed

Lines changed: 7 additions & 7 deletions

File tree

src/main/java/org/apache/commons/lang3/concurrent/BackgroundInitializer.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ public final synchronized ExecutorService getExternalExecutor() {
300300
*/
301301
public synchronized Future<T> getFuture() {
302302
if (future == null) {
303-
throw new IllegalStateException("start() must be called first!");
303+
throw new IllegalStateException("start() must be called first.");
304304
}
305305
return future;
306306
}
@@ -377,7 +377,7 @@ public synchronized boolean isStarted() {
377377
*/
378378
public final synchronized void setExternalExecutor(final ExecutorService externalExecutor) {
379379
if (isStarted()) {
380-
throw new IllegalStateException("Cannot set ExecutorService after start()!");
380+
throw new IllegalStateException("Cannot set ExecutorService after start().");
381381
}
382382
this.externalExecutor = externalExecutor;
383383
}

src/main/java/org/apache/commons/lang3/concurrent/MultiBackgroundInitializer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ public void addInitializer(final String name, final BackgroundInitializer<?> bac
255255
Objects.requireNonNull(backgroundInitializer, "backgroundInitializer");
256256
synchronized (this) {
257257
if (isStarted()) {
258-
throw new IllegalStateException("addInitializer() must not be called after start()!");
258+
throw new IllegalStateException("addInitializer() must not be called after start().");
259259
}
260260
childInitializers.put(name, backgroundInitializer);
261261
}

src/main/java/org/apache/commons/lang3/concurrent/TimedSemaphore.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@ public synchronized boolean isShutdown() {
421421
*/
422422
private void prepareAcquire() {
423423
if (isShutdown()) {
424-
throw new IllegalStateException("TimedSemaphore is shut down!");
424+
throw new IllegalStateException("TimedSemaphore is shut down.");
425425
}
426426
if (task == null) {
427427
task = startTimer();

src/test/java/org/apache/commons/lang3/StringUtilsAbbreviateTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ void testAbbreviate_StringStringIntInt() {
140140
assertEquals("cde", StringUtils.abbreviate("abcdefg", "", 2, 3));
141141
assertIllegalArgumentException(() -> StringUtils.abbreviate("abcdefghij", "::", 0, 2),
142142
"StringUtils.abbreviate expecting IllegalArgumentException");
143-
assertIllegalArgumentException(() -> StringUtils.abbreviate("abcdefghij", "!!!", 5, 6),
143+
assertIllegalArgumentException(() -> StringUtils.abbreviate("abcdefghij", "!!.", 5, 6),
144144
"StringUtils.abbreviate expecting IllegalArgumentException");
145145
final String raspberry = "raspberry peach";
146146
assertEquals("raspberry peach", StringUtils.abbreviate(raspberry, "--", 12, 15));

src/test/java/org/apache/commons/lang3/text/StrSubstitutorTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,11 +204,11 @@ void testCyclicReplacement() {
204204
map.put("critterColor", "brown");
205205
map.put("critterType", "${animal}");
206206
final StrSubstitutor sub = new StrSubstitutor(map);
207-
assertThrows(IllegalStateException.class, () -> sub.replace("The ${animal} jumps over the ${target}."), "Cyclic replacement was not detected!");
207+
assertThrows(IllegalStateException.class, () -> sub.replace("The ${animal} jumps over the ${target}."), "Cyclic replacement was not detected.");
208208
// also check even when default value is set.
209209
map.put("critterType", "${animal:-fox}");
210210
final StrSubstitutor sub2 = new StrSubstitutor(map);
211-
assertThrows(IllegalStateException.class, () -> sub2.replace("The ${animal} jumps over the ${target}."), "Cyclic replacement was not detected!");
211+
assertThrows(IllegalStateException.class, () -> sub2.replace("The ${animal} jumps over the ${target}."), "Cyclic replacement was not detected.");
212212
}
213213

214214
@Test

0 commit comments

Comments
 (0)