Author: cbrisson
Date: Sat Dec  8 15:57:56 2018
New Revision: 1848479

URL: http://svn.apache.org/viewvc?rev=1848479&view=rev
Log:
[engine] Static method to empty DuckType class cache

Modified:
    
velocity/engine/trunk/velocity-engine-core/src/main/java/org/apache/velocity/util/DuckType.java

Modified: 
velocity/engine/trunk/velocity-engine-core/src/main/java/org/apache/velocity/util/DuckType.java
URL: 
http://svn.apache.org/viewvc/velocity/engine/trunk/velocity-engine-core/src/main/java/org/apache/velocity/util/DuckType.java?rev=1848479&r1=1848478&r2=1848479&view=diff
==============================================================================
--- 
velocity/engine/trunk/velocity-engine-core/src/main/java/org/apache/velocity/util/DuckType.java
 (original)
+++ 
velocity/engine/trunk/velocity-engine-core/src/main/java/org/apache/velocity/util/DuckType.java
 Sat Dec  8 15:57:56 2018
@@ -68,6 +68,17 @@ public class DuckType
 
     protected static final Object NO_METHOD = new Object();
 
+    /**
+     * Clears the internal cache of all the underlying Types.
+     */
+    public static void clearCache()
+    {
+        for(Types type : Types.values())
+        {
+            type.cache.clear();
+        }
+    }
+        
     public static String asString(Object value)
     {
         return asString(value, true);


Reply via email to