Skip to content

Commit

Permalink
Fix a static reference
Browse files Browse the repository at this point in the history
  • Loading branch information
ipavlic committed Jul 3, 2024
1 parent 3679dd9 commit 44218fc
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions force-app/main/default/classes/function/FieldsMatch.cls
Original file line number Diff line number Diff line change
@@ -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<BinaryRelation> setComparisons = new Set<BinaryRelation>{
private static final Set<BinaryRelation> setComparisons = new Set<BinaryRelation>{
BinaryRelation.IS_IN,
BinaryRelation.NOT_IN
};

private List<FieldMatchCondition> matchConditions;
private final List<FieldMatchCondition> matchConditions;

public FieldsMatch() {
this.matchConditions = new List<FieldMatchCondition>();
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 44218fc

Please sign in to comment.