Skip to content

Commit 0bd8c21

Browse files
committed
No need to end exception messages with an exclamation!
1 parent 9bff4e1 commit 0bd8c21

63 files changed

Lines changed: 131 additions & 131 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/main/java/org/apache/commons/configuration2/AbstractConfiguration.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ private static <T> Collection<T> handleDefaultCollection(final Collection<T> tar
177177
* @param key the key (to be part of the error message)
178178
*/
179179
private static void throwMissingPropertyException(final String key) {
180-
throw new NoSuchElementException(String.format("Key '%s' does not map to an existing object!", key));
180+
throw new NoSuchElementException(String.format("Key '%s' does not map to an existing object.", key));
181181
}
182182

183183
/** The list delimiter handler. */
@@ -795,7 +795,7 @@ public Duration getDuration(final String key, final Duration defaultValue) {
795795
public String getEncodedString(final String key) {
796796
final ConfigurationDecoder decoder = getConfigurationDecoder();
797797
if (decoder == null) {
798-
throw new IllegalStateException("No default ConfigurationDecoder defined!");
798+
throw new IllegalStateException("No default ConfigurationDecoder defined.");
799799
}
800800
return getEncodedString(key, decoder);
801801
}
@@ -808,7 +808,7 @@ public String getEncodedString(final String key) {
808808
@Override
809809
public String getEncodedString(final String key, final ConfigurationDecoder decoder) {
810810
if (decoder == null) {
811-
throw new IllegalArgumentException("ConfigurationDecoder must not be null!");
811+
throw new IllegalArgumentException("ConfigurationDecoder must not be null.");
812812
}
813813

814814
final String value = getString(key);
@@ -1313,7 +1313,7 @@ public void setConfigurationDecoder(final ConfigurationDecoder configurationDeco
13131313
*/
13141314
public void setConversionHandler(final ConversionHandler conversionHandler) {
13151315
if (conversionHandler == null) {
1316-
throw new IllegalArgumentException("ConversionHandler must not be null!");
1316+
throw new IllegalArgumentException("ConversionHandler must not be null.");
13171317
}
13181318
this.conversionHandler = conversionHandler;
13191319
}
@@ -1379,7 +1379,7 @@ public final void setInterpolator(final ConfigurationInterpolator ci) {
13791379
*/
13801380
public void setListDelimiterHandler(final ListDelimiterHandler listDelimiterHandler) {
13811381
if (listDelimiterHandler == null) {
1382-
throw new IllegalArgumentException("List delimiter handler must not be null!");
1382+
throw new IllegalArgumentException("List delimiter handler must not be null.");
13831383
}
13841384
this.listDelimiterHandler = listDelimiterHandler;
13851385
}

src/main/java/org/apache/commons/configuration2/CombinedConfiguration.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -399,13 +399,13 @@ public void addConfiguration(final Configuration config, final String name) {
399399
*/
400400
public void addConfiguration(final Configuration config, final String name, final String at) {
401401
if (config == null) {
402-
throw new IllegalArgumentException("Added configuration must not be null!");
402+
throw new IllegalArgumentException("Added configuration must not be null.");
403403
}
404404

405405
beginWrite(true);
406406
try {
407407
if (name != null && namedConfigurations.containsKey(name)) {
408-
throw new ConfigurationRuntimeException("A configuration with the name '" + name + "' already exists in this combined configuration!");
408+
throw new ConfigurationRuntimeException("A configuration with the name '" + name + "' already exists in this combined configuration.");
409409
}
410410

411411
final ConfigData cd = new ConfigData(config, name, at);
@@ -706,7 +706,7 @@ private int getNumberOfConfigurationsInternal() {
706706
*/
707707
public Configuration getSource(final String key) {
708708
if (key == null) {
709-
throw new IllegalArgumentException("Key must not be null!");
709+
throw new IllegalArgumentException("Key must not be null.");
710710
}
711711

712712
final Set<Configuration> sources = getSources(key);
@@ -716,7 +716,7 @@ public Configuration getSource(final String key) {
716716
final Iterator<Configuration> iterator = sources.iterator();
717717
final Configuration source = iterator.next();
718718
if (iterator.hasNext()) {
719-
throw new IllegalArgumentException("The key " + key + " is defined by multiple sources!");
719+
throw new IllegalArgumentException("The key " + key + " is defined by multiple sources.");
720720
}
721721
return source;
722722
}
@@ -900,7 +900,7 @@ public void setConversionExpressionEngine(final ExpressionEngine conversionExpre
900900
*/
901901
public void setNodeCombiner(final NodeCombiner nodeCombiner) {
902902
if (nodeCombiner == null) {
903-
throw new IllegalArgumentException("Node combiner must not be null!");
903+
throw new IllegalArgumentException("Node combiner must not be null.");
904904
}
905905

906906
beginWrite(true);

src/main/java/org/apache/commons/configuration2/CompositeConfiguration.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -409,14 +409,14 @@ protected Object getPropertyInternal(final String key) {
409409
*/
410410
public Configuration getSource(final String key) {
411411
if (key == null) {
412-
throw new IllegalArgumentException("Key must not be null!");
412+
throw new IllegalArgumentException("Key must not be null.");
413413
}
414414

415415
Configuration source = null;
416416
for (final Configuration conf : configList) {
417417
if (conf.containsKey(key)) {
418418
if (source != null) {
419-
throw new IllegalArgumentException("The key " + key + " is defined by multiple sources!");
419+
throw new IllegalArgumentException("The key " + key + " is defined by multiple sources.");
420420
}
421421
source = conf;
422422
}

src/main/java/org/apache/commons/configuration2/ConfigurationLookup.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public class ConfigurationLookup implements Lookup {
4444
*/
4545
public ConfigurationLookup(final ImmutableConfiguration config) {
4646
if (config == null) {
47-
throw new IllegalArgumentException("Configuration must not be null!");
47+
throw new IllegalArgumentException("Configuration must not be null.");
4848
}
4949
configuration = config;
5050
}

src/main/java/org/apache/commons/configuration2/ConfigurationUtils.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ public static Object cloneIfPossible(final Object obj) {
219219
*/
220220
public static Synchronizer cloneSynchronizer(final Synchronizer sync) {
221221
if (sync == null) {
222-
throw new IllegalArgumentException("Synchronizer must not be null!");
222+
throw new IllegalArgumentException("Synchronizer must not be null.");
223223
}
224224
if (NoOpSynchronizer.INSTANCE == sync) {
225225
return sync;
@@ -401,7 +401,7 @@ public static void dump(final ImmutableConfiguration configuration, final PrintW
401401
*/
402402
public static void enableRuntimeExceptions(final Configuration src) {
403403
if (!(src instanceof EventSource)) {
404-
throw new IllegalArgumentException("Configuration must implement EventSource!");
404+
throw new IllegalArgumentException("Configuration must implement EventSource.");
405405
}
406406
((EventSource) src).addEventListener(ConfigurationErrorEvent.ANY, event -> {
407407
// Throw a runtime exception

src/main/java/org/apache/commons/configuration2/ConfigurationXMLReader.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ public void parse(final String systemId) throws IOException, SAXException {
234234
*/
235235
protected void parseConfiguration() throws IOException, SAXException {
236236
if (getParsedConfiguration() == null) {
237-
throw new IOException("No configuration specified!");
237+
throw new IOException("No configuration specified.");
238238
}
239239

240240
if (getContentHandler() != null) {

src/main/java/org/apache/commons/configuration2/DynamicCombinedConfiguration.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -706,7 +706,7 @@ public Short getShort(final String key, final Short defaultValue) {
706706
@Override
707707
public Configuration getSource(final String key) {
708708
if (key == null) {
709-
throw new IllegalArgumentException("Key must not be null!");
709+
throw new IllegalArgumentException("Key must not be null.");
710710
}
711711
return getCurrentConfig().getSource(key);
712712
}
@@ -892,7 +892,7 @@ public void setLoggerName(final String name) {
892892
@Override
893893
public void setNodeCombiner(final NodeCombiner nodeCombiner) {
894894
if (nodeCombiner == null) {
895-
throw new IllegalArgumentException("Node combiner must not be null!");
895+
throw new IllegalArgumentException("Node combiner must not be null.");
896896
}
897897
this.nodeCombiner = nodeCombiner;
898898
invalidateAll();

src/main/java/org/apache/commons/configuration2/EnvironmentConfiguration.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public EnvironmentConfiguration() {
6363
*/
6464
@Override
6565
protected void addPropertyDirect(final String key, final Object value) {
66-
throw new UnsupportedOperationException("EnvironmentConfiguration is read-only!");
66+
throw new UnsupportedOperationException("EnvironmentConfiguration is read-only.");
6767
}
6868

6969
/**
@@ -72,7 +72,7 @@ protected void addPropertyDirect(final String key, final Object value) {
7272
*/
7373
@Override
7474
protected void clearInternal() {
75-
throw new UnsupportedOperationException("EnvironmentConfiguration is read-only!");
75+
throw new UnsupportedOperationException("EnvironmentConfiguration is read-only.");
7676
}
7777

7878
/**
@@ -83,6 +83,6 @@ protected void clearInternal() {
8383
*/
8484
@Override
8585
protected void clearPropertyDirect(final String key) {
86-
throw new UnsupportedOperationException("EnvironmentConfiguration is read-only!");
86+
throw new UnsupportedOperationException("EnvironmentConfiguration is read-only.");
8787
}
8888
}

src/main/java/org/apache/commons/configuration2/ImmutableConfigurationInvocationHandler.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public Object next() {
8282
*/
8383
@Override
8484
public void remove() {
85-
throw new UnsupportedOperationException("remove() operation not supported!");
85+
throw new UnsupportedOperationException("remove() operation not supported.");
8686
}
8787
}
8888

src/main/java/org/apache/commons/configuration2/PropertiesConfigurationLayout.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,7 @@ private String extractComment(final List<String> commentLines, final int from, f
489489
*/
490490
private PropertyLayoutData fetchLayoutData(final String key) {
491491
if (key == null) {
492-
throw new IllegalArgumentException("Property key must not be null!");
492+
throw new IllegalArgumentException("Property key must not be null.");
493493
}
494494

495495
// PropertyLayoutData defaults to singleLine = true

0 commit comments

Comments
 (0)