changeset 7004:a5de3a2c202e

RT-35322: [Text] Name of any samples is wrong in Ensemble8
author Felipe Heidrich <felipe.heidrich@oracle.com>
date Tue, 13 May 2014 13:59:16 -0700
parents 3f011a15fd72
children 9a60fdbe7ca9
files modules/graphics/src/main/java/com/sun/javafx/font/PrismCompositeFontResource.java modules/graphics/src/main/java/com/sun/javafx/font/PrismFontFile.java
diffstat 2 files changed, 18 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/modules/graphics/src/main/java/com/sun/javafx/font/PrismCompositeFontResource.java	Tue May 13 10:53:25 2014 -0700
+++ b/modules/graphics/src/main/java/com/sun/javafx/font/PrismCompositeFontResource.java	Tue May 13 13:59:16 2014 -0700
@@ -207,19 +207,11 @@
             return false;
         }
         final PrismCompositeFontResource other = (PrismCompositeFontResource)obj;
-
-        return primaryResource.getFullName().equals(other.getFullName());
+        return primaryResource.equals(other.primaryResource);
     }
 
-    private int hash;
     @Override
     public int hashCode() {
-        if (hash != 0) {
-            return hash;
-        }
-        else {
-            hash = primaryResource.getFullName().hashCode();
-            return hash;
-        }
+        return primaryResource.hashCode();
     }
 }
--- a/modules/graphics/src/main/java/com/sun/javafx/font/PrismFontFile.java	Tue May 13 10:53:25 2014 -0700
+++ b/modules/graphics/src/main/java/com/sun/javafx/font/PrismFontFile.java	Tue May 13 13:59:16 2014 -0700
@@ -1218,4 +1218,20 @@
         return table;
     }
 
+    @Override
+    public boolean equals(Object obj) {
+        if (obj == null) {
+            return false;
+        }
+        if (!(obj instanceof PrismFontFile)) {
+            return false;
+        }
+        final PrismFontFile other = (PrismFontFile)obj;
+        return filename.equals(other.filename) && fullName.equals(other.fullName);
+    }
+
+    @Override
+    public int hashCode() {
+        return filename.hashCode() + (71 * fullName.hashCode());
+    }
 }