From 44218fc48014b7a0fb3169d616ebf1dcce078058 Mon Sep 17 00:00:00 2001 From: Ilija Pavlic Date: Wed, 3 Jul 2024 13:33:44 -0400 Subject: [PATCH] Fix a static reference --- .../main/default/classes/function/FieldsMatch.cls | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/force-app/main/default/classes/function/FieldsMatch.cls b/force-app/main/default/classes/function/FieldsMatch.cls index 2922f7a..1a6c50c 100644 --- a/force-app/main/default/classes/function/FieldsMatch.cls +++ b/force-app/main/default/classes/function/FieldsMatch.cls @@ -1,14 +1,14 @@ public class FieldsMatch implements SObjectPredicate { - private static PrimitiveComparer primitiveComparer = new PrimitiveComparer(); - private static SObjectFieldReader fieldReader = new SObjectFieldReader(); + private static final PrimitiveComparer primitiveComparer = new PrimitiveComparer(); + private static final SObjectFieldReader fieldReader = new SObjectFieldReader(); - private static Set setComparisons = new Set{ + private static final Set setComparisons = new Set{ BinaryRelation.IS_IN, BinaryRelation.NOT_IN }; - private List matchConditions; + private final List matchConditions; public FieldsMatch() { this.matchConditions = new List(); @@ -45,7 +45,7 @@ public class FieldsMatch implements SObjectPredicate { } private Boolean conditionSatisfied(FieldMatchCondition condition, SObject record) { - Object fieldValue = this.fieldReader.read(record, condition.fieldPath); + Object fieldValue = fieldReader.read(record, condition.fieldPath); if (setComparisons.contains(condition.relation)) { return setConditionSatisfied(condition, fieldValue); } else { @@ -82,7 +82,7 @@ public class FieldsMatch implements SObjectPredicate { } } } - Integer result = this.primitiveComparer.compare(fieldValue, condition.value); + Integer result = primitiveComparer.compare(fieldValue, condition.value); switch on condition.relation { when EQUALS { return result == 0;