-
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
feature: TCC adapter for Dubbo And Sofa reference annotation #2616
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #2616 +/- ##
=============================================
- Coverage 50.14% 50.02% -0.12%
Complexity 2952 2952
=============================================
Files 591 592 +1
Lines 18954 18998 +44
Branches 2285 2290 +5
=============================================
Hits 9504 9504
- Misses 8505 8549 +44
Partials 945 945
|
a65bcd9
to
a75e8dd
Compare
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
} | ||
|
||
ReflectionUtils.doWithFields(bean.getClass(), field -> { | ||
Annotation reference = field.getAnnotation(annotation); |
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.
if necessary? FieldFilter check the filed contains annotation.
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 code impossible to reuse.
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.
What I mean is that reference can never null, field.isAnnotationPresent(annotation)
return; | ||
} | ||
|
||
addTccAdvise(bean, beanName, field, field.getType()); |
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.
why not getInterface()?
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.
Previously, it was implemented with dubbo and sofa interface, but there were many repetitions. In fact, it's the only one that's different. There's no need to use an interface
`static {
ANNOTATIONS.add(loadAnnotation("org.apache.dubbo.config.annotation.Reference"));
ANNOTATIONS.add(loadAnnotation("com.alipay.sofa.runtime.api.annotation.SofaReference"));
ANNOTATIONS.add(loadAnnotation( ...
}`
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
Ⅰ. Describe what this PR did
Support Dubbo @reference and sofa @SofaReference annotation for TCC mode
Ⅱ. Does this pull request fix one issue?
Ⅲ. Why don't you add test cases (unit test/integration test)?
Ⅳ. Describe how to verify it
Ⅴ. Special notes for reviews