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

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

The newest version!

All classes extend Object implicitly. Doing so explicitly is redundant, and redundant declarations needlessly clutter the code and can be confusing.

Further, declaring the implementation of an interface and one if its parents is also redundant. If you implement the interface, you also implicitly implement its parents and there's no need to do so explicitly.

Noncompliant Code Example

public interface MyFace {
  // ...
}

public interface MyOtherFace extends MyFace {
  // ...
}

public class Foo
    extends Object // Noncompliant
    implements MyFace, MyOtherFace {  // Noncompliant
  //...
}

Compliant Solution

public interface MyFace {
  // ...
}

public interface MyOtherFace extends MyFace {
  // ...
}

public class Foo implements MyOtherFace {
  //...
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy