rspec/rules/S1939/java/rule.adoc
Arseniy Zaostrovnykh 7ca29f686f Force linebreaks
2021-02-02 15:02:10 +01:00

39 lines
731 B
Plaintext

All classes extend ``++Object++`` implicitly. Doing so explicitly is redundant.
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 {
//...
}
----