Method is not overriden by mistyping

Description:

To override method of base class in the derived class, method name and method profile (return type and types of argumnets) should match one of the overriden method. If you make mistake in method name or incorrectly specify parameter list, the method will not be overriden. So method of the derived class will never be called.

Sapient is able to check both cases. The message is produced if:

  1. there is method in derived class with the same name as some method in the base class, but their profiles are different and there is no other method in derived class matching this method of the base class.
  2. there is method in derived class with the same profile as method of the base class but which name is slightly different (length of editing sequence is less than some threshold)

This audit has two parameters: Minimum name length and Maximum number of differences. The first one specifies minimum length of name of method for which name matching algorithm is applied (althouth methods "f1" and "f2" differ only in one symbol, it will be strange to call these names similar). And parameter Maximum number of differences specifies maximum number of differences between names (removing/insertion of symbol).

Example:

class Base { 
    void someMethod();
    void anotherMethod(String str, int x);
};
class Derived extends Base { 
    void someMetod(); // mistyping in method name
    void anotherMethod(int x, String str); // profiles not matched
}