Skip to content

Fix IgnoredReturnValue rule crash in parallel mode#5724

Merged
schalkms merged 2 commits into
mainfrom
fix2-#5403
Jan 27, 2023
Merged

Fix IgnoredReturnValue rule crash in parallel mode#5724
schalkms merged 2 commits into
mainfrom
fix2-#5403

Conversation

@schalkms

Copy link
Copy Markdown
Member

part 2 of #5403:

IgnoredReturnValue crashes due to the usage of a non-thread-safe collection operation. The usage of Iterable<T>.plus() causes this problem. The crash in parallel mode is fixed by iterating over each collection by itself.

See here for more details in detekt v1.21:

(annotations + resultingDescriptor.containingDeclaration.annotations).none { it in returnValueAnnotations }

Closes #5403

part 2 of #5403:

IgnoredReturnValue crashes due to the usage of a non-thread-safe collection operation.
The usage of `Iterable<T>.plus()` causes this problem.
The crash in parallel mode is fixed by iterating over each collection by itself.

See here for more details in detekt v1.21:
https://github.com/detekt/detekt/blob/32f6e22d9524804ebbb51d31e53cd28a84864ed6/detekt-rules-errorprone/src/main/kotlin/io/gitlab/arturbosch/detekt/rules/bugs/IgnoredReturnValue.kt#L90

Closes #5403
@codecov

codecov Bot commented Jan 25, 2023

Copy link
Copy Markdown

Codecov Report

Merging #5724 (65742d8) into main (ecb97fa) will decrease coverage by 0.01%.
The diff coverage is 66.66%.

@@             Coverage Diff              @@
##               main    #5724      +/-   ##
============================================
- Coverage     84.46%   84.46%   -0.01%     
  Complexity     3736     3736              
============================================
  Files           543      543              
  Lines         12716    12718       +2     
  Branches       2223     2224       +1     
============================================
+ Hits          10741    10742       +1     
  Misses          865      865              
- Partials       1110     1111       +1     
Impacted Files Coverage Δ
...arturbosch/detekt/rules/bugs/IgnoredReturnValue.kt 89.09% <66.66%> (-1.48%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@schalkms schalkms added this to the 1.23.0 milestone Jan 27, 2023
@schalkms schalkms merged commit 8458c2d into main Jan 27, 2023
@schalkms schalkms deleted the fix2-#5403 branch January 27, 2023 20:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

IgnoredReturnValue randomly crashes

3 participants