MartinX3
(Martin)
April 16, 2024, 4:37pm
1
Environment:
Java: JetBrains s.r.o. 17.0.10
OS: Linux amd64
IDE: IntelliJ IDEA 2024.1
SonarLint: 10.4.2.78113
The following code gives the wrong S6518 warning Replace function call with indexed accessor.
:
yaml.yamlMap.get<YamlMap>("info")?.getScalar("title")?.content ?: error("info.title not specified")
Or is there a way to provide a type with yaml.yamlMap["info"]
in kotlin?
I’m using the com. charleskorn. kaml
package.
Hello @MartinX3 , and welcome to the Sonar Community.
Thank you for pointing out this false positive; there is room for improving the rule! You can track the progress on its resolution at [SONARKT-386] - Jira .
Cheers,
Angelo
MartinX3
(Martin)
April 24, 2024, 11:02am
6
Thank you!
I made an account there but I have no clue where to enable the notifications for this bug entry.
system
(system)
Closed
May 3, 2024, 8:01am
9
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.