Skip to content

Commit f15fd2a

Browse files
committed
Remove punctuation in Exception messages.
Closes #4079.
1 parent 01656db commit f15fd2a

File tree

258 files changed

+1680
-1680
lines changed

Some content is hidden

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

258 files changed

+1680
-1680
lines changed

spring-data-mongodb-benchmarks/src/main/java/org/springframework/data/mongodb/microbenchmark/AbstractMicrobenchmark.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ private void publishResults(Collection<RunResult> results) {
322322
try {
323323
ResultsWriter.forUri(uri).write(results);
324324
} catch (Exception e) {
325-
System.err.println(String.format("Cannot save benchmark results to '%s'. Error was %s.", uri, e));
325+
System.err.println(String.format("Cannot save benchmark results to '%s'; Error was %s", uri, e));
326326
}
327327
}
328328
}

spring-data-mongodb/src/main/java/org/springframework/data/mongodb/CodecRegistryProvider.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ default boolean hasCodecFor(Class<?> type) {
6262
*/
6363
default <T> Optional<Codec<T>> getCodecFor(Class<T> type) {
6464

65-
Assert.notNull(type, "Type must not be null!");
65+
Assert.notNull(type, "Type must not be null");
6666

6767
try {
6868
return Optional.of(getCodecRegistry().get(type));

spring-data-mongodb/src/main/java/org/springframework/data/mongodb/MongoDatabaseUtils.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ public static MongoDatabase getDatabase(@Nullable String dbName, MongoDatabaseFa
102102
private static MongoDatabase doGetMongoDatabase(@Nullable String dbName, MongoDatabaseFactory factory,
103103
SessionSynchronization sessionSynchronization) {
104104

105-
Assert.notNull(factory, "Factory must not be null!");
105+
Assert.notNull(factory, "Factory must not be null");
106106

107107
if (sessionSynchronization == SessionSynchronization.NEVER
108108
|| !TransactionSynchronizationManager.isSynchronizationActive()) {

spring-data-mongodb/src/main/java/org/springframework/data/mongodb/MongoResourceHolder.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ ClientSession getRequiredSession() {
6868
ClientSession session = getSession();
6969

7070
if (session == null) {
71-
throw new IllegalStateException("No session available!");
71+
throw new IllegalStateException("No session available");
7272
}
7373

7474
return session;

spring-data-mongodb/src/main/java/org/springframework/data/mongodb/MongoTransactionManager.java

+5-5
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ public MongoTransactionManager(MongoDatabaseFactory dbFactory) {
100100
*/
101101
public MongoTransactionManager(MongoDatabaseFactory dbFactory, @Nullable TransactionOptions options) {
102102

103-
Assert.notNull(dbFactory, "DbFactory must not be null!");
103+
Assert.notNull(dbFactory, "DbFactory must not be null");
104104

105105
this.dbFactory = dbFactory;
106106
this.options = options;
@@ -266,7 +266,7 @@ protected void doCleanupAfterCompletion(Object transaction) {
266266
*/
267267
public void setDbFactory(MongoDatabaseFactory dbFactory) {
268268

269-
Assert.notNull(dbFactory, "DbFactory must not be null!");
269+
Assert.notNull(dbFactory, "DbFactory must not be null");
270270
this.dbFactory = dbFactory;
271271
}
272272

@@ -315,7 +315,7 @@ private MongoResourceHolder newResourceHolder(TransactionDefinition definition,
315315
private MongoDatabaseFactory getRequiredDbFactory() {
316316

317317
Assert.state(dbFactory != null,
318-
"MongoTransactionManager operates upon a MongoDbFactory. Did you forget to provide one? It's required.");
318+
"MongoTransactionManager operates upon a MongoDbFactory; Did you forget to provide one; It's required");
319319

320320
return dbFactory;
321321
}
@@ -450,14 +450,14 @@ public ClientSession getSession() {
450450

451451
private MongoResourceHolder getRequiredResourceHolder() {
452452

453-
Assert.state(resourceHolder != null, "MongoResourceHolder is required but not present. o_O");
453+
Assert.state(resourceHolder != null, "MongoResourceHolder is required but not present; o_O");
454454
return resourceHolder;
455455
}
456456

457457
private ClientSession getRequiredSession() {
458458

459459
ClientSession session = getSession();
460-
Assert.state(session != null, "A Session is required but it turned out to be null.");
460+
Assert.state(session != null, "A Session is required but it turned out to be null");
461461
return session;
462462
}
463463

spring-data-mongodb/src/main/java/org/springframework/data/mongodb/ReactiveMongoDatabaseUtils.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ public static Mono<MongoDatabase> getDatabase(String dbName, ReactiveMongoDataba
136136
private static Mono<MongoDatabase> doGetMongoDatabase(@Nullable String dbName, ReactiveMongoDatabaseFactory factory,
137137
SessionSynchronization sessionSynchronization) {
138138

139-
Assert.notNull(factory, "DatabaseFactory must not be null!");
139+
Assert.notNull(factory, "DatabaseFactory must not be null");
140140

141141
if (sessionSynchronization == SessionSynchronization.NEVER) {
142142
return getMongoDatabaseOrDefault(dbName, factory);

spring-data-mongodb/src/main/java/org/springframework/data/mongodb/ReactiveMongoTransactionManager.java

+5-5
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ public ReactiveMongoTransactionManager(ReactiveMongoDatabaseFactory databaseFact
104104
public ReactiveMongoTransactionManager(ReactiveMongoDatabaseFactory databaseFactory,
105105
@Nullable TransactionOptions options) {
106106

107-
Assert.notNull(databaseFactory, "DatabaseFactory must not be null!");
107+
Assert.notNull(databaseFactory, "DatabaseFactory must not be null");
108108

109109
this.databaseFactory = databaseFactory;
110110
this.options = options;
@@ -281,7 +281,7 @@ protected Mono<Void> doCleanupAfterCompletion(TransactionSynchronizationManager
281281
*/
282282
public void setDatabaseFactory(ReactiveMongoDatabaseFactory databaseFactory) {
283283

284-
Assert.notNull(databaseFactory, "DatabaseFactory must not be null!");
284+
Assert.notNull(databaseFactory, "DatabaseFactory must not be null");
285285
this.databaseFactory = databaseFactory;
286286
}
287287

@@ -323,7 +323,7 @@ private Mono<ReactiveMongoResourceHolder> newResourceHolder(TransactionDefinitio
323323
private ReactiveMongoDatabaseFactory getRequiredDatabaseFactory() {
324324

325325
Assert.state(databaseFactory != null,
326-
"ReactiveMongoTransactionManager operates upon a ReactiveMongoDatabaseFactory. Did you forget to provide one? It's required.");
326+
"ReactiveMongoTransactionManager operates upon a ReactiveMongoDatabaseFactory; Did you forget to provide one; It's required");
327327

328328
return databaseFactory;
329329
}
@@ -458,14 +458,14 @@ public ClientSession getSession() {
458458

459459
private ReactiveMongoResourceHolder getRequiredResourceHolder() {
460460

461-
Assert.state(resourceHolder != null, "ReactiveMongoResourceHolder is required but not present. o_O");
461+
Assert.state(resourceHolder != null, "ReactiveMongoResourceHolder is required but not present; o_O");
462462
return resourceHolder;
463463
}
464464

465465
private ClientSession getRequiredSession() {
466466

467467
ClientSession session = getSession();
468-
Assert.state(session != null, "A Session is required but it turned out to be null.");
468+
Assert.state(session != null, "A Session is required but it turned out to be null");
469469
return session;
470470
}
471471

spring-data-mongodb/src/main/java/org/springframework/data/mongodb/SessionAwareMethodInterceptor.java

+7-7
Original file line numberDiff line numberDiff line change
@@ -76,13 +76,13 @@ public <T> SessionAwareMethodInterceptor(ClientSession session, T target, Class<
7676
Class<D> databaseType, ClientSessionOperator<D> databaseDecorator, Class<C> collectionType,
7777
ClientSessionOperator<C> collectionDecorator) {
7878

79-
Assert.notNull(session, "ClientSession must not be null!");
80-
Assert.notNull(target, "Target must not be null!");
81-
Assert.notNull(sessionType, "SessionType must not be null!");
82-
Assert.notNull(databaseType, "Database type must not be null!");
83-
Assert.notNull(databaseDecorator, "Database ClientSessionOperator must not be null!");
84-
Assert.notNull(collectionType, "Collection type must not be null!");
85-
Assert.notNull(collectionDecorator, "Collection ClientSessionOperator must not be null!");
79+
Assert.notNull(session, "ClientSession must not be null");
80+
Assert.notNull(target, "Target must not be null");
81+
Assert.notNull(sessionType, "SessionType must not be null");
82+
Assert.notNull(databaseType, "Database type must not be null");
83+
Assert.notNull(databaseDecorator, "Database ClientSessionOperator must not be null");
84+
Assert.notNull(collectionType, "Collection type must not be null");
85+
Assert.notNull(collectionDecorator, "Collection ClientSessionOperator must not be null");
8686

8787
this.session = session;
8888
this.target = target;

spring-data-mongodb/src/main/java/org/springframework/data/mongodb/config/MappingMongoConverterParser.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ private static void parseFieldNamingStrategy(Element element, ReaderContext cont
255255
&& Boolean.parseBoolean(abbreviateFieldNames);
256256

257257
if (fieldNamingStrategyReferenced && abbreviationActivated) {
258-
context.error("Field name abbreviation cannot be activated if a field-naming-strategy-ref is configured!",
258+
context.error("Field name abbreviation cannot be activated if a field-naming-strategy-ref is configured",
259259
element);
260260
return;
261261
}

spring-data-mongodb/src/main/java/org/springframework/data/mongodb/config/MongoAuditingRegistrar.java

+5-5
Original file line numberDiff line numberDiff line change
@@ -55,16 +55,16 @@ protected String getAuditingHandlerBeanName() {
5555
@Override
5656
public void registerBeanDefinitions(AnnotationMetadata annotationMetadata, BeanDefinitionRegistry registry) {
5757

58-
Assert.notNull(annotationMetadata, "AnnotationMetadata must not be null!");
59-
Assert.notNull(registry, "BeanDefinitionRegistry must not be null!");
58+
Assert.notNull(annotationMetadata, "AnnotationMetadata must not be null");
59+
Assert.notNull(registry, "BeanDefinitionRegistry must not be null");
6060

6161
super.registerBeanDefinitions(annotationMetadata, registry);
6262
}
6363

6464
@Override
6565
protected BeanDefinitionBuilder getAuditHandlerBeanDefinitionBuilder(AuditingConfiguration configuration) {
6666

67-
Assert.notNull(configuration, "AuditingConfiguration must not be null!");
67+
Assert.notNull(configuration, "AuditingConfiguration must not be null");
6868

6969
BeanDefinitionBuilder builder = BeanDefinitionBuilder.rootBeanDefinition(IsNewAwareAuditingHandler.class);
7070

@@ -79,8 +79,8 @@ protected BeanDefinitionBuilder getAuditHandlerBeanDefinitionBuilder(AuditingCon
7979
protected void registerAuditListenerBeanDefinition(BeanDefinition auditingHandlerDefinition,
8080
BeanDefinitionRegistry registry) {
8181

82-
Assert.notNull(auditingHandlerDefinition, "BeanDefinition must not be null!");
83-
Assert.notNull(registry, "BeanDefinitionRegistry must not be null!");
82+
Assert.notNull(auditingHandlerDefinition, "BeanDefinition must not be null");
83+
Assert.notNull(registry, "BeanDefinitionRegistry must not be null");
8484

8585
BeanDefinitionBuilder listenerBeanDefinitionBuilder = BeanDefinitionBuilder
8686
.rootBeanDefinition(AuditingEntityCallback.class);

spring-data-mongodb/src/main/java/org/springframework/data/mongodb/config/MongoCredentialPropertyEditor.java

+6-6
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ public void setAsText(@Nullable String text) throws IllegalArgumentException {
117117
userNameAndPassword[1].toCharArray()));
118118
} else {
119119
throw new IllegalArgumentException(
120-
String.format("Cannot create MongoCredentials for unknown auth mechanism '%s'!", authMechanism));
120+
String.format("Cannot create MongoCredentials for unknown auth mechanism '%s'", authMechanism));
121121
}
122122
}
123123
} else {
@@ -194,7 +194,7 @@ private static Properties extractOptions(String text) {
194194
String[] optionArgs = option.split("=");
195195

196196
if (optionArgs.length == 1) {
197-
throw new IllegalArgumentException(String.format("Query parameter '%s' has no value!", optionArgs[0]));
197+
throw new IllegalArgumentException(String.format("Query parameter '%s' has no value", optionArgs[0]));
198198
}
199199

200200
properties.put(optionArgs[0], optionArgs[1]);
@@ -209,29 +209,29 @@ private static void verifyUsernameAndPasswordPresent(String[] source) {
209209

210210
if (source.length != 2) {
211211
throw new IllegalArgumentException(
212-
"Credentials need to specify username and password like in 'username:password@database'!");
212+
"Credentials need to specify username and password like in 'username:password@database'");
213213
}
214214
}
215215

216216
private static void verifyDatabasePresent(String source) {
217217

218218
if (!StringUtils.hasText(source)) {
219-
throw new IllegalArgumentException("Credentials need to specify database like in 'username:password@database'!");
219+
throw new IllegalArgumentException("Credentials need to specify database like in 'username:password@database'");
220220
}
221221
}
222222

223223
private static void verifyUserNamePresent(String[] source) {
224224

225225
if (source.length == 0 || !StringUtils.hasText(source[0])) {
226-
throw new IllegalArgumentException("Credentials need to specify username!");
226+
throw new IllegalArgumentException("Credentials need to specify username");
227227
}
228228
}
229229

230230
private static String decodeParameter(String it) {
231231
try {
232232
return URLDecoder.decode(it, "UTF-8");
233233
} catch (UnsupportedEncodingException e) {
234-
throw new IllegalArgumentException("o_O UTF-8 not supported!", e);
234+
throw new IllegalArgumentException("o_O UTF-8 not supported", e);
235235
}
236236
}
237237
}

spring-data-mongodb/src/main/java/org/springframework/data/mongodb/config/MongoDbFactoryParser.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ private BeanDefinition getConnectionString(Element element, ParserContext parser
163163

164164
if (element.getAttributes().getLength() > allowedAttributesCount) {
165165

166-
parserContext.getReaderContext().error("Configure either MongoDB " + type + " or details individually!",
166+
parserContext.getReaderContext().error("Configure either MongoDB " + type + " or details individually",
167167
parserContext.extractSource(element));
168168
}
169169

spring-data-mongodb/src/main/java/org/springframework/data/mongodb/config/ReactiveMongoAuditingRegistrar.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ protected String getAuditingHandlerBeanName() {
5151
@Override
5252
protected BeanDefinitionBuilder getAuditHandlerBeanDefinitionBuilder(AuditingConfiguration configuration) {
5353

54-
Assert.notNull(configuration, "AuditingConfiguration must not be null!");
54+
Assert.notNull(configuration, "AuditingConfiguration must not be null");
5555

5656
BeanDefinitionBuilder builder = BeanDefinitionBuilder.rootBeanDefinition(ReactiveIsNewAwareAuditingHandler.class);
5757

@@ -66,8 +66,8 @@ protected BeanDefinitionBuilder getAuditHandlerBeanDefinitionBuilder(AuditingCon
6666
protected void registerAuditListenerBeanDefinition(BeanDefinition auditingHandlerDefinition,
6767
BeanDefinitionRegistry registry) {
6868

69-
Assert.notNull(auditingHandlerDefinition, "BeanDefinition must not be null!");
70-
Assert.notNull(registry, "BeanDefinitionRegistry must not be null!");
69+
Assert.notNull(auditingHandlerDefinition, "BeanDefinition must not be null");
70+
Assert.notNull(registry, "BeanDefinitionRegistry must not be null");
7171

7272
BeanDefinitionBuilder builder = BeanDefinitionBuilder.rootBeanDefinition(ReactiveAuditingEntityCallback.class);
7373

spring-data-mongodb/src/main/java/org/springframework/data/mongodb/config/ServerAddressPropertyEditor.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public class ServerAddressPropertyEditor extends PropertyEditorSupport {
4343
* A port is a number without a leading 0 at the end of the address that is proceeded by just a single :.
4444
*/
4545
private static final String HOST_PORT_SPLIT_PATTERN = "(?<!:):(?=[123456789]\\d*$)";
46-
private static final String COULD_NOT_PARSE_ADDRESS_MESSAGE = "Could not parse address %s '%s'. Check your replica set configuration!";
46+
private static final String COULD_NOT_PARSE_ADDRESS_MESSAGE = "Could not parse address %s '%s'; Check your replica set configuration";
4747
private static final Log LOG = LogFactory.getLog(ServerAddressPropertyEditor.class);
4848

4949
@Override
@@ -68,7 +68,7 @@ public void setAsText(@Nullable String replicaSetString) {
6868

6969
if (serverAddresses.isEmpty()) {
7070
throw new IllegalArgumentException(
71-
"Could not resolve at least one server of the replica set configuration! Validate your config!");
71+
"Could not resolve at least one server of the replica set configuration; Validate your config");
7272
}
7373

7474
setValue(serverAddresses.toArray(new ServerAddress[serverAddresses.size()]));
@@ -125,7 +125,7 @@ private ServerAddress parseServerAddress(String source) {
125125
*/
126126
private String[] extractHostAddressAndPort(String addressAndPortSource) {
127127

128-
Assert.notNull(addressAndPortSource, "Address and port source must not be null!");
128+
Assert.notNull(addressAndPortSource, "Address and port source must not be null");
129129

130130
String[] hostAndPort = addressAndPortSource.split(HOST_PORT_SPLIT_PATTERN);
131131
String hostAddress = hostAndPort[0];

spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/ChangeStreamOptions.java

+7-7
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ private static <T> Object doGetTimestamp(Object timestamp, Class<T> targetType)
148148
}
149149

150150
throw new IllegalArgumentException(
151-
"o_O that should actually not happen. The timestamp should be an Instant or a BsonTimestamp but was "
151+
"o_O that should actually not happen; The timestamp should be an Instant or a BsonTimestamp but was "
152152
+ ObjectUtils.nullSafeClassName(timestamp));
153153
}
154154

@@ -234,7 +234,7 @@ private ChangeStreamOptionsBuilder() {}
234234
*/
235235
public ChangeStreamOptionsBuilder collation(Collation collation) {
236236

237-
Assert.notNull(collation, "Collation must not be null nor empty!");
237+
Assert.notNull(collation, "Collation must not be null nor empty");
238238

239239
this.collation = collation;
240240
return this;
@@ -258,7 +258,7 @@ public ChangeStreamOptionsBuilder collation(Collation collation) {
258258
*/
259259
public ChangeStreamOptionsBuilder filter(Aggregation filter) {
260260

261-
Assert.notNull(filter, "Filter must not be null!");
261+
Assert.notNull(filter, "Filter must not be null");
262262

263263
this.filter = filter;
264264
return this;
@@ -287,7 +287,7 @@ public ChangeStreamOptionsBuilder filter(Document... filter) {
287287
*/
288288
public ChangeStreamOptionsBuilder resumeToken(BsonValue resumeToken) {
289289

290-
Assert.notNull(resumeToken, "ResumeToken must not be null!");
290+
Assert.notNull(resumeToken, "ResumeToken must not be null");
291291

292292
this.resumeToken = resumeToken;
293293

@@ -316,7 +316,7 @@ public ChangeStreamOptionsBuilder returnFullDocumentOnUpdate() {
316316
*/
317317
public ChangeStreamOptionsBuilder fullDocumentLookup(FullDocument lookup) {
318318

319-
Assert.notNull(lookup, "Lookup must not be null!");
319+
Assert.notNull(lookup, "Lookup must not be null");
320320

321321
this.fullDocumentLookup = lookup;
322322
return this;
@@ -330,7 +330,7 @@ public ChangeStreamOptionsBuilder fullDocumentLookup(FullDocument lookup) {
330330
*/
331331
public ChangeStreamOptionsBuilder resumeAt(Instant resumeTimestamp) {
332332

333-
Assert.notNull(resumeTimestamp, "ResumeTimestamp must not be null!");
333+
Assert.notNull(resumeTimestamp, "ResumeTimestamp must not be null");
334334

335335
this.resumeTimestamp = resumeTimestamp;
336336
return this;
@@ -345,7 +345,7 @@ public ChangeStreamOptionsBuilder resumeAt(Instant resumeTimestamp) {
345345
*/
346346
public ChangeStreamOptionsBuilder resumeAt(BsonTimestamp resumeTimestamp) {
347347

348-
Assert.notNull(resumeTimestamp, "ResumeTimestamp must not be null!");
348+
Assert.notNull(resumeTimestamp, "ResumeTimestamp must not be null");
349349

350350
this.resumeTimestamp = resumeTimestamp;
351351
return this;

0 commit comments

Comments
 (0)