From: Andreas L. Delmelle Date: Sun, 24 May 2015 11:35:19 +0000 (+0000) Subject: FOP-2472: Add method to allow clearing the hyphenation tree cache at runtime, as... X-Git-Tag: fop-2_1~71 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=a34e033deebcd9ea3d4fef7809271d6ab854dc60;p=xmlgraphics-fop.git FOP-2472: Add method to allow clearing the hyphenation tree cache at runtime, as suggested by Marc Wiest git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1681436 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/java/org/apache/fop/hyphenation/Hyphenator.java b/src/java/org/apache/fop/hyphenation/Hyphenator.java index 48af67d09..ed992427a 100644 --- a/src/java/org/apache/fop/hyphenation/Hyphenator.java +++ b/src/java/org/apache/fop/hyphenation/Hyphenator.java @@ -63,6 +63,14 @@ public final class Hyphenator { return hTreeCache; } + /** + * Clears the default hyphenation tree cache.
+ * This method can be used if the underlying data files are changed at runtime. + */ + public static synchronized void clearHyphenationTreeCache() { + hTreeCache = new HyphenationTreeCache(); + } + /** * Returns a hyphenation tree for a given language and country, * with fallback from (lang,country) to (lang).