Skip to content

Commit c0821be

Browse files
committed
Remove punctuation from Exception messages.
Closes #2340.
1 parent 73fff10 commit c0821be

File tree

243 files changed

+3139
-3139
lines changed

Some content is hidden

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

243 files changed

+3139
-3139
lines changed

src/main/java/org/springframework/data/redis/cache/BatchStrategies.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public static BatchStrategy keys() {
6363
*/
6464
public static BatchStrategy scan(int batchSize) {
6565

66-
Assert.isTrue(batchSize > 0, "Batch size must be greater than zero!");
66+
Assert.isTrue(batchSize > 0, "Batch size must be greater than zero");
6767

6868
return new Scan(batchSize);
6969
}

src/main/java/org/springframework/data/redis/cache/CacheKeyPrefix.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ static CacheKeyPrefix simple() {
6464
*/
6565
static CacheKeyPrefix prefixed(String prefix) {
6666

67-
Assert.notNull(prefix, "Prefix must not be null!");
67+
Assert.notNull(prefix, "Prefix must not be null");
6868
return name -> prefix + name + SEPARATOR;
6969
}
7070
}

src/main/java/org/springframework/data/redis/cache/DefaultRedisCacheWriter.java

+16-16
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,10 @@ class DefaultRedisCacheWriter implements RedisCacheWriter {
8181
DefaultRedisCacheWriter(RedisConnectionFactory connectionFactory, Duration sleepTime,
8282
CacheStatisticsCollector cacheStatisticsCollector, BatchStrategy batchStrategy) {
8383

84-
Assert.notNull(connectionFactory, "ConnectionFactory must not be null!");
85-
Assert.notNull(sleepTime, "SleepTime must not be null!");
86-
Assert.notNull(cacheStatisticsCollector, "CacheStatisticsCollector must not be null!");
87-
Assert.notNull(batchStrategy, "BatchStrategy must not be null!");
84+
Assert.notNull(connectionFactory, "ConnectionFactory must not be null");
85+
Assert.notNull(sleepTime, "SleepTime must not be null");
86+
Assert.notNull(cacheStatisticsCollector, "CacheStatisticsCollector must not be null");
87+
Assert.notNull(batchStrategy, "BatchStrategy must not be null");
8888

8989
this.connectionFactory = connectionFactory;
9090
this.sleepTime = sleepTime;
@@ -95,9 +95,9 @@ class DefaultRedisCacheWriter implements RedisCacheWriter {
9595
@Override
9696
public void put(String name, byte[] key, byte[] value, @Nullable Duration ttl) {
9797

98-
Assert.notNull(name, "Name must not be null!");
99-
Assert.notNull(key, "Key must not be null!");
100-
Assert.notNull(value, "Value must not be null!");
98+
Assert.notNull(name, "Name must not be null");
99+
Assert.notNull(key, "Key must not be null");
100+
Assert.notNull(value, "Value must not be null");
101101

102102
execute(name, connection -> {
103103

@@ -116,8 +116,8 @@ public void put(String name, byte[] key, byte[] value, @Nullable Duration ttl) {
116116
@Override
117117
public byte[] get(String name, byte[] key) {
118118

119-
Assert.notNull(name, "Name must not be null!");
120-
Assert.notNull(key, "Key must not be null!");
119+
Assert.notNull(name, "Name must not be null");
120+
Assert.notNull(key, "Key must not be null");
121121

122122
byte[] result = execute(name, connection -> connection.get(key));
123123

@@ -135,9 +135,9 @@ public byte[] get(String name, byte[] key) {
135135
@Override
136136
public byte[] putIfAbsent(String name, byte[] key, byte[] value, @Nullable Duration ttl) {
137137

138-
Assert.notNull(name, "Name must not be null!");
139-
Assert.notNull(key, "Key must not be null!");
140-
Assert.notNull(value, "Value must not be null!");
138+
Assert.notNull(name, "Name must not be null");
139+
Assert.notNull(key, "Key must not be null");
140+
Assert.notNull(value, "Value must not be null");
141141

142142
return execute(name, connection -> {
143143

@@ -173,8 +173,8 @@ public byte[] putIfAbsent(String name, byte[] key, byte[] value, @Nullable Durat
173173
@Override
174174
public void remove(String name, byte[] key) {
175175

176-
Assert.notNull(name, "Name must not be null!");
177-
Assert.notNull(key, "Key must not be null!");
176+
Assert.notNull(name, "Name must not be null");
177+
Assert.notNull(key, "Key must not be null");
178178

179179
execute(name, connection -> connection.del(key));
180180
statistics.incDeletes(name);
@@ -183,8 +183,8 @@ public void remove(String name, byte[] key) {
183183
@Override
184184
public void clean(String name, byte[] pattern) {
185185

186-
Assert.notNull(name, "Name must not be null!");
187-
Assert.notNull(pattern, "Pattern must not be null!");
186+
Assert.notNull(name, "Name must not be null");
187+
Assert.notNull(pattern, "Pattern must not be null");
188188

189189
execute(name, connection -> {
190190

src/main/java/org/springframework/data/redis/cache/RedisCache.java

+6-6
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,9 @@ protected RedisCache(String name, RedisCacheWriter cacheWriter, RedisCacheConfig
6969

7070
super(cacheConfig.getAllowCacheNullValues());
7171

72-
Assert.notNull(name, "Name must not be null!");
73-
Assert.notNull(cacheWriter, "CacheWriter must not be null!");
74-
Assert.notNull(cacheConfig, "CacheConfig must not be null!");
72+
Assert.notNull(name, "Name must not be null");
73+
Assert.notNull(cacheWriter, "CacheWriter must not be null");
74+
Assert.notNull(cacheConfig, "CacheConfig must not be null");
7575

7676
this.name = name;
7777
this.cacheWriter = cacheWriter;
@@ -141,7 +141,7 @@ public void put(Object key, @Nullable Object value) {
141141
if (!isAllowNullValues() && cacheValue == null) {
142142

143143
throw new IllegalArgumentException(String.format(
144-
"Cache '%s' does not allow 'null' values. Avoid storing null via '@Cacheable(unless=\"#result == null\")' or configure RedisCache to allow 'null' via RedisCacheConfiguration.",
144+
"Cache '%s' does not allow 'null' values; Avoid storing null via '@Cacheable(unless=\"#result == null\")' or configure RedisCache to allow 'null' via RedisCacheConfiguration",
145145
name));
146146
}
147147

@@ -319,7 +319,7 @@ protected String convertKey(Object key) {
319319
}
320320

321321
throw new IllegalStateException(String.format(
322-
"Cannot convert cache key %s to String. Please register a suitable Converter via 'RedisCacheConfiguration.configureKeyConverters(...)' or override '%s.toString()'.",
322+
"Cannot convert cache key %s to String; Please register a suitable Converter via 'RedisCacheConfiguration.configureKeyConverters(...)' or override '%s.toString()'",
323323
source, key.getClass().getSimpleName()));
324324
}
325325

@@ -348,7 +348,7 @@ private String convertCollectionLikeOrMapKey(Object key, TypeDescriptor source)
348348
return "[" + sj.toString() + "]";
349349
}
350350

351-
throw new IllegalArgumentException(String.format("Cannot convert cache key %s to String.", key));
351+
throw new IllegalArgumentException(String.format("Cannot convert cache key %s to String", key));
352352
}
353353

354354
private boolean isCollectionLikeOrMap(TypeDescriptor source) {

src/main/java/org/springframework/data/redis/cache/RedisCacheConfiguration.java

+9-9
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ public static RedisCacheConfiguration defaultCacheConfig(@Nullable ClassLoader c
136136
*/
137137
public RedisCacheConfiguration entryTtl(Duration ttl) {
138138

139-
Assert.notNull(ttl, "TTL duration must not be null!");
139+
Assert.notNull(ttl, "TTL duration must not be null");
140140

141141
return new RedisCacheConfiguration(ttl, cacheNullValues, usePrefix, keyPrefix, keySerializationPair,
142142
valueSerializationPair, conversionService);
@@ -167,7 +167,7 @@ public RedisCacheConfiguration prefixCacheNameWith(String prefix) {
167167
*/
168168
public RedisCacheConfiguration computePrefixWith(CacheKeyPrefix cacheKeyPrefix) {
169169

170-
Assert.notNull(cacheKeyPrefix, "Function for computing prefix must not be null!");
170+
Assert.notNull(cacheKeyPrefix, "Function for computing prefix must not be null");
171171

172172
return new RedisCacheConfiguration(ttl, cacheNullValues, true, cacheKeyPrefix, keySerializationPair,
173173
valueSerializationPair, conversionService);
@@ -207,7 +207,7 @@ public RedisCacheConfiguration disableKeyPrefix() {
207207
*/
208208
public RedisCacheConfiguration withConversionService(ConversionService conversionService) {
209209

210-
Assert.notNull(conversionService, "ConversionService must not be null!");
210+
Assert.notNull(conversionService, "ConversionService must not be null");
211211

212212
return new RedisCacheConfiguration(ttl, cacheNullValues, usePrefix, keyPrefix, keySerializationPair,
213213
valueSerializationPair, conversionService);
@@ -221,7 +221,7 @@ public RedisCacheConfiguration withConversionService(ConversionService conversio
221221
*/
222222
public RedisCacheConfiguration serializeKeysWith(SerializationPair<String> keySerializationPair) {
223223

224-
Assert.notNull(keySerializationPair, "KeySerializationPair must not be null!");
224+
Assert.notNull(keySerializationPair, "KeySerializationPair must not be null");
225225

226226
return new RedisCacheConfiguration(ttl, cacheNullValues, usePrefix, keyPrefix, keySerializationPair,
227227
valueSerializationPair, conversionService);
@@ -235,7 +235,7 @@ public RedisCacheConfiguration serializeKeysWith(SerializationPair<String> keySe
235235
*/
236236
public RedisCacheConfiguration serializeValuesWith(SerializationPair<?> valueSerializationPair) {
237237

238-
Assert.notNull(valueSerializationPair, "ValueSerializationPair must not be null!");
238+
Assert.notNull(valueSerializationPair, "ValueSerializationPair must not be null");
239239

240240
return new RedisCacheConfiguration(ttl, cacheNullValues, usePrefix, keyPrefix, keySerializationPair,
241241
valueSerializationPair, conversionService);
@@ -249,7 +249,7 @@ public RedisCacheConfiguration serializeValuesWith(SerializationPair<?> valueSer
249249
*/
250250
public String getKeyPrefixFor(String cacheName) {
251251

252-
Assert.notNull(cacheName, "Cache name must not be null!");
252+
Assert.notNull(cacheName, "Cache name must not be null");
253253

254254
return keyPrefix.compute(cacheName);
255255
}
@@ -320,8 +320,8 @@ public void configureKeyConverters(Consumer<ConverterRegistry> registryConsumer)
320320

321321
if (!(getConversionService() instanceof ConverterRegistry)) {
322322
throw new IllegalStateException(String.format(
323-
"'%s' returned by getConversionService() does not allow converter registration." //
324-
+ " Please make sure to provide a ConversionService that implements ConverterRegistry.",
323+
"'%s' returned by getConversionService() does not allow converter registration;" //
324+
+ " Please make sure to provide a ConversionService that implements ConverterRegistry",
325325
getConversionService().getClass().getSimpleName()));
326326
}
327327

@@ -339,7 +339,7 @@ public void configureKeyConverters(Consumer<ConverterRegistry> registryConsumer)
339339
*/
340340
public static void registerDefaultConverters(ConverterRegistry registry) {
341341

342-
Assert.notNull(registry, "ConverterRegistry must not be null!");
342+
Assert.notNull(registry, "ConverterRegistry must not be null");
343343

344344
registry.addConverter(String.class, byte[].class, source -> source.getBytes(StandardCharsets.UTF_8));
345345
registry.addConverter(SimpleKey.class, String.class, SimpleKey::toString);

src/main/java/org/springframework/data/redis/cache/RedisCacheManager.java

+16-16
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ public class RedisCacheManager extends AbstractTransactionSupportingCacheManager
6565
private RedisCacheManager(RedisCacheWriter cacheWriter, RedisCacheConfiguration defaultCacheConfiguration,
6666
boolean allowInFlightCacheCreation) {
6767

68-
Assert.notNull(cacheWriter, "CacheWriter must not be null!");
69-
Assert.notNull(defaultCacheConfiguration, "DefaultCacheConfiguration must not be null!");
68+
Assert.notNull(cacheWriter, "CacheWriter must not be null");
69+
Assert.notNull(defaultCacheConfiguration, "DefaultCacheConfiguration must not be null");
7070

7171
this.cacheWriter = cacheWriter;
7272
this.defaultCacheConfig = defaultCacheConfiguration;
@@ -159,7 +159,7 @@ public RedisCacheManager(RedisCacheWriter cacheWriter, RedisCacheConfiguration d
159159

160160
this(cacheWriter, defaultCacheConfiguration, allowInFlightCacheCreation);
161161

162-
Assert.notNull(initialCacheConfigurations, "InitialCacheConfigurations must not be null!");
162+
Assert.notNull(initialCacheConfigurations, "InitialCacheConfigurations must not be null");
163163

164164
this.initialCacheConfiguration.putAll(initialCacheConfigurations);
165165
}
@@ -186,7 +186,7 @@ public RedisCacheManager(RedisCacheWriter cacheWriter, RedisCacheConfiguration d
186186
*/
187187
public static RedisCacheManager create(RedisConnectionFactory connectionFactory) {
188188

189-
Assert.notNull(connectionFactory, "ConnectionFactory must not be null!");
189+
Assert.notNull(connectionFactory, "ConnectionFactory must not be null");
190190

191191
return new RedisCacheManager(RedisCacheWriter.nonLockingRedisCacheWriter(connectionFactory),
192192
RedisCacheConfiguration.defaultCacheConfig());
@@ -210,7 +210,7 @@ public static RedisCacheManagerBuilder builder() {
210210
*/
211211
public static RedisCacheManagerBuilder builder(RedisConnectionFactory connectionFactory) {
212212

213-
Assert.notNull(connectionFactory, "ConnectionFactory must not be null!");
213+
Assert.notNull(connectionFactory, "ConnectionFactory must not be null");
214214

215215
return RedisCacheManagerBuilder.fromConnectionFactory(connectionFactory);
216216
}
@@ -223,7 +223,7 @@ public static RedisCacheManagerBuilder builder(RedisConnectionFactory connection
223223
*/
224224
public static RedisCacheManagerBuilder builder(RedisCacheWriter cacheWriter) {
225225

226-
Assert.notNull(cacheWriter, "CacheWriter must not be null!");
226+
Assert.notNull(cacheWriter, "CacheWriter must not be null");
227227

228228
return RedisCacheManagerBuilder.fromCacheWriter(cacheWriter);
229229
}
@@ -303,7 +303,7 @@ private RedisCacheManagerBuilder(RedisCacheWriter cacheWriter) {
303303
*/
304304
public static RedisCacheManagerBuilder fromConnectionFactory(RedisConnectionFactory connectionFactory) {
305305

306-
Assert.notNull(connectionFactory, "ConnectionFactory must not be null!");
306+
Assert.notNull(connectionFactory, "ConnectionFactory must not be null");
307307

308308
return new RedisCacheManagerBuilder(RedisCacheWriter.nonLockingRedisCacheWriter(connectionFactory));
309309
}
@@ -316,7 +316,7 @@ public static RedisCacheManagerBuilder fromConnectionFactory(RedisConnectionFact
316316
*/
317317
public static RedisCacheManagerBuilder fromCacheWriter(RedisCacheWriter cacheWriter) {
318318

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

321321
return new RedisCacheManagerBuilder(cacheWriter);
322322
}
@@ -329,7 +329,7 @@ public static RedisCacheManagerBuilder fromCacheWriter(RedisCacheWriter cacheWri
329329
*/
330330
public RedisCacheManagerBuilder cacheDefaults(RedisCacheConfiguration defaultCacheConfiguration) {
331331

332-
Assert.notNull(defaultCacheConfiguration, "DefaultCacheConfiguration must not be null!");
332+
Assert.notNull(defaultCacheConfiguration, "DefaultCacheConfiguration must not be null");
333333

334334
this.defaultCacheConfiguration = defaultCacheConfiguration;
335335

@@ -345,7 +345,7 @@ public RedisCacheManagerBuilder cacheDefaults(RedisCacheConfiguration defaultCac
345345
*/
346346
public RedisCacheManagerBuilder cacheWriter(RedisCacheWriter cacheWriter) {
347347

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

350350
this.cacheWriter = cacheWriter;
351351

@@ -374,7 +374,7 @@ public RedisCacheManagerBuilder transactionAware() {
374374
*/
375375
public RedisCacheManagerBuilder initialCacheNames(Set<String> cacheNames) {
376376

377-
Assert.notNull(cacheNames, "CacheNames must not be null!");
377+
Assert.notNull(cacheNames, "CacheNames must not be null");
378378

379379
cacheNames.forEach(it -> withCacheConfiguration(it, defaultCacheConfiguration));
380380
return this;
@@ -389,9 +389,9 @@ public RedisCacheManagerBuilder initialCacheNames(Set<String> cacheNames) {
389389
public RedisCacheManagerBuilder withInitialCacheConfigurations(
390390
Map<String, RedisCacheConfiguration> cacheConfigurations) {
391391

392-
Assert.notNull(cacheConfigurations, "CacheConfigurations must not be null!");
392+
Assert.notNull(cacheConfigurations, "CacheConfigurations must not be null");
393393
cacheConfigurations.forEach((cacheName, configuration) -> Assert.notNull(configuration,
394-
String.format("RedisCacheConfiguration for cache %s must not be null!", cacheName)));
394+
String.format("RedisCacheConfiguration for cache %s must not be null", cacheName)));
395395

396396
this.initialCaches.putAll(cacheConfigurations);
397397
return this;
@@ -406,8 +406,8 @@ public RedisCacheManagerBuilder withInitialCacheConfigurations(
406406
public RedisCacheManagerBuilder withCacheConfiguration(String cacheName,
407407
RedisCacheConfiguration cacheConfiguration) {
408408

409-
Assert.notNull(cacheName, "CacheName must not be null!");
410-
Assert.notNull(cacheConfiguration, "CacheConfiguration must not be null!");
409+
Assert.notNull(cacheName, "CacheName must not be null");
410+
Assert.notNull(cacheConfiguration, "CacheConfiguration must not be null");
411411

412412
this.initialCaches.put(cacheName, cacheConfiguration);
413413
return this;
@@ -469,7 +469,7 @@ public RedisCacheManagerBuilder enableStatistics() {
469469
public RedisCacheManager build() {
470470

471471
Assert.state(cacheWriter != null,
472-
"CacheWriter must not be null! You can provide one via 'RedisCacheManagerBuilder#cacheWriter(RedisCacheWriter)'.");
472+
"CacheWriter must not be null You can provide one via 'RedisCacheManagerBuilder#cacheWriter(RedisCacheWriter)'");
473473

474474
RedisCacheWriter theCacheWriter = cacheWriter;
475475

src/main/java/org/springframework/data/redis/cache/RedisCacheWriter.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ static RedisCacheWriter nonLockingRedisCacheWriter(RedisConnectionFactory connec
5757
static RedisCacheWriter nonLockingRedisCacheWriter(RedisConnectionFactory connectionFactory,
5858
BatchStrategy batchStrategy) {
5959

60-
Assert.notNull(connectionFactory, "ConnectionFactory must not be null!");
61-
Assert.notNull(batchStrategy, "BatchStrategy must not be null!");
60+
Assert.notNull(connectionFactory, "ConnectionFactory must not be null");
61+
Assert.notNull(batchStrategy, "BatchStrategy must not be null");
6262

6363
return new DefaultRedisCacheWriter(connectionFactory, batchStrategy);
6464
}
@@ -84,7 +84,7 @@ static RedisCacheWriter lockingRedisCacheWriter(RedisConnectionFactory connectio
8484
static RedisCacheWriter lockingRedisCacheWriter(RedisConnectionFactory connectionFactory,
8585
BatchStrategy batchStrategy) {
8686

87-
Assert.notNull(connectionFactory, "ConnectionFactory must not be null!");
87+
Assert.notNull(connectionFactory, "ConnectionFactory must not be null");
8888

8989
return new DefaultRedisCacheWriter(connectionFactory, Duration.ofMillis(50), batchStrategy);
9090
}

src/main/java/org/springframework/data/redis/config/RedisListenerContainerParser.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ protected void doParse(Element element, ParserContext parserContext, BeanDefinit
5858
if (isEligibleAttribute(attribute, parserContext)) {
5959
String propertyName = extractPropertyName(attribute.getLocalName());
6060
Assert.state(StringUtils.hasText(propertyName),
61-
"Illegal property name returned from 'extractPropertyName(String)': cannot be null or empty.");
61+
"Illegal property name returned from 'extractPropertyName(String)': cannot be null or empty");
6262
builder.addPropertyReference(propertyName, attribute.getValue());
6363
}
6464
}

src/main/java/org/springframework/data/redis/connection/AbstractRedisConnection.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public boolean hasRedisSentinelConfigured() {
6262

6363
private RedisNode selectActiveSentinel() {
6464

65-
Assert.state(hasRedisSentinelConfigured(), "Sentinel configuration missing!");
65+
Assert.state(hasRedisSentinelConfigured(), "Sentinel configuration missing");
6666

6767
for (RedisNode node : this.sentinelConfiguration.getSentinels()) {
6868
if (isActive(node)) {

0 commit comments

Comments
 (0)