Skip to content

Commit efaeeeb

Browse files
committed
Remove punctuation in Exception messages.
Closes #442.
1 parent 29d8eaa commit efaeeeb

23 files changed

+107
-107
lines changed

src/main/java/org/springframework/data/keyvalue/core/DefaultIdentifierGenerator.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public <T> T generateIdentifierOfType(TypeInformation<T> identifierType) {
5656
}
5757

5858
throw new InvalidDataAccessApiUsageException(
59-
String.format("Identifier cannot be generated for %s. Supported types are: UUID, String, Integer, and Long.",
59+
String.format("Identifier cannot be generated for %s; Supported types are: UUID, String, Integer, and Long",
6060
identifierType.getType().getName()));
6161
}
6262

@@ -77,7 +77,7 @@ private SecureRandom getSecureRandom() {
7777

7878
if (secureRandom == null) {
7979
throw new InvalidDataAccessApiUsageException(
80-
String.format("Could not create SecureRandom instance for one of the algorithms '%s'.",
80+
String.format("Could not create SecureRandom instance for one of the algorithms '%s'",
8181
StringUtils.collectionToCommaDelimitedString(OsTools.secureRandomAlgorithmNames())));
8282
}
8383

src/main/java/org/springframework/data/keyvalue/core/ForwardingCloseableIterator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public ForwardingCloseableIterator(Iterator<? extends T> delegate) {
5252
*/
5353
public ForwardingCloseableIterator(Iterator<? extends T> delegate, @Nullable Runnable closeHandler) {
5454

55-
Assert.notNull(delegate, "Delegate iterator must not be null!");
55+
Assert.notNull(delegate, "Delegate iterator must not be null");
5656

5757
this.delegate = delegate;
5858
this.closeHandler = closeHandler;

src/main/java/org/springframework/data/keyvalue/core/GeneratingIdAccessor.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@ class GeneratingIdAccessor implements IdentifierAccessor {
4545
GeneratingIdAccessor(PersistentPropertyAccessor<?> accessor, PersistentProperty<?> identifierProperty,
4646
IdentifierGenerator generator) {
4747

48-
Assert.notNull(accessor, "PersistentPropertyAccessor must not be null!");
49-
Assert.notNull(identifierProperty, "Identifier property must not be null!");
50-
Assert.notNull(generator, "IdentifierGenerator must not be null!");
48+
Assert.notNull(accessor, "PersistentPropertyAccessor must not be null");
49+
Assert.notNull(identifierProperty, "Identifier property must not be null");
50+
Assert.notNull(generator, "IdentifierGenerator must not be null");
5151

5252
this.accessor = accessor;
5353
this.identifierProperty = identifierProperty;

src/main/java/org/springframework/data/keyvalue/core/KeyValuePersistenceExceptionTranslator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public class KeyValuePersistenceExceptionTranslator implements PersistenceExcept
3636
@Override
3737
public DataAccessException translateExceptionIfPossible(RuntimeException exception) {
3838

39-
Assert.notNull(exception, "Exception must not be null!");
39+
Assert.notNull(exception, "Exception must not be null");
4040

4141
if (exception instanceof DataAccessException) {
4242
return (DataAccessException) exception;

src/main/java/org/springframework/data/keyvalue/core/KeyValueTemplate.java

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,9 @@ public KeyValueTemplate(KeyValueAdapter adapter,
9696
MappingContext<? extends KeyValuePersistentEntity<?, ?>, ? extends KeyValuePersistentProperty<?>> mappingContext,
9797
IdentifierGenerator identifierGenerator) {
9898

99-
Assert.notNull(adapter, "Adapter must not be null!");
100-
Assert.notNull(mappingContext, "MappingContext must not be null!");
101-
Assert.notNull(identifierGenerator, "IdentifierGenerator must not be null!");
99+
Assert.notNull(adapter, "Adapter must not be null");
100+
Assert.notNull(mappingContext, "MappingContext must not be null");
101+
Assert.notNull(identifierGenerator, "IdentifierGenerator must not be null");
102102

103103
this.adapter = adapter;
104104
this.mappingContext = mappingContext;
@@ -112,7 +112,7 @@ public KeyValueTemplate(KeyValueAdapter adapter,
112112
*/
113113
public void setExceptionTranslator(PersistenceExceptionTranslator exceptionTranslator) {
114114

115-
Assert.notNull(exceptionTranslator, "ExceptionTranslator must not be null!");
115+
Assert.notNull(exceptionTranslator, "ExceptionTranslator must not be null");
116116
this.exceptionTranslator = exceptionTranslator;
117117
}
118118

@@ -152,8 +152,8 @@ public <T> T insert(T objectToInsert) {
152152
@Override
153153
public <T> T insert(Object id, T objectToInsert) {
154154

155-
Assert.notNull(id, "Id for object to be inserted must not be null!");
156-
Assert.notNull(objectToInsert, "Object to be inserted must not be null!");
155+
Assert.notNull(id, "Id for object to be inserted must not be null");
156+
Assert.notNull(objectToInsert, "Object to be inserted must not be null");
157157

158158
String keyspace = resolveKeySpace(objectToInsert.getClass());
159159

@@ -163,7 +163,7 @@ public <T> T insert(Object id, T objectToInsert) {
163163

164164
if (adapter.contains(id, keyspace)) {
165165
throw new DuplicateKeyException(
166-
String.format("Cannot insert existing object with id %s!. Please use update.", id));
166+
String.format("Cannot insert existing object with id %s; Please use update", id));
167167
}
168168

169169
adapter.put(id, objectToInsert, keyspace);
@@ -191,8 +191,8 @@ public <T> T update(T objectToUpdate) {
191191
@Override
192192
public <T> T update(Object id, T objectToUpdate) {
193193

194-
Assert.notNull(id, "Id for object to be inserted must not be null!");
195-
Assert.notNull(objectToUpdate, "Object to be updated must not be null!");
194+
Assert.notNull(id, "Id for object to be inserted must not be null");
195+
Assert.notNull(objectToUpdate, "Object to be updated must not be null");
196196

197197
String keyspace = resolveKeySpace(objectToUpdate.getClass());
198198

@@ -209,7 +209,7 @@ public <T> T update(Object id, T objectToUpdate) {
209209
@Override
210210
public <T> Iterable<T> findAll(Class<T> type) {
211211

212-
Assert.notNull(type, "Type to fetch must not be null!");
212+
Assert.notNull(type, "Type to fetch must not be null");
213213

214214
return executeRequired(adapter -> {
215215

@@ -229,8 +229,8 @@ public <T> Iterable<T> findAll(Class<T> type) {
229229
@Override
230230
public <T> Optional<T> findById(Object id, Class<T> type) {
231231

232-
Assert.notNull(id, "Id for object to be found must not be null!");
233-
Assert.notNull(type, "Type to fetch must not be null!");
232+
Assert.notNull(id, "Id for object to be found must not be null");
233+
Assert.notNull(type, "Type to fetch must not be null");
234234

235235
String keyspace = resolveKeySpace(type);
236236

@@ -255,7 +255,7 @@ public <T> Optional<T> findById(Object id, Class<T> type) {
255255
@Override
256256
public void delete(Class<?> type) {
257257

258-
Assert.notNull(type, "Type to delete must not be null!");
258+
Assert.notNull(type, "Type to delete must not be null");
259259

260260
String keyspace = resolveKeySpace(type);
261261

@@ -283,8 +283,8 @@ public <T> T delete(T objectToDelete) {
283283
@Override
284284
public <T> T delete(Object id, Class<T> type) {
285285

286-
Assert.notNull(id, "Id for object to be deleted must not be null!");
287-
Assert.notNull(type, "Type to delete must not be null!");
286+
Assert.notNull(id, "Id for object to be deleted must not be null");
287+
Assert.notNull(type, "Type to delete must not be null");
288288

289289
String keyspace = resolveKeySpace(type);
290290

@@ -300,15 +300,15 @@ public <T> T delete(Object id, Class<T> type) {
300300
@Override
301301
public long count(Class<?> type) {
302302

303-
Assert.notNull(type, "Type for count must not be null!");
303+
Assert.notNull(type, "Type for count must not be null");
304304
return adapter.count(resolveKeySpace(type));
305305
}
306306

307307
@Nullable
308308
@Override
309309
public <T> T execute(KeyValueCallback<T> action) {
310310

311-
Assert.notNull(action, "KeyValueCallback must not be null!");
311+
Assert.notNull(action, "KeyValueCallback must not be null");
312312

313313
try {
314314
return action.doInKeyValue(this.adapter);
@@ -332,7 +332,7 @@ protected <T> T executeRequired(KeyValueCallback<T> action) {
332332
return result;
333333
}
334334

335-
throw new IllegalStateException(String.format("KeyValueCallback %s returned null value!", action));
335+
throw new IllegalStateException(String.format("KeyValueCallback %s returned null value", action));
336336
}
337337

338338
@Override

src/main/java/org/springframework/data/keyvalue/core/QueryEngine.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ protected ADAPTER getRequiredAdapter() {
144144
return adapter;
145145
}
146146

147-
throw new IllegalStateException("Required KeyValueAdapter is not set!");
147+
throw new IllegalStateException("Required KeyValueAdapter is not set");
148148
}
149149

150150
/**
@@ -156,7 +156,7 @@ public void registerAdapter(KeyValueAdapter adapter) {
156156
if (this.adapter == null) {
157157
this.adapter = (ADAPTER) adapter;
158158
} else {
159-
throw new IllegalArgumentException("Cannot register more than one adapter for this QueryEngine.");
159+
throw new IllegalArgumentException("Cannot register more than one adapter for this QueryEngine");
160160
}
161161
}
162162
}

src/main/java/org/springframework/data/keyvalue/core/SpelCriteria.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ public SpelCriteria(SpelExpression expression) {
4949
*/
5050
public SpelCriteria(SpelExpression expression, EvaluationContext context) {
5151

52-
Assert.notNull(expression, "SpEL expression must not be null!");
53-
Assert.notNull(context, "EvaluationContext must not be null!");
52+
Assert.notNull(expression, "SpEL expression must not be null");
53+
Assert.notNull(context, "EvaluationContext must not be null");
5454

5555
this.expression = expression;
5656
this.context = context;

src/main/java/org/springframework/data/keyvalue/core/SpelCriteriaAccessor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class SpelCriteriaAccessor implements CriteriaAccessor<SpelCriteria> {
3737
*/
3838
public SpelCriteriaAccessor(SpelExpressionParser parser) {
3939

40-
Assert.notNull(parser, "SpelExpressionParser must not be null!");
40+
Assert.notNull(parser, "SpelExpressionParser must not be null");
4141

4242
this.parser = parser;
4343
}

src/main/java/org/springframework/data/keyvalue/core/SpelPropertyComparator.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ public class SpelPropertyComparator<T> implements Comparator<T> {
4747
*/
4848
public SpelPropertyComparator(String path, SpelExpressionParser parser) {
4949

50-
Assert.hasText(path, "Path must not be null or empty!");
51-
Assert.notNull(parser, "SpelExpressionParser must not be null!");
50+
Assert.hasText(path, "Path must not be null or empty");
51+
Assert.notNull(parser, "SpelExpressionParser must not be null");
5252

5353
this.path = path;
5454
this.parser = parser;

src/main/java/org/springframework/data/keyvalue/core/SpelSortAccessor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public class SpelSortAccessor implements SortAccessor<Comparator<?>> {
4343
*/
4444
public SpelSortAccessor(SpelExpressionParser parser) {
4545

46-
Assert.notNull(parser, "SpelExpressionParser must not be null!");
46+
Assert.notNull(parser, "SpelExpressionParser must not be null");
4747
this.parser = parser;
4848
}
4949

0 commit comments

Comments
 (0)