src/share/classes/sun/font/TrueTypeFont.java

Print this page

        

@@ -288,11 +288,11 @@
                 FontUtilities.getLogger().info("open TTF: " + platName);
             }
             try {
                 RandomAccessFile raf = (RandomAccessFile)
                 java.security.AccessController.doPrivileged(
-                    new java.security.PrivilegedAction() {
+                    new java.security.PrivilegedAction<Object>() {
                         public Object run() {
                             try {
                                 return new RandomAccessFile(platName, "r");
                             } catch (FileNotFoundException ffne) {
                             }

@@ -1544,11 +1544,11 @@
 
     /* This duplicates initNames() but that has to run fast as its used
      * during typical start-up and the information here is likely never
      * needed.
      */
-    protected void initAllNames(int requestedID, HashSet names) {
+    protected void initAllNames(int requestedID, HashSet<String> names) {
 
         byte[] name = new byte[256];
         ByteBuffer buffer = getTableBuffer(nameTag);
 
         if (buffer != null) {

@@ -1582,27 +1582,27 @@
             }
         }
     }
 
     String[] getAllFamilyNames() {
-        HashSet aSet = new HashSet();
+        HashSet<String> aSet = new HashSet<>();
         try {
             initAllNames(FAMILY_NAME_ID, aSet);
         } catch (Exception e) {
             /* In case of malformed font */
         }
-        return (String[])aSet.toArray(new String[0]);
+        return aSet.toArray(new String[0]);
     }
 
     String[] getAllFullNames() {
-        HashSet aSet = new HashSet();
+        HashSet<String> aSet = new HashSet<>();
         try {
             initAllNames(FULL_NAME_ID, aSet);
         } catch (Exception e) {
             /* In case of malformed font */
         }
-        return (String[])aSet.toArray(new String[0]);
+        return aSet.toArray(new String[0]);
     }
 
     /*  Used by the OpenType engine for mark positioning.
      */
     @Override