Skip to content

Commit

Permalink
little improve
Browse files Browse the repository at this point in the history
  • Loading branch information
yangtu222 committed Sep 22, 2017
1 parent b1076ec commit 6d80123
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 6d80123

Please sign in to comment.