-
-
Notifications
You must be signed in to change notification settings - Fork 798
EndOfSentenceFormat - Fix #3893 by only calling super.visit once #3904
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
EndOfSentenceFormat - Fix #3893 by only calling super.visit once #3904
Conversation
In #3660 the EndOfSentenceFormat rule got refactored. The rule is called by the MultiRule 'KDocStyle'. Both the called and calling visitor function execute a super.visit(). This can cause problems. Hence, super.visit only called once with the changes made. Suspicion: Multiple KtDeclaration super.visit calls cause the crash in #3893.
Codecov Report
@@ Coverage Diff @@
## main #3904 +/- ##
============================================
+ Coverage 83.55% 83.58% +0.03%
- Complexity 3118 3122 +4
============================================
Files 456 456
Lines 8973 9012 +39
Branches 1746 1756 +10
============================================
+ Hits 7497 7533 +36
Misses 564 564
- Partials 912 915 +3
Continue to review full report at Codecov.
|
...n/src/test/kotlin/io/gitlab/arturbosch/detekt/rules/documentation/EndOfSentenceFormatSpec.kt
Show resolved
Hide resolved
deprecatedBlockTag.visitDeclaration(dcl) | ||
endOfSentenceFormat.visitDeclaration(dcl) |
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.
Does deprecatedBlockTag
and endOfSentenceFormat
each invokes super.visitDeclaration(dcl)
, thus in total calling twice?
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.
Each rule calls its own super visit method. Before that, each rule called its own super visit method as well as the calling KDocStyle
multi-rule.
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 assume that before this PR, KDocStyle.visitDeclaration()
is called but DeprecatedBlockTag.visitDeclaration
is not invoked at runtime.
Are we ok merging this? |
In #3660 the EndOfSentenceFormat rule got refactored.
The rule is called by the MultiRule 'KDocStyle'.
Both the called and calling visitor function execute a super.visit().
This can cause problems.
Hence, super.visit only called once with the changes made.
Suspicion:
Multiple KtDeclaration super.visit calls cause the crash in #3893.