Skip to content

Commit 483b30e

Browse files
committed
Remove punctuation in Exception messages.
Closes #1259.
1 parent 6911bfb commit 483b30e

File tree

103 files changed

+338
-338
lines changed

Some content is hidden

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

103 files changed

+338
-338
lines changed

spring-data-jdbc/src/main/java/org/springframework/data/jdbc/core/JdbcAggregateChangeExecutionContext.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@
5353
@SuppressWarnings("rawtypes")
5454
class JdbcAggregateChangeExecutionContext {
5555

56-
private static final String UPDATE_FAILED = "Failed to update entity [%s]. Id [%s] not found in database.";
57-
private static final String UPDATE_FAILED_OPTIMISTIC_LOCKING = "Failed to update entity [%s]. The entity was updated since it was rea or it isn't in the database at all.";
56+
private static final String UPDATE_FAILED = "Failed to update entity [%s]; Id [%s] not found in database";
57+
private static final String UPDATE_FAILED_OPTIMISTIC_LOCKING = "Failed to update entity [%s]; The entity was updated since it was rea or it isn't in the database at all";
5858

5959
private final MappingContext<? extends RelationalPersistentEntity<?>, ? extends RelationalPersistentProperty> context;
6060
private final JdbcConverter converter;
@@ -268,7 +268,7 @@ <T> List<T> populateIdsIfNecessary() {
268268

269269
if (roots.isEmpty()) {
270270
throw new IllegalStateException(
271-
String.format("Cannot retrieve the resulting instance(s) unless a %s or %s action was successfully executed.",
271+
String.format("Cannot retrieve the resulting instance(s) unless a %s or %s action was successfully executed",
272272
DbAction.InsertRoot.class.getName(), DbAction.UpdateRoot.class.getName()));
273273
}
274274

@@ -312,7 +312,7 @@ private PersistentPropertyPath<?> getRelativePath(DbAction<?> action, Persistent
312312
return pathToValue;
313313
}
314314

315-
throw new IllegalArgumentException(String.format("DbAction of type %s is not supported.", action.getClass()));
315+
throw new IllegalArgumentException(String.format("DbAction of type %s is not supported", action.getClass()));
316316
}
317317

318318
private <T> RelationalPersistentEntity<T> getRequiredPersistentEntity(Class<T> type) {
@@ -331,7 +331,7 @@ private <T> void updateWithoutVersion(DbAction.UpdateRoot<T> update) {
331331
private <T> void updateWithVersion(DbAction.UpdateRoot<T> update) {
332332

333333
Number previousVersion = update.getPreviousVersion();
334-
Assert.notNull(previousVersion, "The root aggregate cannot be updated because the version property is null.");
334+
Assert.notNull(previousVersion, "The root aggregate cannot be updated because the version property is null");
335335

336336
if (!accessStrategy.updateWithVersion(update.getEntity(), update.getEntityType(), previousVersion)) {
337337

@@ -460,8 +460,8 @@ public List createEmptyInstance() {
460460
@Override
461461
public List add(@Nullable List list, @Nullable Object qualifier, Object value) {
462462

463-
Assert.notNull(list, "List must not be null.");
464-
Assert.notNull(qualifier, "ListAggregator can't handle a null qualifier.");
463+
Assert.notNull(list, "List must not be null");
464+
Assert.notNull(qualifier, "ListAggregator can't handle a null qualifier");
465465

466466
int index = (int) qualifier;
467467
if (index >= list.size()) {
@@ -492,7 +492,7 @@ public Map createEmptyInstance() {
492492
@Override
493493
public Map add(@Nullable Map map, @Nullable Object qualifier, Object value) {
494494

495-
Assert.notNull(map, "Map must not be null.");
495+
Assert.notNull(map, "Map must not be null");
496496

497497
map.put(qualifier, value);
498498
return map;

spring-data-jdbc/src/main/java/org/springframework/data/jdbc/core/JdbcAggregateTemplate.java

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,10 @@ public class JdbcAggregateTemplate implements JdbcAggregateOperations {
8787
public JdbcAggregateTemplate(ApplicationContext publisher, RelationalMappingContext context, JdbcConverter converter,
8888
DataAccessStrategy dataAccessStrategy) {
8989

90-
Assert.notNull(publisher, "ApplicationContext must not be null!");
91-
Assert.notNull(context, "RelationalMappingContext must not be null!");
92-
Assert.notNull(converter, "RelationalConverter must not be null!");
93-
Assert.notNull(dataAccessStrategy, "DataAccessStrategy must not be null!");
90+
Assert.notNull(publisher, "ApplicationContext must not be null");
91+
Assert.notNull(context, "RelationalMappingContext must not be null");
92+
Assert.notNull(converter, "RelationalConverter must not be null");
93+
Assert.notNull(dataAccessStrategy, "DataAccessStrategy must not be null");
9494

9595
this.publisher = publisher;
9696
this.context = context;
@@ -115,10 +115,10 @@ public JdbcAggregateTemplate(ApplicationContext publisher, RelationalMappingCont
115115
public JdbcAggregateTemplate(ApplicationEventPublisher publisher, RelationalMappingContext context,
116116
JdbcConverter converter, DataAccessStrategy dataAccessStrategy) {
117117

118-
Assert.notNull(publisher, "ApplicationEventPublisher must not be null!");
119-
Assert.notNull(context, "RelationalMappingContext must not be null!");
120-
Assert.notNull(converter, "RelationalConverter must not be null!");
121-
Assert.notNull(dataAccessStrategy, "DataAccessStrategy must not be null!");
118+
Assert.notNull(publisher, "ApplicationEventPublisher must not be null");
119+
Assert.notNull(context, "RelationalMappingContext must not be null");
120+
Assert.notNull(converter, "RelationalConverter must not be null");
121+
Assert.notNull(dataAccessStrategy, "DataAccessStrategy must not be null");
122122

123123
this.publisher = publisher;
124124
this.context = context;
@@ -137,23 +137,23 @@ public JdbcAggregateTemplate(ApplicationEventPublisher publisher, RelationalMapp
137137
*/
138138
public void setEntityCallbacks(EntityCallbacks entityCallbacks) {
139139

140-
Assert.notNull(entityCallbacks, "Callbacks must not be null.");
140+
Assert.notNull(entityCallbacks, "Callbacks must not be null");
141141

142142
this.entityCallbacks = entityCallbacks;
143143
}
144144

145145
@Override
146146
public <T> T save(T instance) {
147147

148-
Assert.notNull(instance, "Aggregate instance must not be null!");
148+
Assert.notNull(instance, "Aggregate instance must not be null");
149149

150150
return performSave(instance, changeCreatorSelectorForSave(instance));
151151
}
152152

153153
@Override
154154
public <T> Iterable<T> saveAll(Iterable<T> instances) {
155155

156-
Assert.isTrue(instances.iterator().hasNext(), "Aggregate instances must not be empty!");
156+
Assert.isTrue(instances.iterator().hasNext(), "Aggregate instances must not be empty");
157157

158158
return performSaveAll(instances);
159159
}
@@ -168,7 +168,7 @@ public <T> Iterable<T> saveAll(Iterable<T> instances) {
168168
@Override
169169
public <T> T insert(T instance) {
170170

171-
Assert.notNull(instance, "Aggregate instance must not be null!");
171+
Assert.notNull(instance, "Aggregate instance must not be null");
172172

173173
return performSave(instance, entity -> createInsertChange(prepareVersionForInsert(entity)));
174174
}
@@ -183,7 +183,7 @@ public <T> T insert(T instance) {
183183
@Override
184184
public <T> T update(T instance) {
185185

186-
Assert.notNull(instance, "Aggregate instance must not be null!");
186+
Assert.notNull(instance, "Aggregate instance must not be null");
187187

188188
return performSave(instance, entity -> createUpdateChange(prepareVersionForUpdate(entity)));
189189
}
@@ -199,8 +199,8 @@ public long count(Class<?> domainType) {
199199
@Override
200200
public <T> T findById(Object id, Class<T> domainType) {
201201

202-
Assert.notNull(id, "Id must not be null!");
203-
Assert.notNull(domainType, "Domain type must not be null!");
202+
Assert.notNull(id, "Id must not be null");
203+
Assert.notNull(domainType, "Domain type must not be null");
204204

205205
T entity = accessStrategy.findById(id, domainType);
206206
if (entity == null) {
@@ -212,16 +212,16 @@ public <T> T findById(Object id, Class<T> domainType) {
212212
@Override
213213
public <T> boolean existsById(Object id, Class<T> domainType) {
214214

215-
Assert.notNull(id, "Id must not be null!");
216-
Assert.notNull(domainType, "Domain type must not be null!");
215+
Assert.notNull(id, "Id must not be null");
216+
Assert.notNull(domainType, "Domain type must not be null");
217217

218218
return accessStrategy.existsById(id, domainType);
219219
}
220220

221221
@Override
222222
public <T> Iterable<T> findAll(Class<T> domainType, Sort sort) {
223223

224-
Assert.notNull(domainType, "Domain type must not be null!");
224+
Assert.notNull(domainType, "Domain type must not be null");
225225

226226
Iterable<T> all = accessStrategy.findAll(domainType, sort);
227227
return triggerAfterConvert(all);
@@ -230,7 +230,7 @@ public <T> Iterable<T> findAll(Class<T> domainType, Sort sort) {
230230
@Override
231231
public <T> Page<T> findAll(Class<T> domainType, Pageable pageable) {
232232

233-
Assert.notNull(domainType, "Domain type must not be null!");
233+
Assert.notNull(domainType, "Domain type must not be null");
234234

235235
Iterable<T> items = triggerAfterConvert(accessStrategy.findAll(domainType, pageable));
236236
List<T> content = StreamSupport.stream(items.spliterator(), false).collect(Collectors.toList());
@@ -241,7 +241,7 @@ public <T> Page<T> findAll(Class<T> domainType, Pageable pageable) {
241241
@Override
242242
public <T> Iterable<T> findAll(Class<T> domainType) {
243243

244-
Assert.notNull(domainType, "Domain type must not be null!");
244+
Assert.notNull(domainType, "Domain type must not be null");
245245

246246
Iterable<T> all = accessStrategy.findAll(domainType);
247247
return triggerAfterConvert(all);
@@ -250,8 +250,8 @@ public <T> Iterable<T> findAll(Class<T> domainType) {
250250
@Override
251251
public <T> Iterable<T> findAllById(Iterable<?> ids, Class<T> domainType) {
252252

253-
Assert.notNull(ids, "Ids must not be null!");
254-
Assert.notNull(domainType, "Domain type must not be null!");
253+
Assert.notNull(ids, "Ids must not be null");
254+
Assert.notNull(domainType, "Domain type must not be null");
255255

256256
Iterable<T> allById = accessStrategy.findAllById(ids, domainType);
257257
return triggerAfterConvert(allById);
@@ -260,8 +260,8 @@ public <T> Iterable<T> findAllById(Iterable<?> ids, Class<T> domainType) {
260260
@Override
261261
public <S> void delete(S aggregateRoot, Class<S> domainType) {
262262

263-
Assert.notNull(aggregateRoot, "Aggregate root must not be null!");
264-
Assert.notNull(domainType, "Domain type must not be null!");
263+
Assert.notNull(aggregateRoot, "Aggregate root must not be null");
264+
Assert.notNull(domainType, "Domain type must not be null");
265265

266266
IdentifierAccessor identifierAccessor = context.getRequiredPersistentEntity(domainType)
267267
.getIdentifierAccessor(aggregateRoot);
@@ -272,16 +272,16 @@ public <S> void delete(S aggregateRoot, Class<S> domainType) {
272272
@Override
273273
public <S> void deleteById(Object id, Class<S> domainType) {
274274

275-
Assert.notNull(id, "Id must not be null!");
276-
Assert.notNull(domainType, "Domain type must not be null!");
275+
Assert.notNull(id, "Id must not be null");
276+
Assert.notNull(domainType, "Domain type must not be null");
277277

278278
deleteTree(id, null, domainType);
279279
}
280280

281281
@Override
282282
public <T> void deleteAllById(Iterable<?> ids, Class<T> domainType) {
283283

284-
Assert.isTrue(ids.iterator().hasNext(), "Ids must not be empty!");
284+
Assert.isTrue(ids.iterator().hasNext(), "Ids must not be empty");
285285

286286
BatchingAggregateChange<T, DeleteAggregateChange<T>> batchingAggregateChange = BatchingAggregateChange
287287
.forDelete(domainType);
@@ -301,7 +301,7 @@ public <T> void deleteAllById(Iterable<?> ids, Class<T> domainType) {
301301
@Override
302302
public void deleteAll(Class<?> domainType) {
303303

304-
Assert.notNull(domainType, "Domain type must not be null!");
304+
Assert.notNull(domainType, "Domain type must not be null");
305305

306306
MutableAggregateChange<?> change = createDeletingChange(domainType);
307307
executor.executeDelete(change);
@@ -310,7 +310,7 @@ public void deleteAll(Class<?> domainType) {
310310
@Override
311311
public <T> void deleteAll(Iterable<? extends T> instances, Class<T> domainType) {
312312

313-
Assert.isTrue(instances.iterator().hasNext(), "Aggregate instances must not be empty!");
313+
Assert.isTrue(instances.iterator().hasNext(), "Aggregate instances must not be empty");
314314

315315
BatchingAggregateChange<T, DeleteAggregateChange<T>> batchingAggregateChange = BatchingAggregateChange
316316
.forDelete(domainType);
@@ -335,14 +335,14 @@ private <T> T afterExecute(AggregateChange<T> change, T entityAfterExecution) {
335335
Object identifier = context.getRequiredPersistentEntity(change.getEntityType())
336336
.getIdentifierAccessor(entityAfterExecution).getIdentifier();
337337

338-
Assert.notNull(identifier, "After saving the identifier must not be null!");
338+
Assert.notNull(identifier, "After saving the identifier must not be null");
339339

340340
return triggerAfterSave(entityAfterExecution, change);
341341
}
342342

343343
private <T> RootAggregateChange<T> beforeExecute(T aggregateRoot, Function<T, RootAggregateChange<T>> changeCreator) {
344344

345-
Assert.notNull(aggregateRoot, "Aggregate instance must not be null!");
345+
Assert.notNull(aggregateRoot, "Aggregate instance must not be null");
346346

347347
aggregateRoot = triggerBeforeConvert(aggregateRoot);
348348

@@ -375,7 +375,7 @@ private <T> T performSave(T instance, Function<T, RootAggregateChange<T>> change
375375

376376
Iterator<T> afterExecutionIterator = executor.executeSave(batchingAggregateChange).iterator();
377377

378-
Assert.isTrue(afterExecutionIterator.hasNext(), "Instances after execution must not be empty!");
378+
Assert.isTrue(afterExecutionIterator.hasNext(), "Instances after execution must not be empty");
379379

380380
return afterExecute(batchingAggregateChange, afterExecutionIterator.next());
381381
}

spring-data-jdbc/src/main/java/org/springframework/data/jdbc/core/convert/BasicJdbcConverter.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ public Object readValue(@Nullable Object value, TypeInformation<?> type) {
217217
try {
218218
return super.readValue(((Array) value).getArray(), type);
219219
} catch (SQLException | ConverterNotFoundException e) {
220-
LOG.info("Failed to extract a value of type %s from an Array. Attempting to use standard conversions.", e);
220+
LOG.info("Failed to extract a value of type %s from an Array; Attempting to use standard conversions", e);
221221
}
222222
}
223223

@@ -380,7 +380,7 @@ private ReadingContext(PersistentPropertyPathExtension rootPath, ResultSetAccess
380380
Object key) {
381381
RelationalPersistentEntity<T> entity = (RelationalPersistentEntity<T>) rootPath.getLeafEntity();
382382

383-
Assert.notNull(entity, "The rootPath must point to an entity.");
383+
Assert.notNull(entity, "The rootPath must point to an entity");
384384

385385
this.entity = entity;
386386
this.rootPath = rootPath;

spring-data-jdbc/src/main/java/org/springframework/data/jdbc/core/convert/DefaultDataAccessStrategy.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ public <S> boolean updateWithVersion(S instance, Class<S> domainType, Number pre
148148
if (affectedRows == 0) {
149149

150150
throw new OptimisticLockingFailureException(
151-
String.format("Optimistic lock exception on saving entity of type %s.", persistentEntity.getName()));
151+
String.format("Optimistic lock exception on saving entity of type %s", persistentEntity.getName()));
152152
}
153153

154154
return true;
@@ -166,7 +166,7 @@ public void delete(Object id, Class<?> domainType) {
166166
@Override
167167
public <T> void deleteWithVersion(Object id, Class<T> domainType, Number previousVersion) {
168168

169-
Assert.notNull(id, "Id must not be null.");
169+
Assert.notNull(id, "Id must not be null");
170170

171171
RelationalPersistentEntity<T> persistentEntity = getRequiredPersistentEntity(domainType);
172172

@@ -176,7 +176,7 @@ public <T> void deleteWithVersion(Object id, Class<T> domainType, Number previou
176176

177177
if (affectedRows == 0) {
178178
throw new OptimisticLockingFailureException(
179-
String.format("Optimistic lock exception deleting entity of type %s.", persistentEntity.getName()));
179+
String.format("Optimistic lock exception deleting entity of type %s", persistentEntity.getName()));
180180
}
181181
}
182182

@@ -242,7 +242,7 @@ public long count(Class<?> domainType) {
242242

243243
Long result = operations.getJdbcOperations().queryForObject(sql(domainType).getCount(), Long.class);
244244

245-
Assert.notNull(result, "The result of a count query must not be null.");
245+
Assert.notNull(result, "The result of a count query must not be null");
246246

247247
return result;
248248
}
@@ -287,8 +287,8 @@ public <T> Iterable<T> findAllById(Iterable<?> ids, Class<T> domainType) {
287287
public Iterable<Object> findAllByPath(Identifier identifier,
288288
PersistentPropertyPath<? extends RelationalPersistentProperty> propertyPath) {
289289

290-
Assert.notNull(identifier, "identifier must not be null.");
291-
Assert.notNull(propertyPath, "propertyPath must not be null.");
290+
Assert.notNull(identifier, "identifier must not be null");
291+
Assert.notNull(propertyPath, "propertyPath must not be null");
292292

293293
PersistentPropertyPathExtension path = new PersistentPropertyPathExtension(context, propertyPath);
294294

spring-data-jdbc/src/main/java/org/springframework/data/jdbc/core/convert/DefaultJdbcTypeFactory.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public DefaultJdbcTypeFactory(JdbcOperations operations, JdbcArrayColumns arrayC
6363
@Override
6464
public Array createArray(Object[] value) {
6565

66-
Assert.notNull(value, "Value must not be null.");
66+
Assert.notNull(value, "Value must not be null");
6767

6868
Class<?> componentType = arrayColumns.getArrayType(value.getClass());
6969

spring-data-jdbc/src/main/java/org/springframework/data/jdbc/core/convert/IdGeneratingBatchInsertStrategy.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ public Object[] execute(String sql, SqlParameterSource[] sqlParameterSources) {
8484
} else {
8585
ids[i] = keys.entrySet().stream().findFirst() //
8686
.map(Map.Entry::getValue) //
87-
.orElseThrow(() -> new IllegalStateException("KeyHolder contains an empty key list."));
87+
.orElseThrow(() -> new IllegalStateException("KeyHolder contains an empty key list"));
8888
}
8989
}
9090
return ids;

spring-data-jdbc/src/main/java/org/springframework/data/jdbc/core/convert/Identifier.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ public static Identifier empty() {
6666
*/
6767
public static Identifier of(SqlIdentifier name, Object value, Class<?> targetType) {
6868

69-
Assert.notNull(name, "Name must not be empty!");
70-
Assert.notNull(targetType, "Target type must not be null!");
69+
Assert.notNull(name, "Name must not be empty");
70+
Assert.notNull(targetType, "Target type must not be null");
7171

7272
return new Identifier(Collections.singletonList(new SingleIdentifierValue(name, value, targetType)));
7373
}
@@ -80,7 +80,7 @@ public static Identifier of(SqlIdentifier name, Object value, Class<?> targetTyp
8080
*/
8181
public static Identifier from(Map<SqlIdentifier, Object> map) {
8282

83-
Assert.notNull(map, "Map must not be null!");
83+
Assert.notNull(map, "Map must not be null");
8484

8585
if (map.isEmpty()) {
8686
return empty();
@@ -108,8 +108,8 @@ public static Identifier from(Map<SqlIdentifier, Object> map) {
108108
*/
109109
public Identifier withPart(SqlIdentifier name, Object value, Class<?> targetType) {
110110

111-
Assert.notNull(name, "Name must not be null!");
112-
Assert.notNull(targetType, "Target type must not be null!");
111+
Assert.notNull(name, "Name must not be null");
112+
Assert.notNull(targetType, "Target type must not be null");
113113

114114
boolean overwritten = false;
115115
List<SingleIdentifierValue> keys = new ArrayList<>(this.parts.size() + 1);
@@ -187,8 +187,8 @@ static final class SingleIdentifierValue {
187187

188188
private SingleIdentifierValue(SqlIdentifier name, @Nullable Object value, Class<?> targetType) {
189189

190-
Assert.notNull(name, "Name must not be null.");
191-
Assert.notNull(targetType, "TargetType must not be null.");
190+
Assert.notNull(name, "Name must not be null");
191+
Assert.notNull(targetType, "TargetType must not be null");
192192

193193
this.name = name;
194194
this.value = value;

0 commit comments

Comments
 (0)