# Remove Inherited Interfaces from Class Declaration
# Description
This rule removes interfaces from class declaration, which are already implemented by a super class. These interfaces are inherited from the super class.
# Benefits
Removing redundant syntax improves readability.
# Tags
# Code Changes
Pre
class Child extends Parent implements Observer {
@Override
public void update(Observable o, Object arg) {
// do nothing
}
}
class Parent implements Observer {
@Override
public void update(Observable o, Object arg) {
// do nothing
}
}
Post
class Child extends Parent {
@Override
public void update(Observable o, Object arg) {
// do nothing
}
}
class Parent implements Observer {
@Override
public void update(Observable o, Object arg) {
// do nothing
}
}
You Want To Have Those Changes Done Automatically?
The automatic application of this rule is supported in the following jSparrow version:
# Properties
Property | Value |
---|---|
Rule ID | ReImplementingInterface |
First seen in jSparrow version | 2.2.0 |
Minimum Java version | 1 |
Remediation cost | 2 min |
Links |