Watcher: Remove unused local variable in doExecute (#36655)

This commit is contained in:
Michael Basnight 2018-12-20 13:43:10 -06:00 committed by GitHub
parent 32bed098bb
commit d00780d00c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 0 additions and 6 deletions

View File

@ -12,10 +12,8 @@ import org.elasticsearch.script.Script;
import org.elasticsearch.script.ScriptService;
import org.elasticsearch.xpack.core.watcher.condition.ExecutableCondition;
import org.elasticsearch.xpack.core.watcher.execution.WatchExecutionContext;
import org.elasticsearch.xpack.watcher.support.Variables;
import java.io.IOException;
import java.util.Map;
/**
* This class executes a script against the ctx payload and returns a boolean
@ -58,10 +56,6 @@ public final class ScriptCondition implements ExecutableCondition {
}
public Result doExecute(WatchExecutionContext ctx) {
Map<String, Object> parameters = Variables.createCtxParamsMap(ctx, ctx.payload());
if (script.getParams() != null && !script.getParams().isEmpty()) {
parameters.putAll(script.getParams());
}
WatcherConditionScript conditionScript = scriptFactory.newInstance(script.getParams(), ctx);
return conditionScript.execute() ? MET : UNMET;
}