You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@velocity.apache.org by cb...@apache.org on 2018/12/08 15:57:56 UTC

svn commit: r1848479 - /velocity/engine/trunk/velocity-engine-core/src/main/java/org/apache/velocity/util/DuckType.java

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);