Why could this construct generate an error/warning in Eclipse? I understand for what it will generate a report, but I guess there must be some rationale, what can go wrong, if you spell out those redundant super interfaces.
Example:
interface I1{
void boo();
}
class A implements I1 {
public void boo() {}
}
class B extends A implements I1 {
public void boo() {}
}
The warning is in B, near implements I1.
Imaging if class A implement I1 and class B extends A. By default B implements I1 even though it does not need to implement any method in I1. If A were to change to implement I2, B would still compile.
However, if B explicitly implements I1 but does not provide the methods, then this change would cause B to no longer compile.
Of course, I am ignoring the issues of users of B that might be assuming that B implements I1. Let's assume for this case that that is not an issue.
It's only a warning, and I guess it has two reasons:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With