Skip to content

Commit b0669dd

Browse files
DATAREDIS-599 - Remove references to single-argument assertion methods of Spring.
1 parent 5f3fa9a commit b0669dd

23 files changed

+63
-57
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2015-2016 the original author or authors.
2+
* Copyright 2015-2017 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -73,9 +73,9 @@ public class ClusterCommandExecutor implements DisposableBean {
7373
public ClusterCommandExecutor(ClusterTopologyProvider topologyProvider, ClusterNodeResourceProvider resourceProvider,
7474
ExceptionTranslationStrategy exceptionTranslation) {
7575

76-
Assert.notNull(topologyProvider);
77-
Assert.notNull(resourceProvider);
78-
Assert.notNull(exceptionTranslation);
76+
Assert.notNull(topologyProvider, "ClusterTopologyProvider must not be null!");
77+
Assert.notNull(resourceProvider, "ClusterNodeResourceProvider must not be null!");
78+
Assert.notNull(exceptionTranslation, "ExceptionTranslationStrategy must not be null!");
7979

8080
this.topologyProvider = topologyProvider;
8181
this.resourceProvider = resourceProvider;

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2014-2015 the original author or authors.
2+
* Copyright 2014-2017 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -158,7 +158,7 @@ public String getName() {
158158
*/
159159
public void setMaster(NamedNode master) {
160160

161-
notNull("Sentinel master node must not be 'null'.");
161+
notNull(master, "Sentinel master node must not be 'null'.");
162162
this.master = master;
163163
}
164164

src/main/java/org/springframework/data/redis/connection/jedis/JedisClusterConnection.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2015-2016 the original author or authors.
2+
* Copyright 2015-2017 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -607,7 +607,7 @@ public byte[] getSet(byte[] key, byte[] value) {
607607
@Override
608608
public List<byte[]> mGet(byte[]... keys) {
609609

610-
Assert.noNullElements(keys);
610+
Assert.noNullElements(keys, "Keys must not contain null elements!");
611611

612612
if (ClusterSlotHashUtil.isSameSlotForAllKeys(keys)) {
613613
return cluster.mget(keys);

src/main/java/org/springframework/data/redis/connection/jedis/JedisConnectionFactory.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2011-2016 the original author or authors.
2+
* Copyright 2011-2017 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -294,7 +294,7 @@ private JedisCluster createCluster() {
294294
*/
295295
protected JedisCluster createCluster(RedisClusterConfiguration clusterConfig, GenericObjectPoolConfig poolConfig) {
296296

297-
Assert.notNull("Cluster configuration must not be null!");
297+
Assert.notNull(clusterConfig, "Cluster configuration must not be null!");
298298

299299
Set<HostAndPort> hostAndPort = new HashSet<HostAndPort>();
300300
for (RedisNode node : clusterConfig.getClusterNodes()) {
@@ -603,7 +603,7 @@ public RedisSentinelConnection getSentinelConnection() {
603603

604604
private Jedis getActiveSentinel() {
605605

606-
Assert.notNull(this.sentinelConfig);
606+
Assert.notNull(this.sentinelConfig, "SentinelConfig must not be null!");
607607

608608
for (RedisNode node : this.sentinelConfig.getSentinels()) {
609609

src/main/java/org/springframework/data/redis/connection/jedis/JedisConverters.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2013-2016 the original author or authors.
2+
* Copyright 2013-2017 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -334,7 +334,7 @@ public static DataAccessException toDataAccessException(Exception ex) {
334334
}
335335

336336
public static LIST_POSITION toListPosition(Position source) {
337-
Assert.notNull("list positions are mandatory");
337+
Assert.notNull(source, "list positions are mandatory");
338338
return (Position.AFTER.equals(source) ? LIST_POSITION.AFTER : LIST_POSITION.BEFORE);
339339
}
340340

src/main/java/org/springframework/data/redis/connection/jedis/JedisUtils.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2011-2013 the original author or authors.
2+
* Copyright 2011-2017 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -216,7 +216,7 @@ static byte[] asBit(boolean value) {
216216
}
217217

218218
static LIST_POSITION convertPosition(Position where) {
219-
Assert.notNull("list positions are mandatory");
219+
Assert.notNull(where, "list positions are mandatory");
220220
return (Position.AFTER.equals(where) ? LIST_POSITION.AFTER : LIST_POSITION.BEFORE);
221221
}
222222

src/main/java/org/springframework/data/redis/connection/jredis/JredisConnectionFactory.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2011-2016 the original author or authors.
2+
* Copyright 2011-2017 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -77,7 +77,7 @@ public JredisConnectionFactory(Pool<JRedis> pool) {
7777

7878
public void afterPropertiesSet() {
7979
if (connectionSpec == null && pool == null) {
80-
Assert.hasText(hostName);
80+
Assert.hasText(hostName, "Redis host name must not be null!");
8181
connectionSpec = DefaultConnectionSpec.newSpec(hostName, port, dbIndex, DEFAULT_REDIS_PASSWORD);
8282
connectionSpec.setConnectionFlag(Connection.Flag.RELIABLE, false);
8383

src/main/java/org/springframework/data/redis/connection/lettuce/LettuceConverters.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2013-2016 the original author or authors.
2+
* Copyright 2013-2017 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -453,7 +453,7 @@ public static ScriptOutputType toScriptOutputType(ReturnType returnType) {
453453
}
454454

455455
public static boolean toBoolean(Position where) {
456-
Assert.notNull("list positions are mandatory");
456+
Assert.notNull(where, "list positions are mandatory");
457457
return (Position.AFTER.equals(where) ? false : true);
458458
}
459459

src/main/java/org/springframework/data/redis/connection/srp/SrpConnection.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2011-2016 the original author or authors.
2+
* Copyright 2011-2017 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -234,7 +234,7 @@ public List<Object> get() {
234234

235235
SrpConnection(RedisClient client) {
236236

237-
Assert.notNull(client);
237+
Assert.notNull(client, "RedisClient must not be null!");
238238
this.client = client;
239239
this.queue = new ArrayBlockingQueue<SrpConnection>(50);
240240
}

src/main/java/org/springframework/data/redis/connection/srp/SrpConverters.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2013-2015 the original author or authors.
2+
* Copyright 2013-2017 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -387,7 +387,7 @@ public static byte[][] toByteArrays(Map<byte[], byte[]> source) {
387387
}
388388

389389
public static byte[] toBytes(Position source) {
390-
Assert.notNull("list positions are mandatory");
390+
Assert.notNull(source, "list positions are mandatory");
391391
return (Position.AFTER.equals(source) ? AFTER : BEFORE);
392392
}
393393

0 commit comments

Comments
 (0)