From 5bed640e8b87526a077d6a8411cddfac9c8661ae Mon Sep 17 00:00:00 2001 From: memesaregood1 Date: Wed, 22 Feb 2023 07:20:49 +0300 Subject: note comments --- .../java/org/traccar/handler/ComputedAttributesHandler.java | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'src/main') diff --git a/src/main/java/org/traccar/handler/ComputedAttributesHandler.java b/src/main/java/org/traccar/handler/ComputedAttributesHandler.java index 76f9c8f24..73b549195 100644 --- a/src/main/java/org/traccar/handler/ComputedAttributesHandler.java +++ b/src/main/java/org/traccar/handler/ComputedAttributesHandler.java @@ -57,19 +57,15 @@ public class ComputedAttributesHandler extends BaseDataHandler { private final boolean includeDeviceAttributes; - @Inject public ComputedAttributesHandler(Config config, CacheManager cacheManager) { this.cacheManager = cacheManager; - boolean enableJEXLLocalVariables = config.getBoolean(Keys.PROCESSING_COMPUTED_ATTRIBUTES_LOCAL_VARIABLES); - boolean enableJEXLLoops = config.getBoolean(Keys.PROCESSING_COMPUTED_ATTRIBUTES_LOOPS); - boolean enableJEXLNewInstanceCreation = config.getBoolean(Keys.PROCESSING_COMPUTED_ATTRIBUTES_NEW_INSTANCE_CREATION); JexlSandbox sandbox = new JexlSandbox(false); sandbox.allow("com.safe.Functions"); JexlFeatures features = new JexlFeatures() - .localVar(enableJEXLLocalVariables) - .loops(enableJEXLLoops) - .newInstance(enableJEXLNewInstanceCreation) + .localVar(config.getBoolean(Keys.PROCESSING_COMPUTED_ATTRIBUTES_LOCAL_VARIABLES)) + .loops(config.getBoolean(Keys.PROCESSING_COMPUTED_ATTRIBUTES_LOOPS)) + .newInstance(config.getBoolean(Keys.PROCESSING_COMPUTED_ATTRIBUTES_NEW_INSTANCE_CREATION)) .structuredLiteral(true); engine = new JexlBuilder() .strict(true) @@ -78,7 +74,6 @@ public class ComputedAttributesHandler extends BaseDataHandler { .features(features) .create(); includeDeviceAttributes = config.getBoolean(Keys.PROCESSING_COMPUTED_ATTRIBUTES_DEVICE_ATTRIBUTES); - } private MapContext prepareContext(Position position) { -- cgit v1.2.3