Prefers no arg constructor

pull/527/head
jackygurui 9 years ago
parent 82943e18c5
commit b6d124f6ca

@ -1,6 +1,5 @@
package org.redisson; package org.redisson;
import java.lang.reflect.Constructor;
import java.util.Map; import java.util.Map;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
import net.bytebuddy.ByteBuddy; import net.bytebuddy.ByteBuddy;
@ -57,9 +56,9 @@ public class RedissonAttachedLiveObjectService implements RAttachedLiveObjectSer
try { try {
T instance; T instance;
try { try {
instance = getProxyClass(entityClass).getDeclaredConstructor(id.getClass()).newInstance(id);
} catch (NoSuchMethodException exception) {
instance = getProxyClass(entityClass).newInstance(); instance = getProxyClass(entityClass).newInstance();
} catch (Exception exception) {
instance = getProxyClass(entityClass).getDeclaredConstructor(id.getClass()).newInstance(id);
} }
((RLiveObject) instance).setLiveObjectId(id); ((RLiveObject) instance).setLiveObjectId(id);
return instance; return instance;

Loading…
Cancel
Save