-
-
Notifications
You must be signed in to change notification settings - Fork 777
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
Workaround for JDK 8 instability when reading config #4225
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.
|
* 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() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've updated the PR.
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
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.