--- old/src/java.desktop/macosx/classes/sun/lwawt/macosx/CMenuItem.java 2018-04-01 22:04:24.000000000 -0700 +++ new/src/java.desktop/macosx/classes/sun/lwawt/macosx/CMenuItem.java 2018-04-01 22:04:24.000000000 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2018, 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 @@ -129,16 +129,6 @@ execute(ptr -> nativeSetTooltip(ptr, text)); } -// @Override - public void enable() { - setEnabled(true); - } - -// @Override - public void disable() { - setEnabled(false); - } - public final boolean isEnabled() { return enabled.get(); } --- old/src/java.desktop/unix/classes/sun/awt/X11/XButtonPeer.java 2018-04-01 22:04:25.000000000 -0700 +++ new/src/java.desktop/unix/classes/sun/awt/X11/XButtonPeer.java 2018-04-01 22:04:25.000000000 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2018, 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 @@ -201,12 +201,6 @@ } /** - * DEPRECATED - */ - public Dimension minimumSize() { - return getMinimumSize(); - } - /** * This method is called from Toolkit Thread and so it should not call any * client code. */ --- old/src/java.desktop/unix/classes/sun/awt/X11/XChoicePeer.java 2018-04-01 22:04:26.000000000 -0700 +++ new/src/java.desktop/unix/classes/sun/awt/X11/XChoicePeer.java 2018-04-01 22:04:26.000000000 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2018, 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 @@ -678,13 +678,6 @@ repaint(); } - /** - * DEPRECATED: Replaced by add(String, int). - */ - public void addItem(String item, int index) { - add(item, index); - } - public void setFont(Font font) { super.setFont(font); helper.setFont(this.font); --- old/src/java.desktop/unix/classes/sun/awt/X11/XComponentPeer.java 2018-04-01 22:04:27.000000000 -0700 +++ new/src/java.desktop/unix/classes/sun/awt/X11/XComponentPeer.java 2018-04-01 22:04:27.000000000 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2018, 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 @@ -730,14 +730,6 @@ return Toolkit.getDefaultToolkit().checkImage(img, w, h, o); } - public Dimension preferredSize() { - return getPreferredSize(); - } - - public Dimension minimumSize() { - return getMinimumSize(); - } - public Insets getInsets() { return new Insets(0, 0, 0, 0); } @@ -748,15 +740,6 @@ public void endValidate() { } - - /** - * DEPRECATED: Replaced by getInsets(). - */ - - public Insets insets() { - return getInsets(); - } - // Returns true if we are inside begin/endLayout and // are waiting for native painting public boolean isPaintPending() { --- old/src/java.desktop/unix/classes/sun/awt/X11/XEmbedChildProxyPeer.java 2018-04-01 22:04:28.000000000 -0700 +++ new/src/java.desktop/unix/classes/sun/awt/X11/XEmbedChildProxyPeer.java 2018-04-01 22:04:28.000000000 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2018, 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 @@ -81,7 +81,6 @@ } public void setEnabled(boolean b) {} public void paint(Graphics g) {} - public void repaint(long tm, int x, int y, int width, int height) {} public void print(Graphics g) {} public void setBounds(int x, int y, int width, int height, int op) { // Unimplemeneted: Check for min/max hints for non-resizable @@ -269,51 +268,6 @@ */ public void layout() {} - /** - * DEPRECATED: Replaced by getPreferredSize(). - */ - public Dimension preferredSize() { - return getPreferredSize(); - } - - /** - * DEPRECATED: Replaced by getMinimumSize(). - */ - public Dimension minimumSize() { - return getMinimumSize(); - } - - /** - * DEPRECATED: Replaced by setVisible(boolean). - */ - public void show() { - setVisible(true); - } - - /** - * DEPRECATED: Replaced by setVisible(boolean). - */ - public void hide() { - setVisible(false); - } - - /** - * DEPRECATED: Replaced by setEnabled(boolean). - */ - public void enable() {} - - /** - * DEPRECATED: Replaced by setEnabled(boolean). - */ - public void disable() {} - - /** - * DEPRECATED: Replaced by setBounds(int, int, int, int). - */ - public void reshape(int x, int y, int width, int height) { - setBounds(x, y, width, height, SET_BOUNDS); - } - Window getTopLevel(Component comp) { while (comp != null && !(comp instanceof Window)) { comp = comp.getParent(); --- old/src/java.desktop/unix/classes/sun/awt/X11/XListPeer.java 2018-04-01 22:04:29.000000000 -0700 +++ new/src/java.desktop/unix/classes/sun/awt/X11/XListPeer.java 2018-04-01 22:04:29.000000000 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2018, 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 @@ -212,54 +212,32 @@ hsb.setValues(0, 0, 0, 0, HORIZ_SCROLL_AMT, HORIZ_SCROLL_AMT); } - /* New method name for 1.1 */ public void add(String item, int index) { addItem(item, index); } - /* New method name for 1.1 */ public void removeAll() { clear(); maxLength = 0; } - /* New method name for 1.1 */ public void setMultipleMode (boolean b) { setMultipleSelections(b); } - /* New method name for 1.1 */ - public Dimension getPreferredSize(int rows) { - return preferredSize(rows); - } - - /* New method name for 1.1 */ - public Dimension getMinimumSize(int rows) { - return minimumSize(rows); - } - - /** - * Minimum size. - */ - public Dimension minimumSize() { - return minimumSize(DEFAULT_VISIBLE_ROWS); + public Dimension getMinimumSize() { + return getMinimumSize(DEFAULT_VISIBLE_ROWS); } - /** - * return the preferredSize - */ - public Dimension preferredSize(int v) { - return minimumSize(v); + public Dimension getPreferredSize(int rows) { + return getMinimumSize(rows); } - /** - * return the minimumsize - */ - public Dimension minimumSize(int v) { + public Dimension getMinimumSize(int rows) { FontMetrics fm = getFontMetrics(getFont()); initFontMetrics(); return new Dimension(20 + fm.stringWidth("0123456789abcde"), - getItemHeight() * v + (2*MARGIN)); + getItemHeight() * rows + (2*MARGIN)); } /** --- old/src/java.desktop/unix/classes/sun/awt/X11/XMenuItemPeer.java 2018-04-01 22:04:30.000000000 -0700 +++ new/src/java.desktop/unix/classes/sun/awt/X11/XMenuItemPeer.java 2018-04-01 22:04:30.000000000 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2018, 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 @@ -165,22 +165,6 @@ repaintIfShowing(); } - /** - * DEPRECATED: Replaced by setEnabled(boolean). - * @see java.awt.peer.MenuItemPeer - */ - public void enable() { - setEnabled( true ); - } - - /** - * DEPRECATED: Replaced by setEnabled(boolean). - * @see java.awt.peer.MenuItemPeer - */ - public void disable() { - setEnabled( false ); - } - /************************************************ * * Access to target's fields --- old/src/java.desktop/unix/classes/sun/awt/X11/XPanelPeer.java 2018-04-01 22:04:31.000000000 -0700 +++ new/src/java.desktop/unix/classes/sun/awt/X11/XPanelPeer.java 2018-04-01 22:04:31.000000000 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2018, 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 @@ -126,13 +126,6 @@ } } - /** - * DEPRECATED: Replaced by getInsets(). - */ - public Insets insets() { - return getInsets(); - } - public void dispose() { if (embedder != null) { embedder.deinstall(); --- old/src/java.desktop/unix/classes/sun/awt/X11/XPopupMenuPeer.java 2018-04-01 22:04:32.000000000 -0700 +++ new/src/java.desktop/unix/classes/sun/awt/X11/XPopupMenuPeer.java 2018-04-01 22:04:32.000000000 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2018, 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 @@ -98,22 +98,6 @@ postPaintEvent(); } - /** - * DEPRECATED: Replaced by setEnabled(boolean). - * @see java.awt.peer.MenuItemPeer - */ - public void enable() { - setEnabled( true ); - } - - /** - * DEPRECATED: Replaced by setEnabled(boolean). - * @see java.awt.peer.MenuItemPeer - */ - public void disable() { - setEnabled( false ); - } - /* * From MenuPeer */ --- old/src/java.desktop/unix/classes/sun/awt/X11/XTextFieldPeer.java 2018-04-01 22:04:33.000000000 -0700 +++ new/src/java.desktop/unix/classes/sun/awt/X11/XTextFieldPeer.java 2018-04-01 22:04:33.000000000 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2018, 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 @@ -409,14 +409,6 @@ } } - /** - * DEPRECATED - */ - @Override - public Dimension minimumSize() { - return getMinimumSize(); - } - @Override public void setVisible(boolean b) { super.setVisible(b); --- old/src/java.desktop/unix/classes/sun/awt/X11/XWindowPeer.java 2018-04-01 22:04:34.000000000 -0700 +++ new/src/java.desktop/unix/classes/sun/awt/X11/XWindowPeer.java 2018-04-01 22:04:34.000000000 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2018, 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 @@ -557,13 +557,6 @@ oldState, newState)); } - /** - * DEPRECATED: Replaced by getInsets(). - */ - public Insets insets() { - return getInsets(); - } - boolean isAutoRequestFocus() { if (XToolkit.isToolkitThread()) { return AWTAccessor.getWindowAccessor().isAutoRequestFocus((Window)target); --- old/src/java.desktop/windows/classes/sun/awt/windows/WChoicePeer.java 2018-04-01 22:04:35.000000000 -0700 +++ new/src/java.desktop/windows/classes/sun/awt/windows/WChoicePeer.java 2018-04-01 22:04:35.000000000 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2018, 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 @@ -60,7 +60,7 @@ @Override public void add(String item, int index) { - addItem(item, index); + addItems(new String[] {item}, index); } @Override @@ -73,12 +73,6 @@ @Override public native void remove(int index); - /** - * DEPRECATED, but for now, called by add(String, int). - */ - public void addItem(String item, int index) { - addItems(new String[] {item}, index); - } public native void addItems(String[] items, int index); @Override --- old/src/java.desktop/windows/classes/sun/awt/windows/WComponentPeer.java 2018-04-01 22:04:36.000000000 -0700 +++ new/src/java.desktop/windows/classes/sun/awt/windows/WComponentPeer.java 2018-04-01 22:04:36.000000000 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2018, 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 @@ -914,13 +914,6 @@ public native void endValidate(); /** - * DEPRECATED - */ - public Dimension preferredSize() { - return getPreferredSize(); - } - - /** * register a DropTarget with this native peer */ --- old/src/java.desktop/windows/classes/sun/awt/windows/WListPeer.java 2018-04-01 22:04:37.000000000 -0700 +++ new/src/java.desktop/windows/classes/sun/awt/windows/WListPeer.java 2018-04-01 22:04:37.000000000 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2018, 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 @@ -54,34 +54,36 @@ return selected; } - /* New method name for 1.1 */ @Override public void add(String item, int index) { addItem(item, index); } - /* New method name for 1.1 */ @Override public void removeAll() { clear(); } - /* New method name for 1.1 */ @Override public void setMultipleMode (boolean b) { setMultipleSelections(b); } - /* New method name for 1.1 */ @Override public Dimension getPreferredSize(int rows) { - return preferredSize(rows); + if ( fm == null ) { + List li = (List)target; + fm = getFontMetrics( li.getFont() ); + } + Dimension d = getMinimumSize(rows); + d.width = Math.max(d.width, getMaxWidth() + 20); + return d; } - /* New method name for 1.1 */ @Override public Dimension getMinimumSize(int rows) { - return minimumSize(rows); + return new Dimension(20 + fm.stringWidth("0123456789abcde"), + (fm.getHeight() * rows) + 4); // include borders } private FontMetrics fm; @@ -104,21 +106,6 @@ public native void makeVisible(int index); public native void setMultipleSelections(boolean v); public native int getMaxWidth(); - - public Dimension preferredSize(int v) { - if ( fm == null ) { - List li = (List)target; - fm = getFontMetrics( li.getFont() ); - } - Dimension d = minimumSize(v); - d.width = Math.max(d.width, getMaxWidth() + 20); - return d; - } - public Dimension minimumSize(int v) { - return new Dimension(20 + fm.stringWidth("0123456789abcde"), - (fm.getHeight() * v) + 4); // include borders - } - // Toolkit & peer internals WListPeer(List target) { --- old/src/java.desktop/windows/classes/sun/awt/windows/WMenuItemPeer.java 2018-04-01 22:04:38.000000000 -0700 +++ new/src/java.desktop/windows/classes/sun/awt/windows/WMenuItemPeer.java 2018-04-01 22:04:38.000000000 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2018, 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 @@ -57,20 +57,6 @@ enable(b); } - /** - * DEPRECATED: Replaced by setEnabled(boolean). - */ - public void enable() { - enable(true); - } - - /** - * DEPRECATED: Replaced by setEnabled(boolean). - */ - public void disable() { - enable(false); - } - private void readShortcutLabel() { //Fix for 6288578: PIT. Windows: Shortcuts displayed for the menuitems in a popup menu WMenuPeer ancestor = parent; --- old/src/java.desktop/windows/classes/sun/awt/windows/WPanelPeer.java 2018-04-01 22:04:39.000000000 -0700 +++ new/src/java.desktop/windows/classes/sun/awt/windows/WPanelPeer.java 2018-04-01 22:04:39.000000000 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2018, 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 @@ -98,11 +98,4 @@ setForeground(c); } } - - /** - * DEPRECATED: Replaced by getInsets(). - */ - public Insets insets() { - return getInsets(); - } } --- old/src/java.desktop/windows/classes/sun/awt/windows/WScrollPanePeer.java 2018-04-01 22:04:40.000000000 -0700 +++ new/src/java.desktop/windows/classes/sun/awt/windows/WScrollPanePeer.java 2018-04-01 22:04:40.000000000 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2018, 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 @@ -71,10 +71,6 @@ // The unitIncrement is grabbed from the target as needed. } - @Override - public Insets insets() { - return getInsets(); - } private native void setInsets(); @Override --- old/src/java.desktop/windows/native/libawt/windows/awt_Choice.cpp 2018-04-01 22:04:41.000000000 -0700 +++ new/src/java.desktop/windows/native/libawt/windows/awt_Choice.cpp 2018-04-01 22:04:41.000000000 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2018, 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 @@ -152,7 +152,7 @@ jint height = env->GetIntField(target, AwtComponent::heightID); jobject dimension = JNU_CallMethodByName(env, NULL, peer, - "preferredSize", + "getPreferredSize", "()Ljava/awt/Dimension;").l; DASSERT(!safe_ExceptionOccurred(env)); if (env->ExceptionCheck()) goto done; @@ -334,7 +334,7 @@ jobject AwtChoice::PreferredItemSize(JNIEnv *env) { jobject dimension = JNU_CallMethodByName(env, NULL, GetPeer(env), - "preferredSize", + "getPreferredSize", "()Ljava/awt/Dimension;").l; DASSERT(!safe_ExceptionOccurred(env)); CHECK_NULL_RETURN(dimension, NULL); --- old/src/java.desktop/windows/native/libawt/windows/awt_List.cpp 2018-04-01 22:04:42.000000000 -0700 +++ new/src/java.desktop/windows/native/libawt/windows/awt_List.cpp 2018-04-01 22:04:42.000000000 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2018, 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 @@ -319,7 +319,7 @@ jobject AwtList::PreferredItemSize(JNIEnv *env) { jobject peer = GetPeer(env); - jobject dimension = JNU_CallMethodByName(env, NULL, peer, "preferredSize", + jobject dimension = JNU_CallMethodByName(env, NULL, peer, "getPreferredSize", "(I)Ljava/awt/Dimension;", 1).l;