Skip to content

Commit

Permalink
0005812: MathColumnTransform uses Evaluator that is not thread-safe
Browse files Browse the repository at this point in the history
  • Loading branch information
Catherine Quamme authored and Catherine Quamme committed Apr 27, 2023
1 parent 5769814 commit 23ec255
Showing 1 changed file with 6 additions and 1 deletion.
Expand Up @@ -32,7 +32,7 @@

public class MathColumnTransform implements ISingleNewAndOldValueColumnTransform, IBuiltInExtensionPoint {
public final static String NAME = "math";
private static Evaluator eval = new Evaluator();
public final static String EVALUATOR = "evalutor";

public String getName() {
return NAME;
Expand All @@ -52,6 +52,11 @@ public NewAndOldValue transform(IDatabasePlatform platform,
String newValue, String oldValue) throws IgnoreColumnException, IgnoreRowException {
String transformExpression = column.getTransformExpression();
try {
Evaluator eval = (Evaluator) context.get(EVALUATOR);
if (eval == null) {
eval = new Evaluator();
context.put(EVALUATOR, eval);
}
eval.clearVariables();
eval.putVariable("currentValue", newValue);
eval.putVariable("oldValue", oldValue);
Expand Down

0 comments on commit 23ec255

Please sign in to comment.