[apex] AvoidNonRestrictiveQueries: use new AnnotationParameter.hasName

This commit is contained in:
Andreas Dangel 2024-07-18 12:07:37 +02:00
parent 090bd1208b
commit 6e8ce46f6c
No known key found for this signature in database
GPG Key ID: 93450DF2DF9A3FA3

View File

@ -62,11 +62,11 @@ public class AvoidNonRestrictiveQueriesRule extends AbstractApexRule {
.map(NodeStream::first);
Optional<Boolean> methodSeeAllData = methodAnnotation.flatMap(m -> m.children(ASTAnnotationParameter.class)
.filter(p -> ASTAnnotationParameter.SEE_ALL_DATA.equalsIgnoreCase(p.getName()))
.filter(p -> p.hasName(ASTAnnotationParameter.SEE_ALL_DATA))
.firstOpt()
.map(ASTAnnotationParameter::getBooleanValue));
boolean classSeeAllData = classAnnotation.flatMap(m -> m.children(ASTAnnotationParameter.class)
.filter(p -> ASTAnnotationParameter.SEE_ALL_DATA.equalsIgnoreCase(p.getName()))
.filter(p -> p.hasName(ASTAnnotationParameter.SEE_ALL_DATA))
.firstOpt()
.map(ASTAnnotationParameter::getBooleanValue))
.orElse(false);