refactoring

pull/2247/head^2
Nikita Koksharov 6 years ago
parent bc9b3e04d6
commit c1b7f54a04

@ -16,12 +16,13 @@
package org.redisson.liveobject.core; package org.redisson.liveobject.core;
import java.lang.reflect.Method; import java.lang.reflect.Method;
import org.redisson.api.RMap;
import net.bytebuddy.implementation.bind.annotation.AllArguments; import net.bytebuddy.implementation.bind.annotation.AllArguments;
import net.bytebuddy.implementation.bind.annotation.FieldValue; import net.bytebuddy.implementation.bind.annotation.FieldValue;
import net.bytebuddy.implementation.bind.annotation.Origin; import net.bytebuddy.implementation.bind.annotation.Origin;
import net.bytebuddy.implementation.bind.annotation.RuntimeType; import net.bytebuddy.implementation.bind.annotation.RuntimeType;
import org.redisson.api.RMap;
import org.redisson.liveobject.misc.ClassUtils;
/** /**
* *
@ -35,10 +36,6 @@ public class RMapInterceptor {
@AllArguments Object[] args, @AllArguments Object[] args,
@FieldValue("liveObjectLiveMap") RMap<?, ?> map @FieldValue("liveObjectLiveMap") RMap<?, ?> map
) throws Exception { ) throws Exception {
Class<?>[] cls = new Class[args.length]; return method.invoke(map, args);
for (int i = 0; i < args.length; i++) {
cls[i] = args[i].getClass();
}
return ClassUtils.searchForMethod(RMap.class, method.getName(), cls).invoke(map, args);
} }
} }

Loading…
Cancel
Save