| org.acm.seguin.pmd.AbstractRule org.acm.seguin.pmd.rules.ConstructorCallsOverridableMethodRule
ConstructorCallsOverridableMethodRule | final public class ConstructorCallsOverridableMethodRule extends org.acm.seguin.pmd.AbstractRule (Code) | | Searches through all methods and constructors called from constructors. It marks as dangerous any call to
overridable methods from non-private constructors. It marks as dangerous any calls to dangerous private constructors
from non-private constructors.
author: CL Gilbert (dnoyeb@users.sourceforge.net) |
visit | public Object visit(ASTCompilationUnit node, Object data)(Code) | | Work on each file independently.
Parameters: node - Description of Parameter Parameters: data - Description of Parameter Description of the Returned Value |
visit | public Object visit(ASTClassDeclaration node, Object data)(Code) | | This check must be evaluated independelty for each class. Inner classses get their own EvalPackage in order to
perform independent evaluation.
Parameters: node - Description of Parameter Parameters: data - Description of Parameter Description of the Returned Value |
visit | public Object visit(ASTNestedClassDeclaration node, Object data)(Code) | | Description of the Method
Parameters: node - Description of Parameter Parameters: data - Description of Parameter Description of the Returned Value |
visit | public Object visit(ASTInterfaceDeclaration node, Object data)(Code) | | Description of the Method
Parameters: node - Description of Parameter Parameters: data - Description of Parameter Description of the Returned Value |
visit | public Object visit(ASTConstructorDeclaration node, Object data)(Code) | | Non-private constructor's methods are added to a list for later safety evaluation. Non-private constructor's
calls on private constructors are added to a list for later safety evaluation. Private constructors are added to
a list so their safety to be called can be later evaluated. Note: We are not checking private constructor's calls
on non-private constructors because all non-private constructors will be evaluated for safety anyway. This means
we wont flag a private constructor as unsafe just because it calls an unsafe public constructor. We want to show
only 1 instance of an error, and this would be 2 instances of the same error.
Parameters: node - Description of Parameter Parameters: data - Description of Parameter Description of the Returned Value |
visit | public Object visit(ASTMethodDeclarator node, Object data)(Code) | | Create a MethodHolder to hold the method. Store the MethodHolder in the Map as the key Store each method called
by the current method as a List in the Map as the Object
Parameters: node - Description of Parameter Parameters: data - Description of Parameter Description of the Returned Value |
|
|