detekt / sonar-detekt

SonarQube plugin for Kotlin
https://detekt.dev
GNU Lesser General Public License v3.0
493 stars 52 forks source link

Fixes Wrong offset error (IndexOutOfBoundsException) #108

Closed jvilya closed 4 years ago

jvilya commented 4 years ago

I'm getting java.lang.IndexOutOfBoundsException: Wrong offset: x. Should be in range: [0, y] in several files.

The latest version (1.3.0) doesn't help in my case. The exception was throwing one line later at positions(psi)

This PR fixes it (and should help in https://github.com/detekt/sonar-kotlin/issues/106)

I'll post a separate issue or PR with details related to the source of the exception later.