Skip to content

Commit

Permalink
bug fix.
Browse files Browse the repository at this point in the history
  • Loading branch information
yangtu222 committed Oct 30, 2017
1 parent 30cb4b5 commit cb54836
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ private static CopyFeature[] parseBeanCopyFeatures(Class<?> sourceClass, Class<?
if( optionClass.isAnnotationPresent(BeanCopySource.class) ) {
BeanCopySource source = optionClass.getAnnotation(BeanCopySource.class);
Class<?> sourceClassFromAnnotation = source.source();
if( sourceClassFromAnnotation.equals(sourceClass) ) {
if( sourceClassFromAnnotation.isAssignableFrom(sourceClass) ) {
return source.features();
} else {
//fix sourceClass is proxy class.
Expand All @@ -135,7 +135,7 @@ private static CopyFeature[] parseBeanCopyFeatures(Class<?> sourceClass, Class<?
if( targetClass.isAnnotationPresent(BeanCopySource.class) ) {
BeanCopySource source = targetClass.getAnnotation(BeanCopySource.class);
Class<?> sourceClassFromAnnotation = source.source();
if( sourceClassFromAnnotation.equals(sourceClass) ) {
if( sourceClassFromAnnotation.isAssignableFrom(sourceClass) ) {
return source.features();
}
}
Expand All @@ -152,7 +152,7 @@ public static List<BeanCopyPropertyItem> buildBeanCopyPropertyItem(Class<?> sour
if( optionClass.isAnnotationPresent(BeanCopySource.class) ) {
BeanCopySource source = optionClass.getAnnotation(BeanCopySource.class);
Class<?> sourceClassFromAnnotation = source.source();
if( sourceClassFromAnnotation.equals(sourceClass) ) {
if( sourceClassFromAnnotation.isAssignableFrom(sourceClass) ) {
beanAnnotationSource = sourceClassFromAnnotation;
} else {
//fix sourceClass is proxy class.
Expand All @@ -165,7 +165,7 @@ public static List<BeanCopyPropertyItem> buildBeanCopyPropertyItem(Class<?> sour
if( beanAnnotationSource == null && targetClass.isAnnotationPresent(BeanCopySource.class) ) {
BeanCopySource source = targetClass.getAnnotation(BeanCopySource.class);
Class<?> sourceClassFromAnnotation = source.source();
if( sourceClassFromAnnotation.equals(sourceClass) ) {
if( sourceClassFromAnnotation.isAssignableFrom(sourceClass) ) {
beanAnnotationSource = sourceClassFromAnnotation;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ public static void dumpPropertyMapping(Class<?> sourceClass, Class<?> targetClas
dumpPropertyMappingInternal(sourceClass, targetClass, optionClass);

localDumpLevel.set(--dumpLevel);
if(dumpLevel == -1 && localDumpStack.get().size() > 0 ) {
logger.info("=============================================================================================");
}
}

public static void dumpPropertyMappingInternal(Class<?> sourceClass, Class<?> targetClass , Class<?> optionClass) {
Expand Down

0 comments on commit cb54836

Please sign in to comment.