Class ReturnValueMethodOverrideCheck

All Implemented Interfaces:
ClassCheck

public class ReturnValueMethodOverrideCheck extends AbstractMethodOverrideCheck
Checks if the return value of overridden and overriding methods respects the inheritance rules.

Return value constraints of a method must not be weakened in subtypes. One must not mark a method return value for cascaded validation more than once in a line of a class hierarchy. In other words, overriding methods on subtypes (be it sub classes/interfaces or interface implementations) cannot mark the return value for cascaded validation if the return value has already been marked on the overridden method of the super type or interface.

Author:
Marko Bekhta, Guillaume Smet