PB.IMO
Make sure the intended method is overridden
Description
This rule checks for possible typos that may have occurred when overriding methods were written.
Example
package PB;
public class IMO {
protected void finallize () // typo; should be "finalize"
throws Throwable
{
// important cleanup code
}
}
Repair
Fix the typo, or suppress the error message. If the overriding method is spelled incorrectly, it will not be called; the method from the superclass will be called instead.
In the example above, the "important cleanup code" will never be executed.
|