[Suggestion]Let rule S2333 detect redundant modifiers of interface is recommended

Affects Sonarqube Version:
Sonarqube version: 8.1.0.31237
sonar-scanner version: 4.2.0.1873-windows

Rule:
S2333: Redundant modifiers should not be used

Description:
It is recommended add modifiers checking in the case of interface which is defined in a interface or a class, where public and static modifiers can be ignored.

Code Sample demonstrating the issue:

public interface Foo {
    public static interface Baz {}  // public, static ignored
}
public class Bar {
    public static interface Baz {}  // static ignored
}

Expected outcome:
Suggestion

Running Sonarqube through:
command line

Hello @wongwuchiu,

Thanks for the proposition, and sorry for the late reaction.

This improvement makes sense to me, I created a ticket for it: SONARJAVA-3525.

Best,
Quentin

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.