Workaround for JDK 8 instability when reading config#4225
Merged
Conversation
Codecov Report
@@ Coverage Diff @@
## main #4225 +/- ##
============================================
- Coverage 84.32% 84.32% -0.01%
Complexity 3240 3240
============================================
Files 468 468
Lines 10163 10167 +4
Branches 1777 1778 +1
============================================
+ Hits 8570 8573 +3
Misses 658 658
- Partials 935 936 +1
Continue to review full report at Codecov.
|
BraisGabin
reviewed
Nov 2, 2021
| * Detekt in the same VM can fail spuriously. A similar bug is referenced in | ||
| * https://github.com/detekt/detekt/issues/3396. The performance regression is likely unnoticeable. | ||
| */ | ||
| .apply { useCaches = true }.getInputStream().reader() |
Member
There was a problem hiding this comment.
Shoudln't this be useCaches = false then? And, if this is a JDK issue, could we do only for JDK8?
And this is probably another reason to deprecate JDK8 #4130
Contributor
There was a problem hiding this comment.
Doh! It's a remnant from trying to set up a test case but failing.
As for JDK8 only, it could be worth adding the condition, so it is detected and removed while removing support for JDK8.
If Detekt is being executed in parallel in the same VM but through different class loader instances, the configuration file is sometimes not readable as a class loader might have closed the zip stream. By telling the JVM to not use cached files readers, the stability improves.
1223778 to
ef610e4
Compare
BraisGabin
approved these changes
Nov 2, 2021
cortinico
approved these changes
Nov 2, 2021
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
If Detekt is being executed in parallel in the same VM
but through different class loader instances, the configuration file
is sometimes not readable as a class loader might have closed
the zip stream. By telling the JVM to not use cached files readers,
the stability improves.