Redundant import false-positive (imported package suffixing package name of the importing class)

SonarQube reports false positive redundant import issue when the package name of the imported class also happens to be suffxing package name of the importing class.

Products Used:

  • SonarQube 9.3 (build 51899)
  • Sonar Gradle Plugin 3.3
  • Kotlin 1.6.10

Sample code. Mind .feign ending to the package name of the MyLogger class matching feign package name of class being imported (feign.Logger)

package my.company.feign

import feign.Logger

class MyLogger : Logger() {

    override fun log(configKey: String, format: String, vararg args: Any) = Unit
}

Hi @tadjan,

Thanks for your report. I have confirmed the problem and created a ticket.

Cheers,
Sebastian

1 Like