Behavioral Compatibility Changes in 3.7.0
JEXL 3.7.0 changes two defaults that can break existing applications at parse time:
- The default permissions are now SECURE: only a safe subset of
java.lang, java.math, and java.util is accessible. Classes outside that set are denied unless explicitly composed in.
- The default features disable
new(...), global side-effects, pragmas, and annotations, and enable lexical scoping; loops remain available to scripts (but never to expressions). Scripts using a disabled construct will throw JexlException.Feature when compiled.
The fastest migration is to load jexl.yaml via JexlConfigLoader: it restores RESTRICTED permissions and enables new, loops, side-effects, and lambdas — matching the 3.6 defaults.
try (InputStream in = getClass().getResourceAsStream("/jexl.yaml")) {
JexlEngine engine = JexlConfigLoader.load(in).create();
}
|