Fixed styling errors during build

This commit is contained in:
Joshua Arquilevich
2020-02-28 14:21:41 -08:00
parent 6efc10eb4c
commit 57279e11db
2 changed files with 7 additions and 9 deletions

View File

@ -337,8 +337,8 @@ public class ApexCRUDViolationRule extends AbstractApexRule {
return false;
}
private boolean isWithSecurityEnforced(final AbstractApexNode<?> node){
if(node instanceof ASTSoqlExpression){
private boolean isWithSecurityEnforced(final AbstractApexNode<?> node) {
if (node instanceof ASTSoqlExpression) {
String pattern = "(?i).*[^']\\s*WITH SECURITY_ENFORCED\\s*[^']*";
String query = ((ASTSoqlExpression) node).getQuery();
return query.matches(pattern);
@ -513,11 +513,11 @@ public class ApexCRUDViolationRule extends AbstractApexRule {
private void validateCRUDCheckPresent(final AbstractApexNode<?> node, final Object data, final String crudMethod,
final String typeCheck) {
if (!typeToDMLOperationMapping.containsKey(typeCheck)) {
if (!isProperESAPICheckForDML(typeCheck, crudMethod)) {
if(!isWithSecurityEnforced(node)) {
addViolation(data, node);
}
if (!typeToDMLOperationMapping.containsKey(typeCheck)) {
if (!isProperESAPICheckForDML(typeCheck, crudMethod)) {
if (!isWithSecurityEnforced(node)) {
addViolation(data, node);
}
}
} else {
boolean properChecksHappened = false;

View File

@ -4,9 +4,7 @@
package net.sourceforge.pmd.lang.apex.rule.security;
import apex.jorje.semantic.common.MockAstNode;
import net.sourceforge.pmd.testframework.PmdRuleTst;
import org.junit.Test;
public class ApexCRUDViolationTest extends PmdRuleTst {