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

#1306 fix non-thread-safe usages of CopyOnWriteMap #1381

Merged
merged 1 commit into from
Oct 16, 2024

Conversation

asolntsev
Copy link
Collaborator

Instead of two-three separate calls like containsKey, get and put, now we use a single computeIfAbsent.

P.S. I would like to also deny method CopyOnWriteMap.put(), but it's still used in one place (that was harder to refactor).

Instead of two-three separate calls like `containsKey`, `get` and `put`, now we use a single `computeIfAbsent`.

P.S. I would like to also deny method `CopyOnWriteMap.put()`, but it's still used in one place (that was harder to refactor).
@asolntsev asolntsev linked an issue Oct 16, 2024 that may be closed by this pull request
Copy link

codecov bot commented Oct 16, 2024

Codecov Report

Attention: Patch coverage is 91.66667% with 11 lines in your changes missing coverage. Please review.

Project coverage is 92.31%. Comparing base (a845854) to head (2b036b9).
Report is 5 commits behind head on main.

Files with missing lines Patch % Lines
.../java/net/datafaker/service/FakeValuesService.java 92.36% 4 Missing and 6 partials ⚠️
.../net/datafaker/internal/helper/CopyOnWriteMap.java 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #1381      +/-   ##
============================================
- Coverage     92.40%   92.31%   -0.10%     
- Complexity     3148     3150       +2     
============================================
  Files           319      319              
  Lines          6178     6144      -34     
  Branches        604      592      -12     
============================================
- Hits           5709     5672      -37     
- Misses          325      329       +4     
+ Partials        144      143       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator

@kingthorin kingthorin left a comment

Choose a reason for hiding this comment

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

This looks good to me, thanks for digging into the problem.

@asolntsev asolntsev merged commit 0e1e60a into main Oct 16, 2024
10 of 12 checks passed
@asolntsev asolntsev deleted the fix/1306-flaky-bug branch October 16, 2024 20:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unable to resolve expression during build
2 participants