DATAREDIS-976 - Polishing.

Add missing nullable annotations.

Original pull request: #457
This commit is contained in:
Christoph Strobl
2019-07-03 11:01:24 +02:00
parent 05798fb637
commit 1bdf875d45
3 changed files with 10 additions and 9 deletions

View File

@@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
REDIS_VERSION:=5.0.4
REDIS_VERSION:=5.0.5
SPRING_PROFILE?=ci
SHELL=/bin/bash -euo pipefail

View File

@@ -42,7 +42,6 @@ import java.util.stream.Collectors;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.DisposableBean;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.dao.DataAccessException;
@@ -380,10 +379,12 @@ public class LettuceConnectionFactory
* @param timeout command timeout in {@link TimeUnit#MILLISECONDS}.
* @param database database index to operate on.
* @return the {@link LettuceConnection}.
* @throws IllegalArgumentException if a required parameter is {@literal null}.
* @since 2.2
*/
protected LettuceConnection doCreateLettuceConnection(StatefulRedisConnection<byte[], byte[]> sharedConnection,
LettuceConnectionProvider connectionProvider, long timeout, int database) {
protected LettuceConnection doCreateLettuceConnection(
@Nullable StatefulRedisConnection<byte[], byte[]> sharedConnection, LettuceConnectionProvider connectionProvider,
long timeout, int database) {
return new LettuceConnection(sharedConnection, connectionProvider, timeout, database);
}
@@ -398,12 +399,13 @@ public class LettuceConnectionFactory
* @param clusterCommandExecutor the {@link ClusterCommandExecutor} to release connections.
* @param commandTimeout command timeout {@link Duration}.
* @return the {@link LettuceConnection}.
* @throws IllegalArgumentException if a required parameter is {@literal null}.
* @since 2.2
*/
protected LettuceClusterConnection doCreateLettuceClusterConnection(
StatefulRedisClusterConnection<byte[], byte[]> sharedConnection, LettuceConnectionProvider connectionProvider,
ClusterTopologyProvider topologyProvider, ClusterCommandExecutor clusterCommandExecutor,
Duration commandTimeout) {
@Nullable StatefulRedisClusterConnection<byte[], byte[]> sharedConnection,
LettuceConnectionProvider connectionProvider, ClusterTopologyProvider topologyProvider,
ClusterCommandExecutor clusterCommandExecutor, Duration commandTimeout) {
return new LettuceClusterConnection(sharedConnection, connectionProvider, topologyProvider, clusterCommandExecutor,
commandTimeout);

View File

@@ -23,7 +23,6 @@ import org.junit.Assume;
import org.junit.rules.ExternalResource;
import org.junit.rules.TestRule;
import org.springframework.data.redis.connection.RedisClusterConfiguration;
import org.springframework.data.redis.connection.RedisConfiguration;
import org.springframework.data.redis.connection.RedisNode;
import org.springframework.data.redis.connection.jedis.JedisConverters;
@@ -64,7 +63,7 @@ public class RedisClusterRule extends ExternalResource {
Assume.assumeThat(mode, is("cluster"));
}
public RedisConfiguration getConfiguration() {
public RedisClusterConfiguration getConfiguration() {
return this.clusterConfig;
}