1515 */
1616package org .springframework .data .redis .connection ;
1717
18- import static org .springframework .util .Assert .*;
1918import static org .springframework .util .StringUtils .*;
2019
2120import java .util .Collection ;
@@ -91,7 +90,7 @@ public RedisClusterConfiguration(Collection<String> clusterNodes) {
9190 */
9291 public RedisClusterConfiguration (PropertySource <?> propertySource ) {
9392
94- notNull (propertySource , "PropertySource must not be null!" );
93+ Assert . notNull (propertySource , "PropertySource must not be null!" );
9594
9695 this .clusterNodes = new LinkedHashSet <>();
9796
@@ -112,7 +111,7 @@ public RedisClusterConfiguration(PropertySource<?> propertySource) {
112111 */
113112 public void setClusterNodes (Iterable <RedisNode > nodes ) {
114113
115- notNull (nodes , "Cannot set cluster nodes to 'null'." );
114+ Assert . notNull (nodes , "Cannot set cluster nodes to 'null'." );
116115
117116 this .clusterNodes .clear ();
118117
@@ -137,7 +136,7 @@ public Set<RedisNode> getClusterNodes() {
137136 */
138137 public void addClusterNode (RedisNode node ) {
139138
140- notNull (node , "ClusterNode must not be 'null'." );
139+ Assert . notNull (node , "ClusterNode must not be 'null'." );
141140 this .clusterNodes .add (node );
142141 }
143142
@@ -266,8 +265,8 @@ private RedisNode readHostAndPortFromString(String hostAndPort) {
266265
267266 String [] args = split (hostAndPort , ":" );
268267
269- notNull (args , "HostAndPort need to be seperated by ':'." );
270- isTrue (args .length == 2 , "Host and Port String needs to specified as host:port" );
268+ Assert . notNull (args , "HostAndPort need to be seperated by ':'." );
269+ Assert . isTrue (args .length == 2 , "Host and Port String needs to specified as host:port" );
271270 return new RedisNode (args [0 ], Integer .valueOf (args [1 ]));
272271 }
273272
@@ -278,7 +277,8 @@ private RedisNode readHostAndPortFromString(String hostAndPort) {
278277 */
279278 private static Map <String , Object > asMap (Collection <String > clusterHostAndPorts , int redirects ) {
280279
281- notNull (clusterHostAndPorts , "ClusterHostAndPorts must not be null!" );
280+ Assert .notNull (clusterHostAndPorts , "ClusterHostAndPorts must not be null!" );
281+ Assert .noNullElements (clusterHostAndPorts , "ClusterHostAndPorts must not contain null elements!" );
282282
283283 Map <String , Object > map = new HashMap <>();
284284 map .put (REDIS_CLUSTER_NODES_CONFIG_PROPERTY , StringUtils .collectionToCommaDelimitedString (clusterHostAndPorts ));
0 commit comments