--- old/src/java.desktop/share/classes/java/awt/Window.java 2015-03-04 18:16:01.000000000 +0300 +++ new/src/java.desktop/share/classes/java/awt/Window.java 2015-03-04 18:16:01.000000000 +0300 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1995, 2015, 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 @@ -29,7 +29,6 @@ import java.awt.geom.Point2D; import java.awt.im.InputContext; import java.awt.image.BufferStrategy; -import java.awt.image.BufferedImage; import java.awt.peer.ComponentPeer; import java.awt.peer.WindowPeer; import java.beans.PropertyChangeListener; @@ -56,7 +55,6 @@ import sun.awt.CausedFocusEvent; import sun.awt.SunToolkit; import sun.awt.util.IdentityArrayList; -import sun.java2d.Disposer; import sun.java2d.pipe.Region; import sun.security.action.GetPropertyAction; import sun.util.logging.PlatformLogger; @@ -755,11 +753,10 @@ * @see Container#removeNotify * @since 1.0 */ - @SuppressWarnings("deprecation") public void addNotify() { synchronized (getTreeLock()) { Container parent = this.parent; - if (parent != null && parent.getPeer() == null) { + if (parent != null && parent.peer == null) { parent.addNotify(); } if (peer == null) { @@ -802,7 +799,7 @@ @SuppressWarnings("deprecation") public void pack() { Container parent = this.parent; - if (parent != null && parent.getPeer() == null) { + if (parent != null && parent.peer == null) { parent.addNotify(); } if (peer == null) { @@ -1072,10 +1069,9 @@ } } - @SuppressWarnings("deprecation") static void updateChildFocusableWindowState(Window w) { - if (w.getPeer() != null && w.isShowing()) { - ((WindowPeer)w.getPeer()).updateFocusableWindowState(); + if (w.peer != null && w.isShowing()) { + ((WindowPeer)w.peer).updateFocusableWindowState(); } for (int i = 0; i < w.ownedWindowList.size(); i++) { Window child = w.ownedWindowList.elementAt(i).get(); @@ -1160,10 +1156,9 @@ * as reported in javadoc. So we need to implement this functionality even if a * child overrides dispose() in a wrong way without calling super.dispose(). */ - @SuppressWarnings("deprecation") void disposeImpl() { dispose(); - if (getPeer() != null) { + if (peer != null) { doDispose(); } } @@ -3649,7 +3644,7 @@ } } this.opacity = opacity; - WindowPeer peer = (WindowPeer)getPeer(); + WindowPeer peer = (WindowPeer) this.peer; if (peer != null) { peer.setOpacity(opacity); } @@ -3726,7 +3721,6 @@ * * @since 1.7 */ - @SuppressWarnings("deprecation") public void setShape(Shape shape) { synchronized (getTreeLock()) { if (shape != null) { @@ -3744,7 +3738,7 @@ } } this.shape = (shape == null) ? null : new Path2D.Float(shape); - WindowPeer peer = (WindowPeer)getPeer(); + WindowPeer peer = (WindowPeer) this.peer; if (peer != null) { peer.applyShape(shape == null ? null : Region.getInstance(shape, null)); } @@ -3844,7 +3838,6 @@ * @see GraphicsConfiguration#isTranslucencyCapable() */ @Override - @SuppressWarnings("deprecation") public void setBackground(Color bgColor) { Color oldBg = getBackground(); super.setBackground(bgColor); @@ -3872,7 +3865,7 @@ } else if ((oldAlpha < 255) && (alpha == 255)) { setLayersOpaque(this, true); } - WindowPeer peer = (WindowPeer)getPeer(); + WindowPeer peer = (WindowPeer) this.peer; if (peer != null) { peer.setOpaque(alpha == 255); } @@ -3897,10 +3890,9 @@ return bg != null ? bg.getAlpha() == 255 : true; } - @SuppressWarnings("deprecation") private void updateWindow() { synchronized (getTreeLock()) { - WindowPeer peer = (WindowPeer)getPeer(); + WindowPeer peer = (WindowPeer) this.peer; if (peer != null) { peer.updateWindow(); } @@ -4088,7 +4080,6 @@ window.securityWarningHeight = height; } - @SuppressWarnings("deprecation") public void setSecurityWarningPosition(Window window, Point2D point, float alignmentX, float alignmentY) { @@ -4098,7 +4089,7 @@ window.securityWarningAlignmentY = alignmentY; synchronized (window.getTreeLock()) { - WindowPeer peer = (WindowPeer)window.getPeer(); + WindowPeer peer = (WindowPeer) window.peer; if (peer != null) { peer.repositionSecurityWarning(); }