From 6e8ce46f6c5e52cb2b76f497d97c0c69c21b4ad7 Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Thu, 18 Jul 2024 12:07:37 +0200 Subject: [PATCH] [apex] AvoidNonRestrictiveQueries: use new AnnotationParameter.hasName --- .../apex/rule/performance/AvoidNonRestrictiveQueriesRule.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/rule/performance/AvoidNonRestrictiveQueriesRule.java b/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/rule/performance/AvoidNonRestrictiveQueriesRule.java index d219388c96..e62363eb7e 100644 --- a/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/rule/performance/AvoidNonRestrictiveQueriesRule.java +++ b/pmd-apex/src/main/java/net/sourceforge/pmd/lang/apex/rule/performance/AvoidNonRestrictiveQueriesRule.java @@ -62,11 +62,11 @@ public class AvoidNonRestrictiveQueriesRule extends AbstractApexRule { .map(NodeStream::first); Optional 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);