Remove Inherited Interfaces from Class Declaration

Properties

Property Value
First seen in jSparrow version 2.2.0
Minimum Java version 1
Remediation cost 2 min
Links FindBugs:RedundantInterface

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.

Requirement & Tags

Requirements

None

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
	}
}