Skip to content
Snippets Groups Projects
Unverified Commit b503ce6e authored by RainGan's avatar RainGan Committed by GitHub
Browse files

optimize: remove useless if judgments. (#3505)

parent 5a09c255
No related branches found
No related tags found
No related merge requests found
......@@ -67,6 +67,7 @@ Seata 是一款开源的分布式事务解决方案,提供高性能和简单
- [[#3466](https://github.com/seata/seata/pull/3466)] 优化ExecuteTemplateXA类中判断XA不是最终状态的比较方式
- [[#3476](https://github.com/seata/seata/pull/3476)] 服务端参数传入hostname时将自动转换为ip
- [[#3485](https://github.com/seata/seata/pull/3485)] 优化 ConfigurationFactory 中无用的try/catch
- [[#3505](https://github.com/seata/seata/pull/3505)] 优化GlobalTransactionScanner类中无用的if判断
### test
......@@ -94,6 +95,7 @@ Seata 是一款开源的分布式事务解决方案,提供高性能和简单
- [litianyu1992](https://github.com/litianyu1992)
- [xyz327](https://github.com/xyz327)
- [13414850431](https://github.com/13414850431)
- [github-ganyu](https://github.com/github-ganyu)
......
......@@ -66,6 +66,9 @@
- [[#3466](https://github.com/seata/seata/pull/3466)] optimize the comparison in the ExecuteTemplateXa class to determine that XA is not the final state
- [[#3476](https://github.com/seata/seata/pull/3476)] convert hostname to IP if necessary
- [[#3485](https://github.com/seata/seata/pull/3485)] optimize useless codes in ConfigurationFactory
- [[#3505](https://github.com/seata/seata/pull/3505)] optimize useless if judgments in the GlobalTransactionScanner class
### test
......@@ -94,6 +97,7 @@
- [litianyu1992](https://github.com/litianyu1992)
- [xyz327](https://github.com/xyz327)
- [13414850431](https://github.com/13414850431)
- [github-ganyu](https://github.com/github-ganyu)
Also, we receive many valuable issues, questions and advices from our community. Thanks for you all.
......
......@@ -229,7 +229,7 @@ public class GlobalTransactionScanner extends AbstractAutoProxyCreator
* GlobalLock:
* @see io.seata.spring.annotation.GlobalLock // GlobalLock annotation
* Corresponding interceptor:
* @see io.seata.spring.annotation.GlobalTransactionalInterceptor#handleGlobalLock(MethodInvocation) // GlobalLock handler
* @see io.seata.spring.annotation.GlobalTransactionalInterceptor#handleGlobalLock(MethodInvocation, GlobalLock) // GlobalLock handler
*
* TCC mode:
* @see io.seata.rm.tcc.api.LocalTCC // TCC annotation on interface
......@@ -261,15 +261,13 @@ public class GlobalTransactionScanner extends AbstractAutoProxyCreator
return bean;
}
if (interceptor == null) {
if (globalTransactionalInterceptor == null) {
globalTransactionalInterceptor = new GlobalTransactionalInterceptor(failureHandlerHook);
ConfigurationCache.addConfigListener(
ConfigurationKeys.DISABLE_GLOBAL_TRANSACTION,
(ConfigurationChangeListener)globalTransactionalInterceptor);
}
interceptor = globalTransactionalInterceptor;
if (globalTransactionalInterceptor == null) {
globalTransactionalInterceptor = new GlobalTransactionalInterceptor(failureHandlerHook);
ConfigurationCache.addConfigListener(
ConfigurationKeys.DISABLE_GLOBAL_TRANSACTION,
(ConfigurationChangeListener)globalTransactionalInterceptor);
}
interceptor = globalTransactionalInterceptor;
}
LOGGER.info("Bean[{}] with name [{}] would use interceptor [{}]", bean.getClass().getName(), beanName, interceptor.getClass().getName());
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment