diff options
author | Claude Brisson <cbrisson@apache.org> | 2018-12-08 15:57:56 +0000 |
---|---|---|
committer | Claude Brisson <cbrisson@apache.org> | 2018-12-08 15:57:56 +0000 |
commit | 0ee78a14c767b84db6c8c6cb58385aef8d416d9c (patch) | |
tree | 380b39ba270257d55a79adc7f873521c3e72f8ba /velocity-engine-core/src/main/java/org/apache | |
parent | 2fd4ceeca52a7b187700d4f46d10019e0400c670 (diff) | |
download | apache-velocity-engine-0ee78a14c767b84db6c8c6cb58385aef8d416d9c.tar.gz |
[engine] Static method to empty DuckType class cache
git-svn-id: https://svn.apache.org/repos/asf/velocity/engine/trunk@1848479 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'velocity-engine-core/src/main/java/org/apache')
-rw-r--r-- | velocity-engine-core/src/main/java/org/apache/velocity/util/DuckType.java | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/velocity-engine-core/src/main/java/org/apache/velocity/util/DuckType.java b/velocity-engine-core/src/main/java/org/apache/velocity/util/DuckType.java index 5edfb093..444669e5 100644 --- a/velocity-engine-core/src/main/java/org/apache/velocity/util/DuckType.java +++ b/velocity-engine-core/src/main/java/org/apache/velocity/util/DuckType.java @@ -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); |