Diktat crashes when lambda expression only contains a comment.
See original GitHub issueDescribe the bug
Diktat does not correctly handle lambda expressions that only contain a comment.
Expected behavior
This code:
var list = listOf("a", "b", "c")
list.forEach { /* test */ }
should result in the following error:
[EMPTY_BLOCK_STRUCTURE_ERROR] incorrect format of empty block: empty blocks are forbidden unless it is function with override keyword (cannot be auto-corrected)
Observed behavior
Gradle gives the following error:
java.lang.Error: Internal error in diktat application
Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make field private transient java.lang.Object java.lang.Throwable.backtrace accessible: module java.base does not "opens java.lang" to unnamed module @647c3190
Steps to Reproduce
- Create a new Kotlin project
- Add the following code:
fun main() {
var list = listOf("a", "b", "c")
list.forEach { /* test */ }
}
- Run diktat
Environment information
- diktat version: 0.43.0 (gradle plugin version 1.0.1)
- build tool (maven/gradle): gradle
- how is diktat run (CLI, plugin, etc.): Command line “./gradlew diktatCheck”
- kotlin version: 1.6.10
- operating system: macOS Monterey version 12.1
- link to a project (if your project is public):
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Diktat not working on new MAC M1 processors with JDK17 · Issue ...
Please make an issue on this bug at https://github.com/cqfn/diKTat/. ... Diktat crashes when lambda expression only contains a comment. #1169.
Read more >Lint crashes when using lambda expressions with retrolambda
One of the comments in the issue mentions that lint never actually worked with retrolambda but rather, with the newest lint version, is...
Read more >Beyond Exception Handling with Control Flow Mechanisms
From this behavior, we can induce that this lambda function has access to a certain implicit state. Where the lexical variable x has...
Read more >The Serverless Revolution Has Stalled | Hacker News
I view the serverless, specifically aws lambda, as nice way to hook into the aws system and add some code to handle certain...
Read more >It is painful to see that a large portion of our industry hasn't ...
I think a lot of the blame has to lie with tutorial and reference websites that inexplicably get great search rankings but have...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@JamesBundgard I had mostly the same issue, but it looks that we need to wait for some updates from JB
@akuleshov7 I’ve also had a lot of issues getting docker running