--- old/src/java.desktop/share/classes/java/awt/Font.java 2015-03-04 18:15:58.000000000 +0300 +++ new/src/java.desktop/share/classes/java/awt/Font.java 2015-03-04 18:15:58.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 @@ -41,7 +41,6 @@ import java.security.PrivilegedExceptionAction; import java.text.AttributedCharacterIterator.Attribute; import java.text.CharacterIterator; -import java.text.StringCharacterIterator; import java.util.Hashtable; import java.util.Locale; import java.util.Map; @@ -239,6 +238,11 @@ public boolean isCreatedFont(Font font) { return font.createdFont; } + + @Override + public FontPeer getFontPeer(final Font font) { + return font.getFontPeer(); + } } static { @@ -434,24 +438,15 @@ private static final long serialVersionUID = -4206021311591459213L; /** - * Gets the peer of this Font. - * @return the peer of the Font. - * @since 1.1 - * @deprecated Font rendering is now platform independent. + * Gets the peer of this {@code Font}. + * + * @return the peer of the {@code Font}. */ - @Deprecated - public FontPeer getPeer(){ - return getPeer_NoClientCode(); - } - // NOTE: This method is called by privileged threads. - // We implement this functionality in a package-private method - // to insure that it cannot be overridden by client subclasses. - // DO NOT INVOKE CLIENT CODE ON THIS THREAD! @SuppressWarnings("deprecation") - final FontPeer getPeer_NoClientCode() { + private FontPeer getFontPeer() { if(peer == null) { Toolkit tk = Toolkit.getDefaultToolkit(); - this.peer = tk.getFontPeer(name, style); + peer = tk.getFontPeer(name, style); } return peer; }