Subclass that extends super class and implements interface inspector error - false negative
Issue #1162
resolved
public virtual class ICInspectorBase {
public virtual String getFoo() {return '';}
interface IICInspector {
String getFoo();
}
public class IcInspectorSubClass extends ICInspectorBase implements IICINspector {
}
}
This simple example is valid APEX as the subclass need not implement the interface methods if its super class has such implementation.
Comments (4)
-
repo owner -
repo owner Well, I take that back. I verified the corresponding behavior in Java and it does not mark the indirect implementation of the interface method. The gutters look the same in Java and Apex. So this is an inspection bug. Either way I'll get a fix together...fun, fun...
-
repo owner Fix submitted for inclusion in the next build.
-
repo owner - changed status to resolved
Fix delivered in 2.0.4.1.
- Log in to comment
Ah, this is interesting...very easy to reproduce, and the root cause issue is in the screenshot you provided. Notice that the interface method declaration of
getFoo()
doesn't have a gutter icon showing that it's properly implemented (albeit indirectly) inIcInspectorSubClass
via the implementation provided byICInspectorBase
. The bug here isn't with the code inspection but rather with the core code that wires together inheritance relationships. I guess this indirection is a corner case that it's not handling properly. Thanks for reporting! I'll get it all working properly...