src/windows/classes/sun/awt/windows/WToolkit.java

Print this page

        

@@ -72,11 +72,11 @@
 
     // System clipboard.
     WClipboard clipboard;
 
     // cache of font peers
-    private Hashtable cacheFontPeer;
+    private Hashtable<String,FontPeer> cacheFontPeer;
 
     // Windows properties
     private WDesktopProperties  wprops;
 
     // Dynamic Layout Resize client code setting

@@ -108,14 +108,14 @@
         // Print out which version of Windows is running
         if (log.isLoggable(PlatformLogger.FINE)) {
             log.fine("Win version: " + getWindowsVersion());
         }
 
-        java.security.AccessController.doPrivileged(
-            new java.security.PrivilegedAction()
+        AccessController.doPrivileged(
+            new PrivilegedAction <Void> ()
         {
-            public Object run() {
+            public Void run() {
                 String browserProp = System.getProperty("browser");
                 if (browserProp != null && browserProp.equals("sun.plugin")) {
                     disableCustomPalette();
                 }
                 return null;

@@ -259,12 +259,12 @@
         System.setProperty("sun.awt.enableExtraMouseButtons", ""+areExtraMouseButtonsEnabled);
         setExtraMouseButtonsEnabledNative(areExtraMouseButtonsEnabled);
     }
 
     private final void registerShutdownHook() {
-        AccessController.doPrivileged(new PrivilegedAction() {
-            public Object run() {
+        AccessController.doPrivileged(new PrivilegedAction<Void>() {
+            public Void run() {
                 ThreadGroup currentTG =
                     Thread.currentThread().getThreadGroup();
                 ThreadGroup parentTG = currentTG.getParent();
                 while (parentTG != null) {
                     currentTG = parentTG;

@@ -397,10 +397,11 @@
         CanvasPeer peer = new WCanvasPeer(target);
         targetCreatedPeer(target, peer);
         return peer;
     }
 
+    @SuppressWarnings("deprecation")
     public void disableBackgroundErase(Canvas canvas) {
         WCanvasPeer peer = (WCanvasPeer)canvas.getPeer();
         if (peer == null) {
             throw new IllegalStateException("Canvas must have a valid peer");
         }

@@ -590,19 +591,19 @@
 
     public FontPeer getFontPeer(String name, int style) {
         FontPeer retval = null;
         String lcName = name.toLowerCase();
         if (null != cacheFontPeer) {
-            retval = (FontPeer)cacheFontPeer.get(lcName + style);
+            retval = cacheFontPeer.get(lcName + style);
             if (null != retval) {
                 return retval;
             }
         }
         retval = new WFontPeer(name, style);
         if (retval != null) {
             if (null == cacheFontPeer) {
-                cacheFontPeer = new Hashtable(5, (float)0.9);
+                cacheFontPeer = new Hashtable<>(5, 0.9f);
             }
             if (null != cacheFontPeer) {
                 cacheFontPeer.put(lcName + style, retval);
             }
         }

@@ -696,11 +697,13 @@
     }
 
     /**
      * Returns a style map for the input method highlight.
      */
-    public Map mapInputMethodHighlight(InputMethodHighlight highlight) {
+    public Map<java.awt.font.TextAttribute,?> mapInputMethodHighlight(
+        InputMethodHighlight highlight)
+    {
         return WInputMethod.mapInputMethodHighlight(highlight);
     }
 
     /**
      * Returns whether enableInputMethods should be set to true for peered

@@ -966,16 +969,18 @@
     @Override
     public boolean useBufferPerWindow() {
         return !Win32GraphicsEnvironment.isDWMCompositionEnabled();
     }
 
+    @SuppressWarnings("deprecation")
     public void grab(Window w) {
         if (w.getPeer() != null) {
             ((WWindowPeer)w.getPeer()).grab();
         }
     }
 
+    @SuppressWarnings("deprecation")
     public void ungrab(Window w) {
         if (w.getPeer() != null) {
            ((WWindowPeer)w.getPeer()).ungrab();
         }
     }