This is an automated email from the ASF dual-hosted git repository.

sebb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-jexl.git


The following commit(s) were added to refs/heads/master by this push:
     new 1710e348 Document need for privacy
1710e348 is described below

commit 1710e34837a6bd2617f64956a819907fa8804aa8
Author: Sebb <s...@apache.org>
AuthorDate: Mon Oct 23 11:31:23 2023 +0100

    Document need for privacy
---
 src/main/java/org/apache/commons/jexl3/JexlFeatures.java | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/src/main/java/org/apache/commons/jexl3/JexlFeatures.java 
b/src/main/java/org/apache/commons/jexl3/JexlFeatures.java
index 7b732bed..805cdf36 100644
--- a/src/main/java/org/apache/commons/jexl3/JexlFeatures.java
+++ b/src/main/java/org/apache/commons/jexl3/JexlFeatures.java
@@ -130,13 +130,21 @@ public final class JexlFeatures {
      * All features.
      * N.B. ensure this is updated if additional features are added.
      */
-    private static final long ALL_FEATURES = (1L << (CONST_CAPTURE + 1)) - 1L;
+    private static final long ALL_FEATURES = (1L << (CONST_CAPTURE + 1)) - 1L; 
// MUST REMAIN PRIVATE
 
-    /**
+    /*
+     * *WARNING* 
+     * Static fields may be inlined by the Java compiler, so their _values_ 
effectively form part of the external API.
+     * Classes that reference them need to be recompiled to pick up new values.
+     * This means that changes in value are not binary compatible.
+     * Such fields must be private or problems may occur.
+     */
+
+     /**
      * The default features flag mask.
      * <p>Meant for compatibility with scripts written before 3.3.1</p>
      */
-    private static final long DEFAULT_FEATURES =
+    private static final long DEFAULT_FEATURES = // MUST REMAIN PRIVATE
         1L << LOCAL_VAR
         | 1L << SIDE_EFFECT
         | 1L << SIDE_EFFECT_GLOBAL
@@ -159,7 +167,7 @@ public final class JexlFeatures {
      * The canonical scripting (since 3.3.1) features flag mask based on the 
original default.
      * <p>Adds lexical, lexical-shade and const-capture but removes 
comparator-names and pragma-anywhere</p>
      */
-    private static final long SCRIPT_FEATURES =
+    private static final long SCRIPT_FEATURES = // MUST REMAIN PRIVATE
         ( DEFAULT_FEATURES
         | 1L << LEXICAL
         | 1L << LEXICAL_SHADE

Reply via email to