commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hen...@apache.org
Subject svn commit: r1814413 - in /commons/proper/jexl/trunk: RELEASE-NOTES.txt src/main/java/org/apache/commons/jexl3/JexlEngine.java src/site/xdoc/changes.xml
Date Mon, 06 Nov 2017 14:25:34 GMT
Author: henrib
Date: Mon Nov  6 14:25:34 2017
New Revision: 1814413

URL: http://svn.apache.org/viewvc?rev=1814413&view=rev
Log:
JEXL-244:
Blind fix, removing static anonymous inner classes

Modified:
    commons/proper/jexl/trunk/RELEASE-NOTES.txt
    commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl3/JexlEngine.java
    commons/proper/jexl/trunk/src/site/xdoc/changes.xml

Modified: commons/proper/jexl/trunk/RELEASE-NOTES.txt
URL: http://svn.apache.org/viewvc/commons/proper/jexl/trunk/RELEASE-NOTES.txt?rev=1814413&r1=1814412&r2=1814413&view=diff
==============================================================================
--- commons/proper/jexl/trunk/RELEASE-NOTES.txt (original)
+++ commons/proper/jexl/trunk/RELEASE-NOTES.txt Mon Nov  6 14:25:34 2017
@@ -35,6 +35,7 @@ New Features in 3.2:
 
 Bugs Fixed in 3.2:
 ==================
+* JEXL-244:      Webapp classloader memory leaks
 * JEXL-241:      NPE when script containing string interpolation executed in multiple threads
 * JEXL-240:      Unable to invoke a call operator using antish style variable resolution
 * JEXL-231:      Syntax for accessing List elements is not mentioned in docs

Modified: commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl3/JexlEngine.java
URL: http://svn.apache.org/viewvc/commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl3/JexlEngine.java?rev=1814413&r1=1814412&r2=1814413&view=diff
==============================================================================
--- commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl3/JexlEngine.java (original)
+++ commons/proper/jexl/trunk/src/main/java/org/apache/commons/jexl3/JexlEngine.java Mon Nov
 6 14:25:34 2017
@@ -46,8 +46,16 @@ import java.nio.charset.Charset;
  */
 public abstract class JexlEngine {
 
-    /** A marker for invocation failures in tryInvoke. */
-    public static final Object TRY_FAILED = new Object() {
+    /** A marker singleton for invocation failures in tryInvoke. */
+    public static final Object TRY_FAILED = new FailObject();
+
+    /** The failure marker class. */
+    private static final class FailObject {
+        /**
+         * Default ctor.
+         */
+        private FailObject() {}
+
         @Override
         public String toString() {
             return "tryExecute failed";
@@ -58,12 +66,7 @@ public abstract class JexlEngine {
      * The thread local context.
      */
     protected static final java.lang.ThreadLocal<JexlContext.ThreadLocal> CONTEXT =
-            new java.lang.ThreadLocal<JexlContext.ThreadLocal>() {
-                @Override
-                protected JexlContext.ThreadLocal initialValue() {
-                    return null;
-                }
-            };
+                       new java.lang.ThreadLocal<JexlContext.ThreadLocal>();
 
     /**
      * Accesses the current thread local context.
@@ -78,12 +81,7 @@ public abstract class JexlEngine {
      * The thread local engine.
      */
     protected static final java.lang.ThreadLocal<JexlEngine> ENGINE =
-            new java.lang.ThreadLocal<JexlEngine>() {
-                @Override
-                protected JexlEngine initialValue() {
-                    return null;
-                }
-            };
+                       new java.lang.ThreadLocal<JexlEngine>();
 
     /**
      * Accesses the current thread local engine.
@@ -166,9 +164,19 @@ public abstract class JexlEngine {
     public static final JexlFeatures DEFAULT_FEATURES = new JexlFeatures();
 
     /**
-     * An empty/static/non-mutable JexlContext used instead of null context.
+     * An empty/static/non-mutable JexlContext singleton used instead of null context.
      */
-    public static final JexlContext EMPTY_CONTEXT = new JexlContext() {
+    public static final JexlContext EMPTY_CONTEXT = new EmptyContext();
+
+    /**
+     * The empty context class, public for instrospection.
+     */
+    public static final class EmptyContext implements JexlContext {
+        /**
+         * Default ctor.
+         */
+        private EmptyContext() {}
+
         @Override
         public Object get(String name) {
             return null;
@@ -186,9 +194,19 @@ public abstract class JexlEngine {
     };
 
     /**
-     * An empty/static/non-mutable JexlNamesapce used instead of null namespace.
+     * An empty/static/non-mutable JexlNamespace singleton used instead of null namespace.
+     */
+    public static final JexlContext.NamespaceResolver EMPTY_NS = new EmptyNamespaceResolver();
+
+    /**
+     * The  empty/static/non-mutable JexlNamespace class, public for instrospection.
      */
-    public static final JexlContext.NamespaceResolver EMPTY_NS = new JexlContext.NamespaceResolver()
{
+    public static final class EmptyNamespaceResolver implements JexlContext.NamespaceResolver
{
+        /**
+         * Default ctor.
+         */
+        private EmptyNamespaceResolver() {}
+
         @Override
         public Object resolveNamespace(String name) {
             return null;

Modified: commons/proper/jexl/trunk/src/site/xdoc/changes.xml
URL: http://svn.apache.org/viewvc/commons/proper/jexl/trunk/src/site/xdoc/changes.xml?rev=1814413&r1=1814412&r2=1814413&view=diff
==============================================================================
--- commons/proper/jexl/trunk/src/site/xdoc/changes.xml (original)
+++ commons/proper/jexl/trunk/src/site/xdoc/changes.xml Mon Nov  6 14:25:34 2017
@@ -26,6 +26,9 @@
     </properties>
     <body>
         <release version="3.2" date="unreleased">
+            <action dev="henrib" type="fix" issue="JEXL-244" due-to="Dmitri Blinov">
+                Webapp classloader memory leaks
+            </action>
             <action dev="henrib" type="fix" issue="JEXL-241" due-to="Yang Wang">
                 NPE when script containing string interpolation executed in multiple threads
             </action>



Mime
View raw message