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

bugfix: fix RpcContext.addResource when resource is null #2490

Merged
merged 8 commits into from
Apr 8, 2020

Conversation

dk-lockdown
Copy link
Contributor

RpcContext.addResource(String resource),when resource is blank,should do nothing,instead of reset resourceSets

Ⅰ. Describe what this PR did

the original code is

public void addResource(String resource) {
        if (null == resource) {
            this.resourceSets = new HashSet<String>();
        }
        this.resourceSets.add(resource);
    }

obviously, there is a bug

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

…,should do nothing,instead of reset resourceSets
@codecov-io
Copy link

codecov-io commented Apr 1, 2020

Codecov Report

Merging #2490 into develop will decrease coverage by 0.03%.
The diff coverage is 60.00%.

Impacted file tree graph

@@              Coverage Diff              @@
##             develop    #2490      +/-   ##
=============================================
- Coverage      51.39%   51.36%   -0.04%     
  Complexity      2664     2664              
=============================================
  Files            529      529              
  Lines          16981    16983       +2     
  Branches        2050     2051       +1     
=============================================
- Hits            8728     8723       -5     
- Misses          7426     7432       +6     
- Partials         827      828       +1     
Impacted Files Coverage Δ Complexity Δ
...re/src/main/java/io/seata/core/rpc/RpcContext.java 40.54% <60.00%> (-3.91%) 21.00 <4.00> (ø)
...erver/storage/file/session/FileSessionManager.java 57.63% <0.00%> (-2.09%) 31.00% <0.00%> (-1.00%)

@l81893521 l81893521 added the first-time contributor first-time contributor label Apr 1, 2020
@jsbxyyx jsbxyyx changed the title fixbug:RpcContext.addResource(String resource),when resource is blank… bugfix:RpcContext.addResource(String resource),when resource is blank… Apr 1, 2020
@jsbxyyx
Copy link
Member

jsbxyyx commented Apr 1, 2020

please git relation github user.name and user.email

@slievrly slievrly changed the title bugfix:RpcContext.addResource(String resource),when resource is blank… bugfix: fix RpcContext.addResource when resource is null Apr 1, 2020
@slievrly
Copy link
Member

slievrly commented Apr 1, 2020

I made sure that this method is only used in UT.

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

@xingfudeshi xingfudeshi self-requested a review April 8, 2020 10:19
Copy link
Member

@xingfudeshi xingfudeshi left a comment

Choose a reason for hiding this comment

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

LGTM.

@xingfudeshi xingfudeshi merged commit eafbc8e into apache:develop Apr 8, 2020
@slievrly slievrly added this to the 1.2.0 milestone Apr 14, 2020
igit-cn referenced this pull request in igit-cn/seata Jun 17, 2020
bugfix: fix RpcContext.addResource when resource is null (seata#2490)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
first-time contributor first-time contributor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants