mirror of
https://github.com/hs-web/hsweb-framework.git
synced 2026-06-06 22:19:29 +08:00
修复target错误
This commit is contained in:
@@ -137,7 +137,7 @@ public final class FastBeanCopier {
|
||||
|
||||
public static Copier createCopier(Class source, Class target) {
|
||||
String sourceName = source.getName();
|
||||
String tartName = source.getName();
|
||||
String tartName = target.getName();
|
||||
if (sourceName.startsWith("package ")) {
|
||||
sourceName = sourceName.substring("package ".length());
|
||||
}
|
||||
|
||||
@@ -15,6 +15,7 @@ import org.springframework.util.ClassUtils;
|
||||
import java.util.Arrays;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.atomic.AtomicLong;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
/**
|
||||
* @author zhouhao
|
||||
@@ -44,7 +45,6 @@ public class Proxy<I> {
|
||||
throw new NullPointerException("superClass can not be null");
|
||||
}
|
||||
this.superClass = superClass;
|
||||
|
||||
ClassPool classPool = new ClassPool(true);
|
||||
|
||||
ClassPath classPath = new ClassClassPath(this.getClass());
|
||||
@@ -85,7 +85,7 @@ public class Proxy<I> {
|
||||
}
|
||||
|
||||
@SuppressWarnings("all")
|
||||
protected MemberValue createMemberValue(Object value, ConstPool constPool) {
|
||||
public static MemberValue createMemberValue(Object value, ConstPool constPool) {
|
||||
MemberValue memberValue = null;
|
||||
if (value instanceof Integer) {
|
||||
memberValue = new IntegerMemberValue(constPool, ((Integer) value));
|
||||
@@ -103,12 +103,17 @@ public class Proxy<I> {
|
||||
arrayMemberValue.setValue(Arrays.stream(arr)
|
||||
.map(o -> createMemberValue(o, constPool))
|
||||
.toArray(MemberValue[]::new));
|
||||
memberValue=arrayMemberValue;
|
||||
memberValue = arrayMemberValue;
|
||||
|
||||
}
|
||||
return memberValue;
|
||||
}
|
||||
|
||||
public Proxy<I> custom(Consumer<CtClass> ctClassConsumer) {
|
||||
ctClassConsumer.accept(ctClass);
|
||||
return this;
|
||||
}
|
||||
|
||||
@SneakyThrows
|
||||
public Proxy<I> addField(String code, Class<? extends java.lang.annotation.Annotation> annotation, Map<String, Object> annotationProperties) {
|
||||
return handleException(() -> {
|
||||
|
||||
Reference in New Issue
Block a user