From d65a931df629aadc120b704c16f8a07cbba1543d Mon Sep 17 00:00:00 2001 From: Adrian Cumiskey Date: Tue, 22 Jul 2008 09:30:22 +0000 Subject: [PATCH] Desynchronized createFontKey() and removed single use of static TRIPLETS_TYPE in fontLookup() following a suggestion by Jeremias Ingo Maas' threading issue (http://mail-archives.apache.org/mod_mbox/xmlgraphics-fop-users/200807.mbox/%3C000a01c8eb4b$42166e60$a701010a@ebp01422%3E). git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@678691 13f79535-47bb-0310-9956-ffa450edef68 --- src/java/org/apache/fop/fonts/FontInfo.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/java/org/apache/fop/fonts/FontInfo.java b/src/java/org/apache/fop/fonts/FontInfo.java index 560330f6d..314ef0480 100644 --- a/src/java/org/apache/fop/fonts/FontInfo.java +++ b/src/java/org/apache/fop/fonts/FontInfo.java @@ -40,8 +40,6 @@ import org.apache.commons.logging.LogFactory; */ public class FontInfo { - private static final FontTriplet[] TRIPLETS_TYPE = new FontTriplet[1]; - /** logging instance */ protected static Log log = LogFactory.getLog(FontInfo.class); @@ -399,9 +397,11 @@ public class FontInfo { + "FontTriplet on the last call. Lookup: " + sb.toString()); } - + FontTriplet[] fontTriplets = new FontTriplet[matchedTriplets.size()]; + matchedTriplets.toArray(fontTriplets); + // found some matching fonts so return them - return (FontTriplet[]) matchedTriplets.toArray(TRIPLETS_TYPE); + return fontTriplets; } private Set/**/ getLoggedFontKeys() { @@ -504,7 +504,7 @@ public class FontInfo { * @param weight font weight * @return internal key */ - public static synchronized FontTriplet createFontKey(String family, String style, + public static FontTriplet createFontKey(String family, String style, int weight) { return new FontTriplet(family, style, weight); } -- 2.39.5