I use the plugin for an Android project. If in a Kotlin class there is a lambda like:
let{}
filter{}
forEach{}
firstOrNull{}
then the plugin report contains 1 more line for this class and sonarqube returns an error like:
Cannot import coverage information for file 'android-project/project/src/main/java/de/example/android/plugin/myProject/productlist/filter/adapter/FilterGroupAdapter.kt', coverage data is invalid. Error: {}
java.lang.IllegalStateException: Line 83 is out of range in the file android-project/project/src/main/java/de/example/android/plugin/myProject/productlist/filter/adapter/FilterGroupAdapter.kt (lines: 82)
at org.sonar.api.utils.Preconditions.checkState(Preconditions.java:61)
at org.sonar.api.batch.sensor.coverage.internal.DefaultCoverage.validateLine(DefaultCoverage.java:93)
at org.sonar.api.batch.sensor.coverage.internal.DefaultCoverage.conditions(DefaultCoverage.java:107)
at org.sonar.plugins.jacoco.ReportImporter.importCoverage(ReportImporter.java:41)
at org.sonar.plugins.jacoco.JacocoSensor.importReport(JacocoSensor.java:79)
at org.sonar.plugins.jacoco.JacocoSensor.importReports(JacocoSensor.java:62)
at org.sonar.plugins.jacoco.JacocoSensor.execute(JacocoSensor.java:47)
I use the plugin for an Android project. If in a Kotlin class there is a lambda like:
then the plugin report contains 1 more line for this class and sonarqube returns an error like:
when I remove lambda - the error is gone