Class SuperCloneCheck

  • All Implemented Interfaces:
    Configurable, Contextualizable

    public class SuperCloneCheck
    extends AbstractSuperCheck

    Checks that an overriding clone() method invokes super.clone(). Does not check native methods, as they have no possible java defined implementation.

    Reference: Object.clone().

    To configure the check:

     <module name="SuperClone"/>
     
    Since:
    3.2
    • Constructor Detail

      • SuperCloneCheck

        public SuperCloneCheck()
    • Method Detail

      • getMethodName

        protected java.lang.String getMethodName()
        Description copied from class: AbstractSuperCheck
        Returns the name of the overriding method.
        Specified by:
        getMethodName in class AbstractSuperCheck
        Returns:
        the name of the overriding method.