Class FinalParametersCheck

  • All Implemented Interfaces:
    Configurable, Contextualizable

    public class FinalParametersCheck
    extends AbstractCheck
    Check that method/constructor/catch/foreach parameters are final. The user can set the token set to METHOD_DEF, CONSTRUCTOR_DEF, LITERAL_CATCH, FOR_EACH_CLAUSE or any combination of these token types, to control the scope of this check. Default scope is both METHOD_DEF and CONSTRUCTOR_DEF.

    Check has an option ignorePrimitiveTypes which allows ignoring lack of final modifier at primitive data type parameter. Default value false.

    E.g.:

    private void foo(int x) { ... } //parameter is of primitive type

    Author:
    lkuehne, o_sukhodolsky, Michael Studman, Aleksey Nesterenko