[kotlin:S1144] kotlin.Suppress Annotation does not act the same as java.lang.SuppressWarnings

We have a method that has a resilience4j Retry annotation. Resilience4j retry uses a string reference to the name of a method to use as a fallback. This runtime-only reference means that the fallback method is detected as unused at compile time. We can suppress this with an @Suppress annotation from kotlin.Suppress, but it only suppresses the Sonar warning S1144 if we instead use java.lang.SuppressWarnings. This would seem to be an oversight and that the kotlin version @Suppress annotation should work the same as java.lang.SuppressWarnings.

2 Likes

Hi @TiKevin83,

I can’t reproduce your problem, so can you please send me one?
From the code, I see we support kotlin.Suppress and java.lang.SuppressWarnings the same way.

All the best,

Irina

Could you also let us know what versions of what products you’re using (SonarQube, SonarCloud, SonarLint…)