Skip to content

Commit

Permalink
bugfix:fix the problem in the findTargetClass method (apache#3716)
Browse files Browse the repository at this point in the history
  • Loading branch information
ls9527 authored May 11, 2021
1 parent 1d87679 commit 965a48d
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
5 changes: 4 additions & 1 deletion changes/1.5.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@ Seata 是一款开源的分布式事务解决方案,提供高性能和简单
### bugfix:
- [[#3686](https://github.com/seata/seata/pull/3686)] 修复Apollo集群配置项错误及NPE错误
- [[#3702](https://github.com/seata/seata/pull/3702)] 修改注释
- [[#3716](https://github.com/seata/seata/pull/3716)] 修复findTargetClass方法的错误
- [[#3717](https://github.com/seata/seata/pull/3717)] 更正interval的拼写



### optimize:
Expand Down Expand Up @@ -55,8 +56,10 @@ Seata 是一款开源的分布式事务解决方案,提供高性能和简单
- [cmonkey](https://github.com/cmonkey)
- [selfishlover](https://github.com/selfishlover)
- [13414850431](https://github.com/13414850431)
- [ls9527](https://github.com/ls9527)
- [xingfudeshi](https://github.com/xingfudeshi)
- [wangliang181230](https://github.com/wangliang181230)


同时,我们收到了社区反馈的很多有价值的issue和建议,非常感谢大家。

Expand Down
3 changes: 3 additions & 0 deletions changes/en-us/1.5.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,11 @@
### bugfix:
- [[#3686](https://github.com/seata/seata/pull/3686)] fix NPE and wrong cluster name of Apollo
- [[#3702](https://github.com/seata/seata/pull/3702)] fix some comments
- [[#3716](https://github.com/seata/seata/pull/3716)] fix the problem in the findTargetClass method
- [[#3717](https://github.com/seata/seata/pull/3717)] fix typo of interval



### optimize:
- [[#3678](https://github.com/seata/seata/pull/3678)] supplement missing configuration and new version documents
- [[#3654](https://github.com/seata/seata/pull/3654)] fix typo,applicationContex -> applicationContext
Expand Down Expand Up @@ -56,6 +58,7 @@
- [cmonkey](https://github.com/cmonkey)
- [selfishlover](https://github.com/selfishlover)
- [13414850431](https://github.com/13414850431)
- [ls9527](https://github.com/ls9527)
- [xingfudeshi](https://github.com/xingfudeshi)
- [wangliang181230](https://github.com/wangliang181230)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

import io.seata.common.util.CollectionUtils;
import io.seata.rm.tcc.remoting.parser.DubboUtil;
import org.springframework.aop.TargetSource;
import org.springframework.aop.framework.Advised;
import org.springframework.aop.framework.AdvisedSupport;
import org.springframework.aop.support.AopUtils;
Expand All @@ -48,8 +49,12 @@ public static Class<?> findTargetClass(Object proxy) throws Exception {
return null;
}
if (AopUtils.isAopProxy(proxy) && proxy instanceof Advised) {
Object targetObject = ((Advised) proxy).getTargetSource().getTarget();
return findTargetClass(targetObject);
// #issue 3709
final TargetSource targetSource = ((Advised) proxy).getTargetSource();
if (!targetSource.isStatic()) {
return targetSource.getTargetClass();
}
return findTargetClass(targetSource.getTarget());
}
return proxy.getClass();
}
Expand Down

0 comments on commit 965a48d

Please sign in to comment.