-
Notifications
You must be signed in to change notification settings - Fork 39
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
Multiple error #764
Multiple error #764
Conversation
### What's done: Added atomic counter
@@ -122,7 +123,9 @@ data class CommonConfiguration(private val configuration: Map<String, String>?) | |||
*/ | |||
val kotlinVersion: KotlinVersion by lazy { | |||
configuration?.get("kotlinVersion")?.kotlinVersion() ?: run { |
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.
Did you figure out why it was possible? Body of lazy should have been executed only once, even with parallel execution. Counter fixes this behavior, of course, but it's always better to find a root cause. Did you try to reproduce it in maven, for example?
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.
This was due to our List<RulesConfig>.getCommonConfiguration()
function. To fix, I can make an atomic counter (as already done) or make a lazy extension property.
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 suggest to use lazy extension property, I think using a function there was by mistake.
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.
Unfortunately, a lazy property requires storing state, and there is no way to add state to an existing object from an extension property.
Codecov Report
@@ Coverage Diff @@
## master #764 +/- ##
============================================
- Coverage 79.79% 79.78% -0.02%
- Complexity 2025 2032 +7
============================================
Files 97 97
Lines 5089 5090 +1
Branches 1626 1627 +1
============================================
Hits 4061 4061
- Misses 246 247 +1
Partials 782 782
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
### What's done: Simplified and fixed code according to new logic
What's done:
Added atomic counter
closes #751