From fd0913f7b2f1cd1c6b08e4aa73dbebfbe6940b47 Mon Sep 17 00:00:00 2001 From: LadyCailin Date: Wed, 27 Mar 2024 19:50:11 +0100 Subject: [PATCH] Update dependency versions --- pom.xml | 69 ++++++++++--------- .../persistence/RedisDataSource.java | 23 ++++--- 2 files changed, 51 insertions(+), 41 deletions(-) diff --git a/pom.xml b/pom.xml index 493f6f782d..dc62f533e9 100644 --- a/pom.xml +++ b/pom.xml @@ -219,7 +219,7 @@ org.xerial sqlite-jdbc - 3.41.2.2 + 3.45.2.0 compile @@ -228,7 +228,7 @@ redis.clients jedis - 2.9.0 + 5.2.0-beta1 jar compile @@ -238,7 +238,7 @@ com.mysql mysql-connector-j - 8.0.33 + 8.3.0 jar compile @@ -259,7 +259,7 @@ - 8.2.2.jre8 + 12.6.1.jre11 @@ -267,7 +267,7 @@ org.yaml snakeyaml - 2.0 + 2.2 @@ -297,7 +297,7 @@ com.jcraft jsch - 0.1.54 + 0.1.55 @@ -323,10 +323,17 @@ - hamcrest-core + hamcrest org.hamcrest jar - 1.3 + 2.2 + test + + + hamcrest-library + org.hamcrest + jar + 2.2 test @@ -338,7 +345,7 @@ org.mockito mockito-core - 3.10.0 + 5.11.0 test @@ -391,7 +398,7 @@ org.eclipse.lsp4j org.eclipse.lsp4j - 0.21.0 + 0.22.0 io.swagger.core.v3 @@ -482,7 +489,7 @@ org.apache.maven.plugins maven-compiler-plugin - 3.8.1 + 3.12.1 true 16 @@ -498,7 +505,7 @@ org.apache.maven.plugins maven-jar-plugin - 3.2.0 + 3.3.0 true @@ -520,7 +527,7 @@ org.apache.maven.plugins maven-shade-plugin - 3.3.0 + 3.5.2 ShadedBundle @@ -946,7 +953,7 @@ org.codehaus.mojo exec-maven-plugin - 3.0.0 + 3.2.0 cache-annotations @@ -967,7 +974,7 @@ org.bsc.maven maven-processor-plugin - 5.0-jdk8-rc1 + 5.0-jdk8-rc3 process @@ -990,7 +997,7 @@ org.apache.maven.plugins maven-surefire-plugin - 3.0.0-M5 + 3.2.5 false @@ -1010,7 +1017,7 @@ org.apache.maven.plugins maven-release-plugin - 3.0.0-M4 + 3.0.1 false true @@ -1022,37 +1029,37 @@ org.apache.maven.plugins maven-javadoc-plugin - 3.3.0 + 3.6.3 org.apache.maven.plugins maven-deploy-plugin - 3.0.0-M1 + 3.1.1 org.apache.maven.plugins maven-source-plugin - 3.2.1 + 3.3.0 org.apache.maven.plugins maven-clean-plugin - 3.1.0 + 3.3.2 org.apache.maven.plugins maven-install-plugin - 3.0.0-M1 + 3.1.1 org.apache.maven.plugins maven-resources-plugin - 3.2.0 + 3.3.1 org.apache.maven.plugins maven-site-plugin - 3.9.1 + 4.0.0-M13 org.codehaus.mojo @@ -1064,7 +1071,7 @@ org.apache.maven.plugins maven-checkstyle-plugin - 3.1.2 + 3.3.1 checkstyle @@ -1096,7 +1103,7 @@ org.apache.maven.plugins maven-enforcer-plugin - 3.0.0-M3 + 3.4.1 enforce-maven @@ -1106,7 +1113,7 @@ - 3.5.2 + 3.6.3 @@ -1147,7 +1154,7 @@ org.apache.maven.plugins maven-compiler-plugin - 3.8.1 + 3.13.0 false diff --git a/src/main/java/com/laytonsmith/persistence/RedisDataSource.java b/src/main/java/com/laytonsmith/persistence/RedisDataSource.java index 4f86e4de38..9411539e99 100644 --- a/src/main/java/com/laytonsmith/persistence/RedisDataSource.java +++ b/src/main/java/com/laytonsmith/persistence/RedisDataSource.java @@ -12,8 +12,10 @@ import java.util.HashSet; import java.util.Map; import java.util.Set; +import redis.clients.jedis.DefaultJedisClientConfig; +import redis.clients.jedis.HostAndPort; import redis.clients.jedis.Jedis; -import redis.clients.jedis.JedisShardInfo; +import redis.clients.jedis.JedisClientConfig; import redis.clients.jedis.Transaction; import redis.clients.jedis.exceptions.JedisConnectionException; @@ -26,7 +28,7 @@ public class RedisDataSource extends AbstractDataSource { private Jedis connection; private Transaction transaction; - private JedisShardInfo shardInfo; + private JedisClientConfig shardInfo; private String host; private int port; private int timeout; @@ -44,19 +46,16 @@ public RedisDataSource(URI uri, ConnectionMixinFactory.ConnectionMixinOptions op host = uri.getHost(); port = uri.getPort(); Map queryString = WebUtility.getQueryMap(uri.getQuery()); - if(port == -1) { - shardInfo = new JedisShardInfo(host); - } else { - shardInfo = new JedisShardInfo(host, port); - } + DefaultJedisClientConfig.Builder builder = DefaultJedisClientConfig.builder(); if(queryString.containsKey("timeout")) { timeout = Integer.parseInt(queryString.get("timeout")); - shardInfo.setSoTimeout(timeout); + builder.socketTimeoutMillis(timeout); } if(queryString.containsKey("password")) { password = queryString.get("password"); - shardInfo.setPassword(password); + builder.password(password); } + shardInfo = builder.build(); connect(); } catch (Exception e) { throw new DataSourceException(e.getMessage(), e); @@ -87,7 +86,11 @@ private void connect() { } } if(needToConnect) { - connection = new Jedis(shardInfo); + int oPort = 6379; + if(port != -1) { + oPort = port; + } + connection = new Jedis(new HostAndPort(host, oPort), shardInfo); } }