|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sourceforge.pmd.CommonAbstractRule
net.sourceforge.pmd.AbstractJavaRule
net.sourceforge.pmd.AbstractRule
net.sourceforge.pmd.rules.sunsecure.AbstractSunSecureRule
public abstract class AbstractSunSecureRule
Utility methods for the package
Field Summary |
---|
Fields inherited from interface net.sourceforge.pmd.Rule |
---|
LOWEST_PRIORITY, PRIORITIES |
Constructor Summary | |
---|---|
AbstractSunSecureRule()
|
Method Summary | |
---|---|
protected java.lang.String |
getFirstNameImage(SimpleNode n)
Gets the image of the first ASTName node found by SimpleNode.getFirstChildOfType(Class) |
protected java.lang.String |
getReturnedVariableName(ASTReturnStatement ret)
Gets the name of the variable returned. |
protected boolean |
isField(java.lang.String varName,
ASTTypeDeclaration typeDeclaration)
Tells if the type declaration has a field with varName. |
protected boolean |
isLocalVariable(java.lang.String vn,
SimpleNode node)
TODO modify usages to use symbol table Tells if the variable name is a local variable declared in the method. |
Methods inherited from class net.sourceforge.pmd.AbstractJavaRule |
---|
addViolation, addViolation, addViolation, addViolationWithMessage, apply, getDeclaringType, importsPackage, isQualifiedName, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visitAll |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AbstractSunSecureRule()
Method Detail |
---|
protected final boolean isField(java.lang.String varName, ASTTypeDeclaration typeDeclaration)
varName
- the name of the field to searchtypeDeclaration
- the type declaration
true
if there is a field in the type declaration named varName, false
in other caseprotected final java.lang.String getReturnedVariableName(ASTReturnStatement ret)
ret
- a return statement to evaluate
null
if it cannot be detectedprotected boolean isLocalVariable(java.lang.String vn, SimpleNode node)
vn
- the variable namenode
- the ASTMethodDeclaration where the local variable name will be searched
true
if the method declaration contains any local variable named vn and false
in other caseprotected java.lang.String getFirstNameImage(SimpleNode n)
SimpleNode.getFirstChildOfType(Class)
n
- the node to search
null
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |