diff --git a/src/main/java/com/tuyang/beanutils/internal/cache/BeanCopyCache.java b/src/main/java/com/tuyang/beanutils/internal/cache/BeanCopyCache.java index 7e9b063..62b69d7 100644 --- a/src/main/java/com/tuyang/beanutils/internal/cache/BeanCopyCache.java +++ b/src/main/java/com/tuyang/beanutils/internal/cache/BeanCopyCache.java @@ -75,12 +75,6 @@ public static void setBeanCopyConfig(BeanCopyConfig beanCopyConfig) { public static BeanCopier getBeanCopy(Class sourceClass, Class targetClass, Class optionClass) { - if( sourceClass.getSimpleName().contains("$$") ) { - if(sourceClass.getSuperclass() != null && sourceClass.getName().startsWith( sourceClass.getSuperclass().getName() ) ){ - sourceClass = sourceClass.getSuperclass(); - } - } - long cacheKey = (((long)sourceClass.hashCode() ) << 16 )+ (long) targetClass.hashCode(); if( optionClass != null ) { cacheKey = (cacheKey <<16) + (long)optionClass.hashCode(); diff --git a/src/main/java/com/tuyang/beanutils/internal/javassist/JavassistBeanCopyFactory.java b/src/main/java/com/tuyang/beanutils/internal/javassist/JavassistBeanCopyFactory.java index fcee9a7..449d1f6 100644 --- a/src/main/java/com/tuyang/beanutils/internal/javassist/JavassistBeanCopyFactory.java +++ b/src/main/java/com/tuyang/beanutils/internal/javassist/JavassistBeanCopyFactory.java @@ -66,6 +66,12 @@ public BeanCopier createBeanCopier(Class sourceClass, Class targetClass, L String className = "com.tuyang.beanutils.internal.javassist.impl.BeanCopier$$javassist" + thisCount; + if( sourceClass.getSimpleName().contains("$$") ) { + if(sourceClass.getSuperclass() != null && sourceClass.getName().startsWith( sourceClass.getSuperclass().getName() ) ){ + sourceClass = sourceClass.getSuperclass(); + } + } + try { int converterCount = 0;