From a34e033deebcd9ea3d4fef7809271d6ab854dc60 Mon Sep 17 00:00:00 2001 From: "Andreas L. Delmelle" Date: Sun, 24 May 2015 11:35:19 +0000 Subject: [PATCH] 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 --- src/java/org/apache/fop/hyphenation/Hyphenator.java | 8 ++++++++ 1 file changed, 8 insertions(+) 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). -- 2.39.5