From 5419aded99ca04270b675105b62d2dbcf237c57d Mon Sep 17 00:00:00 2001 From: "Dylan.Liu" Date: Thu, 23 Apr 2020 20:45:28 +0800 Subject: [PATCH] =?UTF-8?q?=E6=97=A0=20jira=20=E4=BB=BB=E5=8A=A1=20,=20?= =?UTF-8?q?=E9=80=82=E9=85=8D=201.7=20=E8=AF=AD=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/fanruan/api/conf/ConfigurationKit.java | 8 ++++---- src/main/java/com/fanruan/api/data/ConnectionKit.java | 6 ++---- .../fanruan/api/cluster/state/FineJedisPoolKitTest.java | 4 ++-- 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/src/main/java/com/fanruan/api/conf/ConfigurationKit.java b/src/main/java/com/fanruan/api/conf/ConfigurationKit.java index b4bbacf..30706ed 100644 --- a/src/main/java/com/fanruan/api/conf/ConfigurationKit.java +++ b/src/main/java/com/fanruan/api/conf/ConfigurationKit.java @@ -49,7 +49,7 @@ public class ConfigurationKit { * @param configType 配置类 * @param runner 执行器 */ - public static void modify(Class configType, Runner runner) { + public static void modify(Class configType, final Runner runner) { Configurations.modify(new WorkerFacade(configType) { @Override public void run() { @@ -68,7 +68,7 @@ public class ConfigurationKit { * @param runner 执行器 * @param configTypes 配置类(所有的配置类都会缓存失效) */ - public static void modify(Runner runner, Class configType, Class... configTypes) { + public static void modify(final Runner runner, Class configType, Class... configTypes) { Configurations.modify(new WorkerFacade(configType, configTypes) { @Override public void run() { @@ -87,7 +87,7 @@ public class ConfigurationKit { * @param runner 执行器 * @param callBack 事务回调 */ - public static void modify(Class configType, Runner runner, WorkerCallBack callBack) { + public static void modify(Class configType, final Runner runner, WorkerCallBack callBack) { WorkerFacade facade = new WorkerFacade(configType) { @Override public void run() { @@ -111,7 +111,7 @@ public class ConfigurationKit { * @param callBack 事务回调 * @param configTypes 配置类(所有的配置类都会缓存失效) */ - public static void modify(Runner runner, WorkerCallBack callBack, Class configType, Class... configTypes) { + public static void modify(final Runner runner, WorkerCallBack callBack, Class configType, Class... configTypes) { WorkerFacade facade = new WorkerFacade(configType, configTypes) { @Override public void run() { diff --git a/src/main/java/com/fanruan/api/data/ConnectionKit.java b/src/main/java/com/fanruan/api/data/ConnectionKit.java index 1715ae8..14511c8 100644 --- a/src/main/java/com/fanruan/api/data/ConnectionKit.java +++ b/src/main/java/com/fanruan/api/data/ConnectionKit.java @@ -4,8 +4,6 @@ import com.fanruan.api.util.TypeKit; import com.fr.data.impl.Connection; import com.fr.data.impl.NameDatabaseConnection; import com.fr.file.ConnectionConfig; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; import java.util.Map; @@ -20,7 +18,7 @@ public class ConnectionKit { * @param name 名字 * @return 数据连接 */ - public static @Nullable Connection getConnection(@NotNull String name) { + public static Connection getConnection(String name) { return ConnectionConfig.getInstance().getConnection(name); } @@ -31,7 +29,7 @@ public class ConnectionKit { * @param type 类型 * @return 数据连接 */ - public static @Nullable T getConnection(@NotNull String name, Class type) { + public static T getConnection(String name, Class type) { Connection connection = getConnection(name); if (TypeKit.objectInstanceOf(connection, type)) { return (T) connection; diff --git a/src/test/java/com/fanruan/api/cluster/state/FineJedisPoolKitTest.java b/src/test/java/com/fanruan/api/cluster/state/FineJedisPoolKitTest.java index f64c325..02c82ee 100644 --- a/src/test/java/com/fanruan/api/cluster/state/FineJedisPoolKitTest.java +++ b/src/test/java/com/fanruan/api/cluster/state/FineJedisPoolKitTest.java @@ -35,8 +35,8 @@ public class FineJedisPoolKitTest { }); Assert.assertNull(FineStorePool.getInstance().getResource()); - FineStore mockFineJedis = mock(FineStore.class); - expect(mockFineJedis.type(anyObject())).andReturn("TestFineJedis"); + final FineStore mockFineJedis = mock(FineStore.class); + expect(mockFineJedis.type((byte[]) anyObject())).andReturn("TestFineJedis"); EasyMock.replay(mockFineJedis); FineJedisPoolKit.setRealClient(new FineStoreWrapper() {