Sonarqube 10.4 seems to ignore @SuppressWarnings annotations

Environment:

  • SonarLint: * 10.4.87286

After upgrading SQ to 10.4 all of a sudden I’ve got 10 new issues. After examining them seems like SQ stopped accepting @SuppressWarnings annotations. Example code, that is issue.

@SuppressWarnings("java:S1118") // Spring nuance
@Configuration
public class BuildMetadataConfig {
  @Bean
  public static PropertySourcesPlaceholderConfigurer placeholderConfigurer() {
    PropertySourcesPlaceholderConfigurer propsConfig = new PropertySourcesPlaceholderConfigurer();
    propsConfig.setLocations(
        new ClassPathResource("git.properties"),
        new ClassPathResource("META-INF/build-info.properties"));
    propsConfig.setIgnoreResourceNotFound(true);
    propsConfig.setIgnoreUnresolvablePlaceholders(true);
    return propsConfig;
  }
}

Hey there.

It seems like you’re facing this bug: SONAR-21575

You can disable analyzer optimization here while waiting for a fix (expected in SonarQube 10.5)

Hello and thanks for reply, however “Analyzers loading optimization” was already disabled in my case.
Setting property("sonar.plugins.downloadOnlyRequired", "false") help though, thanks for hint.