]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Desynchronized createFontKey() and removed single use of static TRIPLETS_TYPE in...
authorAdrian Cumiskey <acumiskey@apache.org>
Tue, 22 Jul 2008 09:30:22 +0000 (09:30 +0000)
committerAdrian Cumiskey <acumiskey@apache.org>
Tue, 22 Jul 2008 09:30:22 +0000 (09:30 +0000)
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

index 560330f6dfd5343096d44ff426c3e0f470d0c39d..314ef0480a3f45dd120976aebc274f8e38b58083 100644 (file)
@@ -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/*<FontTriplet>*/ 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);
     }