Skip to content
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

Merged
merged 2 commits into from
Jun 30, 2020

Conversation

q294881866
Copy link
Contributor

Ⅰ. 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

@zjinlei zjinlei added this to the 1.3.0 milestone May 1, 2020
@l81893521 l81893521 added the module/spring spring module label May 20, 2020
@codecov-commenter
Copy link

codecov-commenter commented Jun 1, 2020

Codecov Report

Merging #2616 into develop will decrease coverage by 0.11%.
The diff coverage is 0.00%.

Impacted file tree graph

@@              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              
Impacted Files Coverage Δ Complexity Δ
...va/io/seata/spring/tcc/TccAnnotationProcessor.java 0.00% <0.00%> (ø) 0.00 <0.00> (?)
.../java/io/seata/spring/util/TCCBeanParserUtils.java 40.42% <0.00%> (-4.82%) 8.00 <0.00> (ø)

Copy link
Member

@slievrly slievrly left a 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);
Copy link
Member

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.

Copy link
Contributor Author

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.

Copy link
Member

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());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not getInterface()?

Copy link
Contributor Author

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( ...
}`

Copy link
Contributor

@long187 long187 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@funky-eyes funky-eyes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@slievrly slievrly changed the title feature: A tcc adapter for Dubbo And Sofa reference annotation feature: TCC adapter for Dubbo And Sofa reference annotation Jun 30, 2020
@slievrly slievrly merged commit ab07a1f into apache:develop Jun 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module/spring spring module
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants