7074386: fallback to fontconfig.<major_version>.bfc/properties if fontconfig.<major_version>.<minor_version>.
authordbuck
Fri, 02 Sep 2011 04:28:49 -0700
changeset 10406 70c2151d530b
parent 10313 0def93fb66ba
child 10407 4f389b57b475
7074386: fallback to fontconfig.<major_version>.bfc/properties if fontconfig.<major_version>.<minor_version>. Summary: fallback to fontconfig.<major_version>.bfc/properties if fontconfig.<major_version>.<minor_version>. is not found Reviewed-by: prr, robm
jdk/src/share/classes/sun/awt/FontConfiguration.java
--- a/jdk/src/share/classes/sun/awt/FontConfiguration.java	Wed Aug 17 22:47:49 2011 -0700
+++ b/jdk/src/share/classes/sun/awt/FontConfiguration.java	Fri Sep 02 04:28:49 2011 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -266,11 +266,20 @@
     private File findFontConfigFile(String javaLib) {
         String baseName = javaLib + File.separator + "fontconfig";
         File configFile;
+        String osMajorVersion = null;
         if (osVersion != null && osName != null) {
             configFile = findImpl(baseName + "." + osName + "." + osVersion);
             if (configFile != null) {
                 return configFile;
             }
+            int decimalPointIndex = osVersion.indexOf(".");
+            if (decimalPointIndex != -1) {
+                osMajorVersion = osVersion.substring(0, osVersion.indexOf("."));
+                configFile = findImpl(baseName + "." + osName + "." + osMajorVersion);
+                if (configFile != null) {
+                    return configFile;
+                }
+            }
         }
         if (osName != null) {
             configFile = findImpl(baseName + "." + osName);
@@ -283,6 +292,12 @@
             if (configFile != null) {
                 return configFile;
             }
+            if (osMajorVersion != null) {
+                configFile = findImpl(baseName + "." + osMajorVersion);
+                if (configFile != null) {
+                    return configFile;
+                }
+            }
         }
         foundOsSpecificFile = false;