use of net.sourceforge.pmd.lang.apex.ast.ASTLiteralExpression in project pmd by pmd.
the class ApexXSSFromEscapeFalseRule method validateBooleanParameter.
private void validateBooleanParameter(ASTMethodCallExpression methodCall, Object data) {
int numberOfChildren = methodCall.jjtGetNumChildren();
if (numberOfChildren == 3) {
// addError('',false)
Object potentialLiteral = methodCall.jjtGetChild(2);
if (potentialLiteral instanceof ASTLiteralExpression) {
ASTLiteralExpression parameter = (ASTLiteralExpression) potentialLiteral;
Object o = parameter.getNode().getLiteral();
if (o instanceof Boolean) {
Boolean paramValue = (Boolean) o;
if (paramValue.equals(Boolean.FALSE)) {
validateLiteralPresence(methodCall, data);
}
}
}
}
}
Aggregations