Meta-annotations not effective (@SuppressWarnings("...") alias)

Hi community,

I have declared a meta annotation as:

/**
* We prefer java.util.logging as it is good enough part of Java platform.
* <p>
* So far, it has not been hampered by security scandals as other third party loggers.
* <p>
* Sonar analysis seems weak producing false issues as it cannot reliably detect which logging
* framework is use and what are its capabilities, namely the error prone substitutions/expansions.
*
* @seealso https://codeq.alm.eurofins.com/coding_rules?open=java%3AS2629&rule_key=java%3AS2629
*/
@SuppressWarnings("squid:S2629")
@Retention(RetentionPolicy.SOURCE)
@Target({ METHOD })
public @interface SimpleJUL {
// declarative
}

It is used as:

@SimpleJUL
void foo() {
  log.warning(this + ": example");
}

But it’s not effective.

Enterprise Edition v2025.1 reports it as an issue unless inlined as:

@SuppressWarnings("squid:S2629")
void foo()

Any clue how to make sonarq recognize the meta-annotation, please?

Hello @petrk , thanks for sharing with the community.

After an internal investigation I see that SonarQube Java analyzer code is checking ONLY for the SuppressWarnings exact type (with its FQN ), as you can see here :

I have created this Jira issue in order to implement this feature

Thanks for the value you shared @petrk