-
Notifications
You must be signed in to change notification settings - Fork 8.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bugfix: fix incorrect getAnnotation about class and method #2617
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #2617 +/- ##
=============================================
- Coverage 50.92% 50.77% -0.15%
+ Complexity 2817 2816 -1
=============================================
Files 558 558
Lines 17941 17944 +3
Branches 2129 2101 -28
=============================================
- Hits 9136 9111 -25
- Misses 7938 7939 +1
- Partials 867 894 +27 |
add test case |
ok |
spring/src/main/java/io/seata/spring/annotation/GlobalTransactionalInterceptor.java
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@zjinlei PTAL |
@@ -37,6 +36,8 @@ | |||
private static Class<?> targetClass = null; | |||
private static GlobalTransactional transactional = null; | |||
|
|||
private static final GlobalTransactionalInterceptor globalTransactionalInterceptor=new GlobalTransactionalInterceptor(null); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The global variable declare in testGetAnnotation method?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The global variable declare in testGetAnnotation method?
PTAL @jsbxyyx
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
toString,hashcode these methods also take distributed transactions? |
测试了一下,注解加在类上、方法上、类及方法上混用、嵌套调用都没问题 |
PTAL @slievrly |
add hashCode and equals ... test case? |
Codecov Report
@@ Coverage Diff @@
## develop #2617 +/- ##
=============================================
+ Coverage 50.95% 51.05% +0.10%
- Complexity 2830 2836 +6
=============================================
Files 563 563
Lines 18043 18047 +4
Branches 2136 2138 +2
=============================================
+ Hits 9193 9214 +21
+ Misses 7980 7951 -29
- Partials 870 882 +12
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Ⅰ. Describe what this PR did
bug fix for getAnnotation
1.类上有注解,方法无 可正常运行
2.方法有注解,类上无 可正常运行
3.类上方法上都有,优先读取方法上注解 可正常运行
4.基类方法调用时,排除基类调用 可正常运行
5.类重写基类方法,比如toString后,重写的方法属于本类方法,因此会开启全局事务.
Ⅱ. Does this pull request fix one issue?
fix #2562
Ⅲ. Why don't you add test cases (unit test/integration test)?
Ⅳ. Describe how to verify it
Ⅴ. Special notes for reviews