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 ;
@@ -90,7 +89,7 @@ public RedisClusterConfiguration(Collection<String> clusterNodes) {
9089 */
9190 public RedisClusterConfiguration (PropertySource <?> propertySource ) {
9291
93- notNull (propertySource , "PropertySource must not be null!" );
92+ Assert . notNull (propertySource , "PropertySource must not be null!" );
9493
9594 this .clusterNodes = new LinkedHashSet <>();
9695
@@ -111,7 +110,7 @@ public RedisClusterConfiguration(PropertySource<?> propertySource) {
111110 */
112111 public void setClusterNodes (Iterable <RedisNode > nodes ) {
113112
114- notNull (nodes , "Cannot set cluster nodes to 'null'." );
113+ Assert . notNull (nodes , "Cannot set cluster nodes to 'null'." );
115114
116115 this .clusterNodes .clear ();
117116
@@ -136,7 +135,7 @@ public Set<RedisNode> getClusterNodes() {
136135 */
137136 public void addClusterNode (RedisNode node ) {
138137
139- notNull (node , "ClusterNode must not be 'null'." );
138+ Assert . notNull (node , "ClusterNode must not be 'null'." );
140139 this .clusterNodes .add (node );
141140 }
142141
@@ -227,8 +226,8 @@ private RedisNode readHostAndPortFromString(String hostAndPort) {
227226
228227 String [] args = split (hostAndPort , ":" );
229228
230- notNull (args , "HostAndPort need to be seperated by ':'." );
231- isTrue (args .length == 2 , "Host and Port String needs to specified as host:port" );
229+ Assert . notNull (args , "HostAndPort need to be seperated by ':'." );
230+ Assert . isTrue (args .length == 2 , "Host and Port String needs to specified as host:port" );
232231 return new RedisNode (args [0 ], Integer .valueOf (args [1 ]));
233232 }
234233
@@ -239,7 +238,8 @@ private RedisNode readHostAndPortFromString(String hostAndPort) {
239238 */
240239 private static Map <String , Object > asMap (Collection <String > clusterHostAndPorts , int redirects ) {
241240
242- notNull (clusterHostAndPorts , "ClusterHostAndPorts must not be null!" );
241+ Assert .notNull (clusterHostAndPorts , "ClusterHostAndPorts must not be null!" );
242+ Assert .noNullElements (clusterHostAndPorts , "ClusterHostAndPorts must not contain null elements!" );
243243
244244 Map <String , Object > map = new HashMap <>();
245245 map .put (REDIS_CLUSTER_NODES_CONFIG_PROPERTY , StringUtils .collectionToCommaDelimitedString (clusterHostAndPorts ));
0 commit comments