File tree Expand file tree Collapse file tree
src/main/java/dev/openfeature/contrib/tools/flagd/core/targeting Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1919 <io .grpc.version>1.79.0</io .grpc.version>
2020 <!-- caution - updating this will break compatibility with older protobuf-java versions -->
2121 <protobuf-java .min.version>3.25.6</protobuf-java .min.version>
22- <com .vmlens.version>1.2.27 </com .vmlens.version>
22+ <com .vmlens.version>1.2.28 </com .vmlens.version>
2323 <!-- Transitive flagd-core version -->
2424 <flagd-core .version>[1.0.0,2.0.0)</flagd-core .version>
2525 </properties >
239239 <include >**/*CTest.java</include >
240240 </includes >
241241 <failIfNoTests >true</failIfNoTests >
242+ <environmentVariables >
243+ <!-- disable JsonLogic compilation to reduce VMLens interleaving combinations -->
244+ <FLAGD_DISABLE_TARGETING_COMPILATION >true</FLAGD_DISABLE_TARGETING_COMPILATION >
245+ </environmentVariables >
242246 </configuration >
243247 </execution >
244248 </executions >
Original file line number Diff line number Diff line change 4747 </dependency >
4848
4949 <dependency >
50- <groupId >io.github.jamsesso </groupId >
50+ <groupId >io.github.gzsombor </groupId >
5151 <artifactId >json-logic-java</artifactId >
52- <version >1.1.0 </version >
52+ <version >1.1.3 </version >
5353 </dependency >
5454
5555 <!-- Override gson usage of json-logic-java-->
Original file line number Diff line number Diff line change @@ -19,13 +19,26 @@ public class Operator {
1919 static final String TARGET_KEY = "targetingKey" ;
2020 static final String TIME_STAMP = "timestamp" ;
2121
22+ static final String DISABLE_TARGETING_COMPILATION_ENV_VAR_NAME = "FLAGD_DISABLE_TARGETING_COMPILATION" ;
23+
2224 private final JsonLogic jsonLogicHandler ;
2325
2426 /**
2527 * Construct a targeting operator.
28+ * Compiles targeting rules into native Java methods by default, unless the
29+ * FLAGD_DISABLE_TARGETING_COMPILATION environment variable is set.
2630 */
2731 public Operator () {
28- jsonLogicHandler = new JsonLogic ();
32+ this (!Boolean .parseBoolean (System .getenv (DISABLE_TARGETING_COMPILATION_ENV_VAR_NAME )));
33+ }
34+
35+ /**
36+ * Construct a targeting operator.
37+ *
38+ * @param compileExpressions whether to compile JsonLogic expressions for better performance
39+ */
40+ public Operator (boolean compileExpressions ) {
41+ jsonLogicHandler = new JsonLogic (compileExpressions );
2942 jsonLogicHandler .addOperation (new Fractional ());
3043 jsonLogicHandler .addOperation (new SemVer ());
3144 jsonLogicHandler .addOperation (new StringComp (StringComp .Type .STARTS_WITH ));
You can’t perform that action at this time.
0 commit comments