Browse Source

无 jira 任务 , 适配 1.7 语法

pull/35/head
Dylan.Liu 5 years ago
parent
commit
5419aded99
  1. 8
      src/main/java/com/fanruan/api/conf/ConfigurationKit.java
  2. 6
      src/main/java/com/fanruan/api/data/ConnectionKit.java
  3. 4
      src/test/java/com/fanruan/api/cluster/state/FineJedisPoolKitTest.java

8
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<? extends Configuration> configType, Runner runner) {
public static void modify(Class<? extends Configuration> 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<? extends Configuration> configType, Class<? extends Configuration>... configTypes) {
public static void modify(final Runner runner, Class<? extends Configuration> configType, Class<? extends Configuration>... 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<? extends Configuration> configType, Runner runner, WorkerCallBack callBack) {
public static void modify(Class<? extends Configuration> 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<? extends Configuration> configType, Class<? extends Configuration>... configTypes) {
public static void modify(final Runner runner, WorkerCallBack callBack, Class<? extends Configuration> configType, Class<? extends Configuration>... configTypes) {
WorkerFacade facade = new WorkerFacade(configType, configTypes) {
@Override
public void run() {

6
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 <T extends Connection> @Nullable T getConnection(@NotNull String name, Class<? extends Connection> type) {
public static <T extends Connection>T getConnection(String name, Class<? extends Connection> type) {
Connection connection = getConnection(name);
if (TypeKit.objectInstanceOf(connection, type)) {
return (T) connection;

4
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() {

Loading…
Cancel
Save