All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.sonar.l10n.java.rules.squid.S2333.html Maven / Gradle / Ivy

There is a newer version: 8.6.0.37351
Show newest version

The methods declared in an interface are public and abstract by default. Any variables are automatically public static final. There is no need to explicitly declare them so.

Since annotations are implicitly interfaces, the same holds true for them as well.

Similarly, the final modifier is redundant on any method of a final class.

Noncompliant Code Example

public interface Vehicle {

  public void go(int speed, Direction direction);  // Noncompliant

Compliant Solution

public interface Vehicle {

  void go(int speed, Direction direction);




© 2015 - 2025 Weber Informatics LLC | Privacy Policy