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

Print this page

        

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2014, 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
  * under the terms of the GNU General Public License version 2 only, as
  * published by the Free Software Foundation.  Oracle designates this

@@ -69,11 +69,11 @@
     private static boolean logging;
 
     // This static initializer block figures out the OS constants.
     static {
 
-        AccessController.doPrivileged(new PrivilegedAction () {
+        AccessController.doPrivileged(new PrivilegedAction<Object>() {
             public Object run() {
                 String osName = System.getProperty("os.name", "unknownOS");
                 isSolaris = osName.startsWith("SunOS");
 
                 isLinux = osName.startsWith("Linux");

@@ -389,11 +389,11 @@
      * }
      * return fuir;
      */
     private static volatile
         SoftReference<ConcurrentHashMap<PhysicalFont, CompositeFont>>
-        compMapRef = new SoftReference(null);
+        compMapRef = new SoftReference<>(null);
 
     public static FontUIResource getCompositeFontUIResource(Font font) {
 
         FontUIResource fuir = new FontUIResource(font);
         Font2D font2D = FontUtilities.getFont2D(font);

@@ -419,11 +419,11 @@
         CompositeFont dialog2D = (CompositeFont)dialog;
         PhysicalFont physicalFont = (PhysicalFont)font2D;
         ConcurrentHashMap<PhysicalFont, CompositeFont> compMap = compMapRef.get();
         if (compMap == null) { // Its been collected.
             compMap = new ConcurrentHashMap<PhysicalFont, CompositeFont>();
-            compMapRef = new SoftReference(compMap);
+            compMapRef = new SoftReference<>(compMap);
         }
         CompositeFont compFont = compMap.get(physicalFont);
         if (compFont == null) {
             compFont = new CompositeFont(physicalFont, dialog2D);
             compMap.put(physicalFont, compFont);