--- old/src/share/classes/com/sun/java/swing/plaf/gtk/GTKFileChooserUI.java 2014-07-02 22:59:59.000000000 -0700 +++ new/src/share/classes/com/sun/java/swing/plaf/gtk/GTKFileChooserUI.java 2014-07-02 22:59:58.000000000 -0700 @@ -82,14 +82,14 @@ private String renameFileErrorTitle = null; private String renameFileErrorText = null; - private JComboBox filterComboBox; + private JComboBox filterComboBox; private FilterComboBoxModel filterComboBoxModel; // From Motif private JPanel rightPanel; - private JList directoryList; - private JList fileList; + private JList directoryList; + private JList fileList; private JLabel pathField; private JTextField fileNameTextField; @@ -116,7 +116,7 @@ private int pathLabelMnemonic = 0; private int filterLabelMnemonic = 0; - private JComboBox directoryComboBox; + private JComboBox directoryComboBox; private DirectoryComboBoxModel directoryComboBoxModel; private Action directoryComboBoxAction = new DirectoryComboBoxAction(); private JPanel bottomButtonPanel; @@ -153,7 +153,7 @@ } int mode = fc.getFileSelectionMode(); - JList list = mode == JFileChooser.DIRECTORIES_ONLY ? + JList list = mode == JFileChooser.DIRECTORIES_ONLY ? directoryList : fileList; Object[] files = list.getSelectedValues(); int len = files.length; @@ -369,8 +369,8 @@ } class DoubleClickListener extends MouseAdapter { - JList list; - public DoubleClickListener(JList list) { + JList list; + public DoubleClickListener(JList list) { this.list = list; } @@ -413,7 +413,7 @@ } } - protected MouseListener createDoubleClickListener(JFileChooser fc, JList list) { + protected MouseListener createDoubleClickListener(JFileChooser fc, JList list) { return new DoubleClickListener(list); } @@ -423,7 +423,7 @@ public void valueChanged(ListSelectionEvent e) { if (!e.getValueIsAdjusting()) { JFileChooser chooser = getFileChooser(); - JList list = (JList) e.getSource(); + JList list = (JList) e.getSource(); if (chooser.isMultiSelectionEnabled()) { File[] files = null; @@ -554,7 +554,7 @@ 0, 0) { public void layoutContainer(Container target) { super.layoutContainer(target); - JComboBox comboBox = directoryComboBox; + JComboBox comboBox = directoryComboBox; if (comboBox.getWidth() > target.getWidth()) { comboBox.setBounds(0, comboBox.getY(), target.getWidth(), comboBox.getHeight()); @@ -565,7 +565,7 @@ comboBoxPanel.setName("GTKFileChooser.directoryComboBoxPanel"); // CurrentDir ComboBox directoryComboBoxModel = createDirectoryComboBoxModel(fc); - directoryComboBox = new JComboBox(directoryComboBoxModel); + directoryComboBox = new JComboBox<>(directoryComboBoxModel); directoryComboBox.setName("GTKFileChooser.directoryComboBox"); directoryComboBox.putClientProperty( "JComboBox.lightweightKeyboardNavigation", "Lightweight" ); directoryComboBox.addActionListener(directoryComboBoxAction); @@ -710,7 +710,7 @@ filterComboBoxModel = createFilterComboBoxModel(); fc.addPropertyChangeListener(filterComboBoxModel); - filterComboBox = new JComboBox(filterComboBoxModel); + filterComboBox = new JComboBox<>(filterComboBoxModel); filterComboBox.setRenderer(createFilterComboBoxRenderer()); filterLabel.setLabelFor(filterComboBox); @@ -851,7 +851,7 @@ } protected JScrollPane createFilesList() { - fileList = new JList(); + fileList = new JList<>(); fileList.setName("GTKFileChooser.fileList"); fileList.putClientProperty(AccessibleContext.ACCESSIBLE_NAME_PROPERTY, filesLabelText); @@ -877,7 +877,7 @@ } protected JScrollPane createDirectoryList() { - directoryList = new JList(); + directoryList = new JList<>(); directoryList.setName("GTKFileChooser.directoryList"); directoryList.putClientProperty(AccessibleContext.ACCESSIBLE_NAME_PROPERTY, foldersLabelText); align(directoryList); @@ -930,7 +930,7 @@ } @SuppressWarnings("serial") // Superclass is not serializable across versions - protected class GTKDirectoryListModel extends AbstractListModel implements ListDataListener { + protected class GTKDirectoryListModel extends AbstractListModel implements ListDataListener { File curDir; public GTKDirectoryListModel() { getModel().addListDataListener(this); @@ -941,7 +941,8 @@ return getModel().getDirectories().size() + 1; } - public Object getElementAt(int index) { + @Override + public File getElementAt(int index) { return index > 0 ? getModel().getDirectories().elementAt(index - 1): curDir; } @@ -974,7 +975,7 @@ } @SuppressWarnings("serial") // Superclass is not serializable across versions - protected class GTKFileListModel extends AbstractListModel implements ListDataListener { + protected class GTKFileListModel extends AbstractListModel implements ListDataListener { public GTKFileListModel() { getModel().addListDataListener(this); } @@ -991,7 +992,8 @@ return getModel().getFiles().indexOf(o); } - public Object getElementAt(int index) { + @Override + public File getElementAt(int index) { return getModel().getFiles().elementAt(index); } @@ -1019,7 +1021,7 @@ @SuppressWarnings("serial") // Superclass is not serializable across versions protected class FileCellRenderer extends DefaultListCellRenderer { - public Component getListCellRendererComponent(JList list, Object value, int index, + public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); @@ -1033,7 +1035,7 @@ @SuppressWarnings("serial") // Superclass is not serializable across versions protected class DirectoryCellRenderer extends DefaultListCellRenderer { - public Component getListCellRendererComponent(JList list, Object value, int index, + public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); @@ -1095,7 +1097,7 @@ * Data model for a type-face selection combo-box. */ @SuppressWarnings("serial") // Superclass is not serializable across versions - protected class DirectoryComboBoxModel extends AbstractListModel implements ComboBoxModel { + protected class DirectoryComboBoxModel extends AbstractListModel implements ComboBoxModel { Vector directories = new Vector(); File selectedDirectory = null; JFileChooser chooser = getFileChooser(); @@ -1163,7 +1165,8 @@ return directories.size(); } - public Object getElementAt(int index) { + @Override + public File getElementAt(int index) { return directories.elementAt(index); } } @@ -1314,7 +1317,7 @@ return name; } - public Component getListCellRendererComponent(JList list, Object value, + public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { @@ -1345,8 +1348,8 @@ * Data model for filter combo-box. */ @SuppressWarnings("serial") // JDK implementation class - protected class FilterComboBoxModel extends AbstractListModel - implements ComboBoxModel, PropertyChangeListener { + protected class FilterComboBoxModel extends AbstractListModel + implements ComboBoxModel, PropertyChangeListener { protected FileFilter[] filters; protected FilterComboBoxModel() { @@ -1400,7 +1403,8 @@ } } - public Object getElementAt(int index) { + @Override + public FileFilter getElementAt(int index) { if (index > getSize() - 1) { // This shouldn't happen. Try to recover gracefully. return getFileChooser().getFileFilter(); --- old/src/share/classes/com/sun/java/swing/plaf/gtk/GTKIconFactory.java 2014-07-02 23:00:01.000000000 -0700 +++ new/src/share/classes/com/sun/java/swing/plaf/gtk/GTKIconFactory.java 2014-07-02 23:00:00.000000000 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 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 @@ -151,7 +151,7 @@ private static class DelegatingIcon extends SynthIcon implements UIResource { - private static final Class[] PARAM_TYPES = new Class[] { + private static final Class[] PARAM_TYPES = new Class[] { SynthContext.class, Graphics.class, int.class, int.class, int.class, int.class, int.class }; @@ -190,7 +190,7 @@ return (Method)method; } - protected Class[] getMethodParamTypes() { + protected Class[] getMethodParamTypes() { return PARAM_TYPES; } @@ -262,7 +262,7 @@ // we create a unique icon per ToolBar and lookup the style for the // HandleBox. private static class ToolBarHandleIcon extends DelegatingIcon { - private static final Class[] PARAM_TYPES = new Class[] { + private static final Class[] PARAM_TYPES = new Class[] { SynthContext.class, Graphics.class, int.class, int.class, int.class, int.class, int.class, Orientation.class, }; @@ -273,7 +273,7 @@ super(TOOL_BAR_HANDLE_ICON); } - protected Class[] getMethodParamTypes() { + protected Class[] getMethodParamTypes() { return PARAM_TYPES; } @@ -323,7 +323,7 @@ } private static class MenuArrowIcon extends DelegatingIcon { - private static final Class[] PARAM_TYPES = new Class[] { + private static final Class[] PARAM_TYPES = new Class[] { SynthContext.class, Graphics.class, int.class, int.class, int.class, int.class, int.class, ArrowType.class, }; @@ -332,7 +332,7 @@ super(MENU_ARROW_ICON); } - protected Class[] getMethodParamTypes() { + protected Class[] getMethodParamTypes() { return PARAM_TYPES; } --- old/src/share/classes/com/sun/java/swing/plaf/gtk/GTKStyle.java 2014-07-02 23:00:02.000000000 -0700 +++ new/src/share/classes/com/sun/java/swing/plaf/gtk/GTKStyle.java 2014-07-02 23:00:02.000000000 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 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 @@ -1086,13 +1086,13 @@ public Object createValue(UIDefaults table) { try { - Class c = Class.forName(className, true,Thread.currentThread(). - getContextClassLoader()); + Class c = Class.forName(className, true,Thread.currentThread(). + getContextClassLoader()); if (methodName == null) { return c.newInstance(); } - Method m = c.getMethod(methodName, (Class[])null); + Method m = c.getMethod(methodName, (Class[])null); return m.invoke(c, (Object[])null); } catch (ClassNotFoundException cnfe) { --- old/src/share/classes/com/sun/java/swing/plaf/gtk/Metacity.java 2014-07-02 23:00:05.000000000 -0700 +++ new/src/share/classes/com/sun/java/swing/plaf/gtk/Metacity.java 2014-07-02 23:00:04.000000000 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 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 @@ -764,7 +764,7 @@ } else { return; } - Map gm = getFrameGeometry(); + Map gm = getFrameGeometry(); int w = titlePane.getWidth(); int h = titlePane.getHeight(); @@ -828,11 +828,11 @@ } } // end TitlePaneLayout - protected Map getFrameGeometry() { + protected Map getFrameGeometry() { return frameGeometry; } - protected void setFrameGeometry(JComponent titlePane, Map gm) { + protected void setFrameGeometry(JComponent titlePane, Map gm) { this.frameGeometry = gm; if (getInt("top_height") == 0 && titlePane != null) { gm.put("top_height", Integer.valueOf(titlePane.getHeight())); @@ -1501,7 +1501,7 @@ "name", getStringAttr(frame, "style") }); if (frame_style != null) { - Map gm = frameGeometries.get(getStringAttr(frame_style, "geometry")); + Map gm = frameGeometries.get(getStringAttr(frame_style, "geometry")); setFrameGeometry(titlePane, gm); } --- old/src/share/classes/com/sun/java/swing/plaf/gtk/XColors.java 2014-07-02 23:00:07.000000000 -0700 +++ new/src/share/classes/com/sun/java/swing/plaf/gtk/XColors.java 2014-07-02 23:00:06.000000000 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 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 @@ -34,7 +34,7 @@ */ class XColors { - private static class XColor implements Comparable { + private static class XColor implements Comparable { String name; int red; @@ -52,10 +52,8 @@ return new ColorUIResource(red, green, blue); } - public int compareTo(Object o) { - XColor other = (XColor)o; - - return name.compareTo(other.name); + public int compareTo(XColor o) { + return name.compareTo(o.name); } } --- old/src/share/classes/com/sun/java/swing/plaf/motif/MotifComboBoxUI.java 2014-07-02 23:00:09.000000000 -0700 +++ new/src/share/classes/com/sun/java/swing/plaf/motif/MotifComboBoxUI.java 2014-07-02 23:00:08.000000000 -0700 @@ -97,7 +97,7 @@ @SuppressWarnings("serial") // Superclass is not serializable across versions protected class MotifComboPopup extends BasicComboPopup { - public MotifComboPopup( JComboBox comboBox ) { + public MotifComboPopup( JComboBox comboBox ) { super( comboBox ); } @@ -177,7 +177,7 @@ } public void paintCurrentValue(Graphics g,Rectangle bounds,boolean hasFocus) { - ListCellRenderer renderer = comboBox.getRenderer(); + ListCellRenderer renderer = comboBox.getRenderer(); Component c; Dimension d; c = renderer.getListCellRendererComponent(listBox, comboBox.getSelectedItem(), -1, false, false); --- old/src/share/classes/com/sun/java/swing/plaf/motif/MotifFileChooserUI.java 2014-07-02 23:00:10.000000000 -0700 +++ new/src/share/classes/com/sun/java/swing/plaf/motif/MotifFileChooserUI.java 2014-07-02 23:00:10.000000000 -0700 @@ -342,7 +342,7 @@ leftPanel.add(l); @SuppressWarnings("serial") // anonymous class - JComboBox tmp2 = new JComboBox() { + JComboBox tmp2 = new JComboBox() { public Dimension getMaximumSize() { Dimension d = super.getMaximumSize(); d.height = getPreferredSize().height; @@ -655,7 +655,7 @@ @SuppressWarnings("serial") // Superclass is not serializable across versions protected class FileCellRenderer extends DefaultListCellRenderer { - public Component getListCellRendererComponent(JList list, Object value, int index, + public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); @@ -667,7 +667,7 @@ @SuppressWarnings("serial") // Superclass is not serializable across versions protected class DirectoryCellRenderer extends DefaultListCellRenderer { - public Component getListCellRendererComponent(JList list, Object value, int index, + public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); @@ -778,7 +778,7 @@ */ @SuppressWarnings("serial") // Superclass is not serializable across versions public class FilterComboBoxRenderer extends DefaultListCellRenderer { - public Component getListCellRendererComponent(JList list, + public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { --- old/src/share/classes/com/sun/java/swing/plaf/windows/DesktopProperty.java 2014-07-02 23:00:12.000000000 -0700 +++ new/src/share/classes/com/sun/java/swing/plaf/windows/DesktopProperty.java 2014-07-02 23:00:12.000000000 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 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 @@ -102,7 +102,7 @@ private static void updateAllUIs() { // Check if the current UI is WindowsLookAndfeel and flush the XP style map. // Note: Change the package test if this class is moved to a different package. - Class uiClass = UIManager.getLookAndFeel().getClass(); + Class uiClass = UIManager.getLookAndFeel().getClass(); if (uiClass.getPackage().equals(DesktopProperty.class.getPackage())) { XPStyle.invalidateStyle(); } --- old/src/share/classes/com/sun/java/swing/plaf/windows/TMSchema.java 2014-07-02 23:00:14.000000000 -0700 +++ new/src/share/classes/com/sun/java/swing/plaf/windows/TMSchema.java 2014-07-02 23:00:14.000000000 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 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 @@ -446,7 +446,7 @@ initStates(); } - Enum[] states = stateMap.get(part); + Enum[] states = stateMap.get(part); if (states != null) { for (int i = 0; i < states.length; i++) { if (state == states[i]) { @@ -504,10 +504,10 @@ TRANSITIONDURATIONS(Integer.class, 6000); - private final Class type; + private final Class type; private final int value; - private Prop(Class type, int value) { + private Prop(Class type, int value) { this.type = type; this.value = value; } --- old/src/share/classes/com/sun/java/swing/plaf/windows/WindowsComboBoxUI.java 2014-07-02 23:00:16.000000000 -0700 +++ new/src/share/classes/com/sun/java/swing/plaf/windows/WindowsComboBoxUI.java 2014-07-02 23:00:16.000000000 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 @@ -60,7 +60,7 @@ private static final MouseListener rolloverListener = new MouseAdapter() { private void handleRollover(MouseEvent e, boolean isRollover) { - JComboBox comboBox = getComboBox(e); + JComboBox comboBox = getComboBox(e); WindowsComboBoxUI comboBoxUI = getWindowsComboBoxUI(e); if (comboBox == null || comboBoxUI == null) { return; @@ -88,9 +88,9 @@ handleRollover(e, false); } - private JComboBox getComboBox(MouseEvent event) { + private JComboBox getComboBox(MouseEvent event) { Object source = event.getSource(); - JComboBox rv = null; + JComboBox rv = null; if (source instanceof JComboBox) { rv = (JComboBox) source; } else if (source instanceof XPComboBoxButton) { @@ -101,7 +101,7 @@ } private WindowsComboBoxUI getWindowsComboBoxUI(MouseEvent event) { - JComboBox comboBox = getComboBox(event); + JComboBox comboBox = getComboBox(event); WindowsComboBoxUI rv = null; if (comboBox != null && comboBox.getUI() instanceof WindowsComboBoxUI) { @@ -122,7 +122,7 @@ && (source = e.getSource()) instanceof JComboBox && ((JComboBox) source).getUI() instanceof WindowsComboBoxUI) { - JComboBox comboBox = (JComboBox) source; + JComboBox comboBox = (JComboBox) source; WindowsComboBoxUI comboBoxUI = (WindowsComboBoxUI) comboBox.getUI(); if (comboBoxUI.arrowButton instanceof XPComboBoxButton) { ((XPComboBoxButton) comboBoxUI.arrowButton).setPart( @@ -273,7 +273,7 @@ // color for currentValue is the same as for any other item // mostly copied from javax.swing.plaf.basic.BasicComboBoxUI.paintCurrentValue - ListCellRenderer renderer = comboBox.getRenderer(); + ListCellRenderer renderer = comboBox.getRenderer(); Component c; if ( hasFocus && !isPopupVisible(comboBox) ) { c = renderer.getListCellRendererComponent( @@ -384,7 +384,7 @@ * @since 1.6 */ @Override - protected ListCellRenderer createRenderer() { + protected ListCellRenderer createRenderer() { XPStyle xp = XPStyle.getXP(); if (xp != null && xp.isSkinDefined(comboBox, Part.CP_READONLY)) { return new WindowsComboBoxRenderer(); @@ -463,7 +463,7 @@ @SuppressWarnings("serial") // Superclass is not serializable across versions protected class WindowsComboPopup extends BasicComboPopup { - public WindowsComboPopup( JComboBox cBox ) { + public WindowsComboPopup( JComboBox cBox ) { super( cBox ); } @@ -523,7 +523,7 @@ */ @Override public Component getListCellRendererComponent( - JList list, + JList list, Object value, int index, boolean isSelected, --- old/src/share/classes/com/sun/java/swing/plaf/windows/WindowsFileChooserUI.java 2014-07-02 23:00:18.000000000 -0700 +++ new/src/share/classes/com/sun/java/swing/plaf/windows/WindowsFileChooserUI.java 2014-07-02 23:00:18.000000000 -0700 @@ -191,7 +191,7 @@ return WindowsFileChooserUI.this.getNewFolderAction(); } - public MouseListener createDoubleClickListener(JList list) { + public MouseListener createDoubleClickListener(JList list) { return WindowsFileChooserUI.this.createDoubleClickListener(getFileChooser(), list); } @@ -994,7 +994,7 @@ @SuppressWarnings("serial") // Superclass is not serializable across versions class DirectoryComboBoxRenderer extends DefaultListCellRenderer { IndentIcon ii = new IndentIcon(); - public Component getListCellRendererComponent(JList list, Object value, + public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { @@ -1184,7 +1184,7 @@ */ @SuppressWarnings("serial") // Superclass is not serializable across versions public class FilterComboBoxRenderer extends DefaultListCellRenderer { - public Component getListCellRendererComponent(JList list, + public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { --- old/src/share/classes/com/sun/java/swing/plaf/windows/XPStyle.java 2014-07-02 23:00:20.000000000 -0700 +++ new/src/share/classes/com/sun/java/swing/plaf/windows/XPStyle.java 2014-07-02 23:00:20.000000000 -0700 @@ -349,7 +349,7 @@ // special casing for comboboxes. // there may be more special cases in the future if(c instanceof JComboBox) { - JComboBox cb = (JComboBox)c; + JComboBox cb = (JComboBox)c; // note. in the future this should be replaced with a call // to BasicLookAndFeel.getUIOfType() if(cb.getUI() instanceof WindowsComboBoxUI) { --- old/src/share/classes/javax/swing/JComboBox.java 2014-07-02 23:00:22.000000000 -0700 +++ new/src/share/classes/javax/swing/JComboBox.java 2014-07-02 23:00:22.000000000 -0700 @@ -1100,7 +1100,7 @@ } } - private boolean isListener(Class c, ActionListener a) { + private boolean isListener(Class c, ActionListener a) { boolean isListener = false; Object[] listeners = listenerList.getListenerList(); for (int i = listeners.length-2; i>=0; i-=2) { @@ -1530,11 +1530,11 @@ * @return an int equal to the selected row, where 0 is the * first item and -1 is none. */ - int selectionForKey(char aKey,ComboBoxModel aModel); + int selectionForKey(char aKey,ComboBoxModel aModel); } class DefaultKeySelectionManager implements KeySelectionManager, Serializable { - public int selectionForKey(char aKey,ComboBoxModel aModel) { + public int selectionForKey(char aKey,ComboBoxModel aModel) { int i,c; int currentSelection = -1; Object selectedItem = aModel.getSelectedItem(); @@ -1656,7 +1656,7 @@ implements AccessibleAction, AccessibleSelection { - private JList popupList; // combo box popup list + private JList popupList; // combo box popup list private Accessible previousSelectedAccessible = null; /** @@ -1980,7 +1980,7 @@ a instanceof javax.swing.plaf.basic.ComboPopup) { // get the popup list - JList list = ((javax.swing.plaf.basic.ComboPopup)a).getList(); + JList list = ((javax.swing.plaf.basic.ComboPopup)a).getList(); // return the i-th selection in the popup list AccessibleContext ac = list.getAccessibleContext(); --- old/src/share/classes/javax/swing/JSlider.java 2014-07-02 23:00:25.000000000 -0700 +++ new/src/share/classes/javax/swing/JSlider.java 2014-07-02 23:00:24.000000000 -0700 @@ -138,7 +138,7 @@ /** * {@code Dictionary} of what labels to draw at which values */ - private Dictionary labelTable; + private Dictionary labelTable; /** @@ -769,10 +769,10 @@ } // Check that there is a label with such image - Enumeration elements = labelTable.elements(); + Enumeration elements = labelTable.elements(); while (elements.hasMoreElements()) { - Component component = (Component) elements.nextElement(); + JComponent component = elements.nextElement(); if (component instanceof JLabel) { JLabel label = (JLabel) component; @@ -793,7 +793,7 @@ * @return the Dictionary containing labels and * where to draw them */ - public Dictionary getLabelTable() { + public Dictionary getLabelTable() { /* if ( labelTable == null && getMajorTickSpacing() > 0 ) { setLabelTable( createStandardLabels( getMajorTickSpacing() ) ); @@ -826,8 +826,8 @@ * attribute: visualUpdate true * description: Specifies what labels will be drawn for any given value. */ - public void setLabelTable( Dictionary labels ) { - Dictionary oldTable = labelTable; + public void setLabelTable( Dictionary labels ) { + Dictionary oldTable = labelTable; labelTable = labels; updateLabelUIs(); firePropertyChange("labelTable", oldTable, labelTable ); @@ -848,25 +848,25 @@ * @see JComponent#updateUI */ protected void updateLabelUIs() { - Dictionary labelTable = getLabelTable(); + Dictionary labelTable = getLabelTable(); if (labelTable == null) { return; } - Enumeration labels = labelTable.keys(); + Enumeration labels = labelTable.keys(); while ( labels.hasMoreElements() ) { - JComponent component = (JComponent) labelTable.get(labels.nextElement()); + JComponent component = labelTable.get(labels.nextElement()); component.updateUI(); component.setSize(component.getPreferredSize()); } } private void updateLabelSizes() { - Dictionary labelTable = getLabelTable(); + Dictionary labelTable = getLabelTable(); if (labelTable != null) { - Enumeration labels = labelTable.elements(); + Enumeration labels = labelTable.elements(); while (labels.hasMoreElements()) { - JComponent component = (JComponent) labels.nextElement(); + JComponent component = labels.nextElement(); component.setSize(component.getPreferredSize()); } } @@ -894,7 +894,7 @@ * @throws IllegalArgumentException if {@code increment} is less than or * equal to zero */ - public Hashtable createStandardLabels( int increment ) { + public Hashtable createStandardLabels( int increment ) { return createStandardLabels( increment, getMinimum() ); } @@ -922,7 +922,7 @@ * out of range, or if {@code increment} is less than or equal * to zero */ - public Hashtable createStandardLabels( int increment, int start ) { + public Hashtable createStandardLabels( int increment, int start ) { if ( start > getMaximum() || start < getMinimum() ) { throw new IllegalArgumentException( "Slider label start point out of range." ); } @@ -931,7 +931,7 @@ throw new IllegalArgumentException( "Label incremement must be > 0" ); } - class SmartHashtable extends Hashtable implements PropertyChangeListener { + class SmartHashtable extends Hashtable implements PropertyChangeListener { int increment = 0; int start = 0; boolean startAtMin = false; @@ -978,13 +978,13 @@ if ( e.getPropertyName().equals( "minimum" ) || e.getPropertyName().equals( "maximum" ) ) { - Enumeration keys = getLabelTable().keys(); - Hashtable hashtable = new Hashtable(); + Enumeration keys = getLabelTable().keys(); + Hashtable hashtable = new Hashtable<>(); // Save the labels that were added by the developer while ( keys.hasMoreElements() ) { - Object key = keys.nextElement(); - Object value = labelTable.get(key); + Integer key = keys.nextElement(); + JComponent value = labelTable.get(key); if ( !(value instanceof LabelUIResource) ) { hashtable.put( key, value ); } @@ -996,7 +996,7 @@ // Add the saved labels keys = hashtable.keys(); while ( keys.hasMoreElements() ) { - Object key = keys.nextElement(); + Integer key = keys.nextElement(); put( key, hashtable.get( key ) ); } @@ -1013,7 +1013,7 @@ SmartHashtable table = new SmartHashtable( increment, start ); - Dictionary labelTable = getLabelTable(); + Dictionary labelTable = getLabelTable(); if (labelTable != null && (labelTable instanceof PropertyChangeListener)) { removePropertyChangeListener((PropertyChangeListener) labelTable); --- old/src/share/classes/javax/swing/plaf/ComboBoxUI.java 2014-07-02 23:00:27.000000000 -0700 +++ new/src/share/classes/javax/swing/plaf/ComboBoxUI.java 2014-07-02 23:00:26.000000000 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 @@ -38,15 +38,15 @@ /** * Set the visibility of the popup */ - public abstract void setPopupVisible( JComboBox c, boolean v ); + public abstract void setPopupVisible( JComboBox c, boolean v ); /** * Determine the visibility of the popup */ - public abstract boolean isPopupVisible( JComboBox c ); + public abstract boolean isPopupVisible( JComboBox c ); /** * Determine whether or not the combo box itself is traversable */ - public abstract boolean isFocusTraversable( JComboBox c ); + public abstract boolean isFocusTraversable( JComboBox c ); } --- old/src/share/classes/javax/swing/plaf/LayerUI.java 2014-07-02 23:00:28.000000000 -0700 +++ new/src/share/classes/javax/swing/plaf/LayerUI.java 2014-07-02 23:00:28.000000000 -0700 @@ -610,7 +610,8 @@ * baseline */ public int getBaseline(JComponent c, int width, int height) { - JLayer l = (JLayer) c; + @SuppressWarnings("unchecked") + JLayer l = (JLayer) c; if (l.getView() != null) { return l.getView().getBaseline(width, height); } @@ -627,7 +628,8 @@ * size changes */ public Component.BaselineResizeBehavior getBaselineResizeBehavior(JComponent c) { - JLayer l = (JLayer) c; + @SuppressWarnings("unchecked") + JLayer l = (JLayer) c; if (l.getView() != null) { return l.getView().getBaselineResizeBehavior(); } @@ -659,7 +661,8 @@ * @return preferred size for the passed {@code JLayer} */ public Dimension getPreferredSize(JComponent c) { - JLayer l = (JLayer) c; + @SuppressWarnings("unchecked") + JLayer l = (JLayer) c; Component view = l.getView(); if (view != null) { return view.getPreferredSize(); @@ -676,7 +679,8 @@ * @return minimal size for the passed {@code JLayer} */ public Dimension getMinimumSize(JComponent c) { - JLayer l = (JLayer) c; + @SuppressWarnings("unchecked") + JLayer l = (JLayer) c; Component view = l.getView(); if (view != null) { return view.getMinimumSize(); @@ -693,7 +697,8 @@ * @return maximum size for the passed {@code JLayer} */ public Dimension getMaximumSize(JComponent c) { - JLayer l = (JLayer) c; + @SuppressWarnings("unchecked") + JLayer l = (JLayer) c; Component view = l.getView(); if (view != null) { return view.getMaximumSize(); --- old/src/share/classes/javax/swing/plaf/ListUI.java 2014-07-02 23:00:30.000000000 -0700 +++ new/src/share/classes/javax/swing/plaf/ListUI.java 2014-07-02 23:00:30.000000000 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 @@ -50,7 +50,7 @@ * @return the cell index closest to the given location, or {@code -1} * @throws NullPointerException if {@code location} is null */ - public abstract int locationToIndex(JList list, Point location); + public abstract int locationToIndex(JList list, Point location); /** @@ -62,7 +62,7 @@ * @param index the cell index * @return the origin of the cell, or {@code null} */ - public abstract Point indexToLocation(JList list, int index); + public abstract Point indexToLocation(JList list, int index); /** @@ -80,5 +80,5 @@ * @param index2 the second index in the range * @return the bounding rectangle for the range of cells, or {@code null} */ - public abstract Rectangle getCellBounds(JList list, int index1, int index2); + public abstract Rectangle getCellBounds(JList list, int index1, int index2); } --- old/src/share/classes/javax/swing/plaf/basic/BasicComboBoxEditor.java 2014-07-02 23:00:32.000000000 -0700 +++ new/src/share/classes/javax/swing/plaf/basic/BasicComboBoxEditor.java 2014-07-02 23:00:32.000000000 -0700 @@ -100,7 +100,7 @@ // Must take the value from the editor and get the value and cast it to the new type. Class cls = oldValue.getClass(); try { - Method method = MethodUtil.getMethod(cls, "valueOf", new Class[]{String.class}); + Method method = MethodUtil.getMethod(cls, "valueOf", new Class[]{String.class}); newValue = MethodUtil.invoke(method, oldValue, new Object[] { editor.getText()}); } catch (Exception ex) { // Fail silently and return the newValue (a String object) --- old/src/share/classes/javax/swing/plaf/basic/BasicComboBoxRenderer.java 2014-07-02 23:00:34.000000000 -0700 +++ new/src/share/classes/javax/swing/plaf/basic/BasicComboBoxRenderer.java 2014-07-02 23:00:34.000000000 -0700 @@ -49,7 +49,7 @@ */ @SuppressWarnings("serial") // Same-version serialization only public class BasicComboBoxRenderer extends JLabel -implements ListCellRenderer, Serializable { +implements ListCellRenderer, Serializable { /** * An empty Border. This field might not be used. To change the @@ -88,8 +88,8 @@ return size; } - public Component getListCellRendererComponent( - JList list, + @Override + public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, --- old/src/share/classes/javax/swing/plaf/basic/BasicComboBoxUI.java 2014-07-02 23:00:37.000000000 -0700 +++ new/src/share/classes/javax/swing/plaf/basic/BasicComboBoxUI.java 2014-07-02 23:00:36.000000000 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 @@ -61,7 +61,7 @@ * @author Mark Davidson */ public class BasicComboBoxUI extends ComboBoxUI { - protected JComboBox comboBox; + protected JComboBox comboBox; /** * This protected field is implementation specific. Do not access directly * or override. @@ -74,7 +74,7 @@ private static final String IS_TABLE_CELL_EDITOR = "JComboBox.isTableCellEditor"; // This list is for drawing the current item in the combo box. - protected JList listBox; + protected JList listBox; // Used to render the currently selected item in the combo box. // It doesn't have anything to do with the popup's rendering. @@ -203,8 +203,9 @@ protected Insets padding; // Used for calculating the default size. - private static ListCellRenderer getDefaultListCellRenderer() { - ListCellRenderer renderer = (ListCellRenderer)AppContext. + private static ListCellRenderer getDefaultListCellRenderer() { + @SuppressWarnings("unchecked") + ListCellRenderer renderer = (ListCellRenderer)AppContext. getAppContext().get(COMBO_UI_LIST_CELL_RENDERER_KEY); if (renderer == null) { @@ -245,7 +246,9 @@ public void installUI( JComponent c ) { isMinimumSizeDirty = true; - comboBox = (JComboBox)c; + @SuppressWarnings("unchecked") + JComboBox tmp = (JComboBox)c; + comboBox = tmp; installDefaults(); popup = createPopup(); listBox = popup.getList(); @@ -508,7 +511,7 @@ * @return a ListCellRender used for the combo box * @see javax.swing.JComboBox#setRenderer */ - protected ListCellRenderer createRenderer() { + protected ListCellRenderer createRenderer() { return new BasicComboBoxRenderer.UIResource(); } @@ -865,14 +868,14 @@ /** * Tells if the popup is visible or not. */ - public boolean isPopupVisible( JComboBox c ) { + public boolean isPopupVisible( JComboBox c ) { return popup.isVisible(); } /** * Hides the popup. */ - public void setPopupVisible( JComboBox c, boolean v ) { + public void setPopupVisible( JComboBox c, boolean v ) { if ( v ) { popup.show(); } else { @@ -884,7 +887,7 @@ * Determines if the JComboBox is focus traversable. If the JComboBox is editable * this returns false, otherwise it returns true. */ - public boolean isFocusTraversable( JComboBox c ) { + public boolean isFocusTraversable( JComboBox c ) { return !comboBox.isEditable(); } @@ -956,7 +959,7 @@ Insets insets = c.getInsets(); height = height - insets.top - insets.bottom; if (!comboBox.isEditable()) { - ListCellRenderer renderer = comboBox.getRenderer(); + ListCellRenderer renderer = comboBox.getRenderer(); if (renderer == null) { renderer = new DefaultListCellRenderer(); } @@ -1013,7 +1016,7 @@ return editor.getBaselineResizeBehavior(); } else if (sameBaseline) { - ListCellRenderer renderer = comboBox.getRenderer(); + ListCellRenderer renderer = comboBox.getRenderer(); if (renderer == null) { renderer = new DefaultListCellRenderer(); } @@ -1205,7 +1208,7 @@ * Paints the currently selected item. */ public void paintCurrentValue(Graphics g,Rectangle bounds,boolean hasFocus) { - ListCellRenderer renderer = comboBox.getRenderer(); + ListCellRenderer renderer = comboBox.getRenderer(); Component c; if ( hasFocus && !isPopupVisible(comboBox) ) { @@ -1322,7 +1325,7 @@ } Dimension result = new Dimension(); - ListCellRenderer renderer = comboBox.getRenderer(); + ListCellRenderer renderer = comboBox.getRenderer(); if (renderer == null) { renderer = new DefaultListCellRenderer(); } @@ -1338,7 +1341,7 @@ } else { // Calculate the dimension by iterating over all the elements in the combo // box list. - ComboBoxModel model = comboBox.getModel(); + ComboBoxModel model = comboBox.getModel(); int modelSize = model.getSize(); int baseline = -1; Dimension d; @@ -1484,7 +1487,8 @@ public void actionPerformed( ActionEvent e ) { String key = getName(); - JComboBox comboBox = (JComboBox)e.getSource(); + @SuppressWarnings("unchecked") + JComboBox comboBox = (JComboBox)e.getSource(); BasicComboBoxUI ui = (BasicComboBoxUI)BasicLookAndFeel.getUIOfType( comboBox.getUI(), BasicComboBoxUI.class); if (key == HIDE) { @@ -1625,7 +1629,7 @@ } } - private int getNextIndex(JComboBox comboBox, String key) { + private int getNextIndex(JComboBox comboBox, String key) { int listHeight = comboBox.getMaximumRowCount(); int selectedIndex = comboBox.getSelectedIndex(); @@ -1685,10 +1689,13 @@ comboBox.revalidate(); } } else { - JComboBox comboBox = (JComboBox)e.getSource(); + @SuppressWarnings("unchecked") + JComboBox comboBox = (JComboBox)e.getSource(); if ( propertyName == "model" ) { - ComboBoxModel newModel = (ComboBoxModel)e.getNewValue(); - ComboBoxModel oldModel = (ComboBoxModel)e.getOldValue(); + @SuppressWarnings("unchecked") + ComboBoxModel newModel = (ComboBoxModel)e.getNewValue(); + @SuppressWarnings("unchecked") + ComboBoxModel oldModel = (ComboBoxModel)e.getOldValue(); if ( oldModel != null && listDataListener != null ) { oldModel.removeListDataListener( listDataListener ); @@ -1897,7 +1904,8 @@ } public void layoutContainer(Container parent) { - JComboBox cb = (JComboBox)parent; + @SuppressWarnings("unchecked") + JComboBox cb = (JComboBox)parent; int width = cb.getWidth(); int height = cb.getHeight(); @@ -1959,7 +1967,7 @@ private String prefix = ""; private String typedString = ""; - public int selectionForKey(char aKey,ComboBoxModel aModel) { + public int selectionForKey(char aKey,ComboBoxModel aModel) { if (lastTime == 0L) { prefix = ""; typedString = ""; --- old/src/share/classes/javax/swing/plaf/basic/BasicComboPopup.java 2014-07-02 23:00:39.000000000 -0700 +++ new/src/share/classes/javax/swing/plaf/basic/BasicComboPopup.java 2014-07-02 23:00:38.000000000 -0700 @@ -71,11 +71,11 @@ public void removeListDataListener(ListDataListener l) {} }; - static final ListModel EmptyListModel = new EmptyListModelClass(); + static final ListModel EmptyListModel = new EmptyListModelClass(); private static Border LIST_BORDER = new LineBorder(Color.BLACK, 1); - protected JComboBox comboBox; + protected JComboBox comboBox; /** * This protected field is implementation specific. Do not access directly * or override. Use the accessor methods instead. @@ -83,7 +83,7 @@ * @see #getList * @see #createList */ - protected JList list; + protected JList list; /** * This protected field is implementation specific. Do not access directly * or override. Use the create method instead @@ -229,7 +229,7 @@ /** * Implementation of ComboPopup.getList(). */ - public JList getList() { + public JList getList() { return list; } @@ -303,7 +303,7 @@ * @param model The combo box model to install listeners * @see #installComboBoxModelListeners */ - protected void uninstallComboBoxModelListeners( ComboBoxModel model ) { + protected void uninstallComboBoxModelListeners( ComboBoxModel model ) { if (model != null && listDataListener != null) { model.removeListDataListener(listDataListener); } @@ -319,7 +319,7 @@ //=================================================================== // begin Initialization routines // - public BasicComboPopup( JComboBox combo ) { + public BasicComboPopup( JComboBox combo ) { super(); setName("ComboPopup.popup"); comboBox = combo; @@ -481,8 +481,8 @@ * * @return a JList used to display the combo box items */ - protected JList createList() { - return new JList( comboBox.getModel() ) { + protected JList createList() { + return new JList( comboBox.getModel() ) { public void processMouseEvent(MouseEvent e) { if (BasicGraphicsUtils.isMenuShortcutKeyDown(e)) { // Fix for 4234053. Filter out the Control Key from the list. @@ -610,7 +610,7 @@ * @param model The combo box model to install listeners * @see #uninstallComboBoxModelListeners */ - protected void installComboBoxModelListeners( ComboBoxModel model ) { + protected void installComboBoxModelListeners( ComboBoxModel model ) { if (model != null && (listDataListener = createListDataListener()) != null) { model.addListDataListener(listDataListener); } @@ -928,12 +928,15 @@ // PropertyChangeListener // public void propertyChange(PropertyChangeEvent e) { - JComboBox comboBox = (JComboBox)e.getSource(); + @SuppressWarnings("unchecked") + JComboBox comboBox = (JComboBox)e.getSource(); String propertyName = e.getPropertyName(); if ( propertyName == "model" ) { - ComboBoxModel oldModel = (ComboBoxModel)e.getOldValue(); - ComboBoxModel newModel = (ComboBoxModel)e.getNewValue(); + @SuppressWarnings("unchecked") + ComboBoxModel oldModel = (ComboBoxModel)e.getOldValue(); + @SuppressWarnings("unchecked") + ComboBoxModel newModel = (ComboBoxModel)e.getNewValue(); uninstallComboBoxModelListeners(oldModel); installComboBoxModelListeners(newModel); @@ -955,7 +958,7 @@ ComponentOrientation o =(ComponentOrientation)e.getNewValue(); - JList list = getList(); + JList list = getList(); if (list!=null && list.getComponentOrientation()!=o) { list.setComponentOrientation(o); } @@ -978,7 +981,8 @@ // public void itemStateChanged( ItemEvent e ) { if (e.getStateChange() == ItemEvent.SELECTED) { - JComboBox comboBox = (JComboBox)e.getSource(); + @SuppressWarnings("unchecked") + JComboBox comboBox = (JComboBox)e.getSource(); setListSelection(comboBox.getSelectedIndex()); } } @@ -1172,7 +1176,7 @@ // Set the cached value of the minimum row count int minRowCount = Math.min( maxRowCount, comboBox.getItemCount() ); int height = 0; - ListCellRenderer renderer = list.getCellRenderer(); + ListCellRenderer renderer = list.getCellRenderer(); Object value = null; for ( int i = 0; i < minRowCount; ++i ) { --- old/src/share/classes/javax/swing/plaf/basic/BasicDirectoryModel.java 2014-07-02 23:00:41.000000000 -0700 +++ new/src/share/classes/javax/swing/plaf/basic/BasicDirectoryModel.java 2014-07-02 23:00:40.000000000 -0700 @@ -98,7 +98,7 @@ if (directories != null) { return directories; } - Vector fls = getFiles(); + Vector fls = getFiles(); return directories; } } @@ -317,7 +317,7 @@ if (isInterrupted()) { return null; } - return new DoChangeContents(null, 0, new Vector(fileCache.subList(start, end)), start, fid); + return new DoChangeContents(null, 0, new Vector<>(fileCache.subList(start, end)), start, fid); } } if (!fileCache.equals(newFileCache)) { --- old/src/share/classes/javax/swing/plaf/basic/BasicFileChooserUI.java 2014-07-02 23:00:43.000000000 -0700 +++ new/src/share/classes/javax/swing/plaf/basic/BasicFileChooserUI.java 2014-07-02 23:00:42.000000000 -0700 @@ -436,7 +436,7 @@ } protected MouseListener createDoubleClickListener(JFileChooser fc, - JList list) { + JList list) { return new Handler(list); } @@ -445,12 +445,12 @@ } private class Handler implements MouseListener, ListSelectionListener { - JList list; + JList list; Handler() { } - Handler(JList list) { + Handler(JList list) { this.list = list; } @@ -506,7 +506,8 @@ if(!evt.getValueIsAdjusting()) { JFileChooser chooser = getFileChooser(); FileSystemView fsv = chooser.getFileSystemView(); - JList list = (JList)evt.getSource(); + @SuppressWarnings("unchecked") + JList list = (JList)evt.getSource(); int fsm = chooser.getFileSelectionMode(); boolean useSetDirectory = usesSingleFilePane && @@ -570,7 +571,7 @@ // new functionality add it to the Handler, but make sure this // class calls into the Handler. Handler handler; - public DoubleClickListener(JList list) { + public DoubleClickListener(JList list) { handler = new Handler(list); } --- old/src/share/classes/javax/swing/plaf/basic/BasicListUI.java 2014-07-02 23:00:45.000000000 -0700 +++ new/src/share/classes/javax/swing/plaf/basic/BasicListUI.java 2014-07-02 23:00:44.000000000 -0700 @@ -59,7 +59,7 @@ private static final StringBuilder BASELINE_COMPONENT_KEY = new StringBuilder("List.baselineComponent"); - protected JList list = null; + protected JList list = null; protected CellRendererPane rendererPane; // Listeners that this UI attaches to the JList @@ -196,8 +196,8 @@ Graphics g, int row, Rectangle rowBounds, - ListCellRenderer cellRenderer, - ListModel dataModel, + ListCellRenderer cellRenderer, + ListModel dataModel, ListSelectionModel selModel, int leadIndex) { @@ -263,8 +263,8 @@ } maybeUpdateLayoutState(); - ListCellRenderer renderer = list.getCellRenderer(); - ListModel dataModel = list.getModel(); + ListCellRenderer renderer = list.getCellRenderer(); + ListModel dataModel = list.getModel(); ListSelectionModel selModel = list.getSelectionModel(); int size; @@ -478,7 +478,8 @@ Component renderer = (Component)lafDefaults.get( BASELINE_COMPONENT_KEY); if (renderer == null) { - ListCellRenderer lcr = (ListCellRenderer)UIManager.get( + @SuppressWarnings("unchecked") + ListCellRenderer lcr = (ListCellRenderer)UIManager.get( "List.cellRenderer"); // fix for 6711072 some LAFs like Nimbus do not provide this @@ -715,7 +716,7 @@ list.addPropertyChangeListener(propertyChangeListener); list.addKeyListener(getHandler()); - ListModel model = list.getModel(); + ListModel model = list.getModel(); if (model != null) { model.addListDataListener(listDataListener); } @@ -744,7 +745,7 @@ list.removePropertyChangeListener(propertyChangeListener); list.removeKeyListener(getHandler()); - ListModel model = list.getModel(); + ListModel model = list.getModel(); if (model != null) { model.removeListDataListener(listDataListener); } @@ -785,7 +786,9 @@ LookAndFeel.installProperty(list, "opaque", Boolean.TRUE); if (list.getCellRenderer() == null) { - list.setCellRenderer((ListCellRenderer)(UIManager.get("List.cellRenderer"))); + @SuppressWarnings("unchecked") + ListCellRenderer tmp = (ListCellRenderer)(UIManager.get("List.cellRenderer")); + list.setCellRenderer(tmp); } Color sbg = list.getSelectionBackground(); @@ -866,7 +869,9 @@ */ public void installUI(JComponent c) { - list = (JList)c; + @SuppressWarnings("unchecked") + JList tmp = (JList)c; + list = tmp; layoutOrientation = list.getLayoutOrientation(); @@ -925,7 +930,7 @@ * {@inheritDoc} * @throws NullPointerException {@inheritDoc} */ - public int locationToIndex(JList list, Point location) { + public int locationToIndex(JList list, Point location) { maybeUpdateLayoutState(); return convertLocationToModel(location.x, location.y); } @@ -934,7 +939,7 @@ /** * {@inheritDoc} */ - public Point indexToLocation(JList list, int index) { + public Point indexToLocation(JList list, int index) { maybeUpdateLayoutState(); Rectangle rect = getCellBounds(list, index, index); @@ -948,7 +953,7 @@ /** * {@inheritDoc} */ - public Rectangle getCellBounds(JList list, int index1, int index2) { + public Rectangle getCellBounds(JList list, int index1, int index2) { maybeUpdateLayoutState(); int minIndex = Math.min(index1, index2); @@ -992,7 +997,7 @@ * Gets the bounds of the specified model index, returning the resulting * bounds, or null if index is not valid. */ - private Rectangle getCellBounds(JList list, int index) { + private Rectangle getCellBounds(JList list, int index) { maybeUpdateLayoutState(); int row = convertModelToRow(index); @@ -1351,9 +1356,9 @@ if ((fixedCellWidth == -1) || (fixedCellHeight == -1)) { - ListModel dataModel = list.getModel(); + ListModel dataModel = list.getModel(); int dataModelSize = dataModel.getSize(); - ListCellRenderer renderer = list.getCellRenderer(); + ListCellRenderer renderer = list.getCellRenderer(); if (renderer != null) { for(int index = 0; index < dataModelSize; index++) { @@ -1838,7 +1843,8 @@ } public void actionPerformed(ActionEvent e) { String name = getName(); - JList list = (JList)e.getSource(); + @SuppressWarnings("unchecked") + JList list = (JList)e.getSource(); BasicListUI ui = (BasicListUI)BasicLookAndFeel.getUIOfType( list.getUI(), BasicListUI.class); @@ -1997,11 +2003,11 @@ return true; } - private void clearSelection(JList list) { + private void clearSelection(JList list) { list.clearSelection(); } - private void selectAll(JList list) { + private void selectAll(JList list) { int size = list.getModel().getSize(); if (size > 0) { ListSelectionModel lsm = list.getSelectionModel(); @@ -2030,7 +2036,7 @@ } } - private int getNextPageIndex(JList list, int direction) { + private int getNextPageIndex(JList list, int direction) { if (list.getModel().getSize() == 0) { return -1; } @@ -2155,7 +2161,7 @@ return index; } - private void changeSelection(JList list, int type, + private void changeSelection(JList list, int type, int index, int direction) { if (index >= 0 && index < list.getModel().getSize()) { ListSelectionModel lsm = list.getSelectionModel(); @@ -2198,7 +2204,7 @@ * index. When scroll up makes selected index the first visible index. * Adjust visible rectangle respect to list's component orientation. */ - private void adjustScrollPositionIfNecessary(JList list, int index, + private void adjustScrollPositionIfNecessary(JList list, int index, int direction) { if (direction == 0) { return; @@ -2286,7 +2292,7 @@ } } - private int getNextColumnIndex(JList list, BasicListUI ui, + private int getNextColumnIndex(JList list, BasicListUI ui, int amount) { if (list.getLayoutOrientation() != JList.VERTICAL) { int index = adjustIndex(list.getLeadSelectionIndex(), list); @@ -2319,7 +2325,7 @@ return -1; } - private int getNextIndex(JList list, BasicListUI ui, int amount) { + private int getNextIndex(JList list, BasicListUI ui, int amount) { int index = adjustIndex(list.getLeadSelectionIndex(), list); int size = list.getModel().getSize(); @@ -2371,8 +2377,8 @@ * of the same letters followed by first typed another letter. */ public void keyTyped(KeyEvent e) { - JList src = (JList)e.getSource(); - ListModel model = src.getModel(); + JList src = (JList)e.getSource(); + ListModel model = src.getModel(); if (model.getSize() == 0 || e.isAltDown() || BasicGraphicsUtils.isMenuShortcutKeyDown(e) || @@ -2468,8 +2474,10 @@ * listDataListener from the old model and add it to the new one. */ if (propertyName == "model") { - ListModel oldModel = (ListModel)e.getOldValue(); - ListModel newModel = (ListModel)e.getNewValue(); + @SuppressWarnings("unchecked") + ListModel oldModel = (ListModel)e.getOldValue(); + @SuppressWarnings("unchecked") + ListModel newModel = (ListModel)e.getNewValue(); if (oldModel != null) { oldModel.removeListDataListener(listDataListener); } @@ -2828,7 +2836,7 @@ } } - private static int adjustIndex(int index, JList list) { + private static int adjustIndex(int index, JList list) { return index < list.getModel().getSize() ? index : -1; } @@ -2848,7 +2856,7 @@ */ protected Transferable createTransferable(JComponent c) { if (c instanceof JList) { - JList list = (JList) c; + JList list = (JList) c; Object[] values = list.getSelectedValues(); if (values == null || values.length == 0) { --- old/src/share/classes/javax/swing/plaf/basic/BasicLookAndFeel.java 2014-07-02 23:00:47.000000000 -0700 +++ new/src/share/classes/javax/swing/plaf/basic/BasicLookAndFeel.java 2014-07-02 23:00:46.000000000 -0700 @@ -1861,7 +1861,7 @@ * Returns the ui that is of type klass, or null if * one can not be found. */ - static Object getUIOfType(ComponentUI ui, Class klass) { + static Object getUIOfType(ComponentUI ui, Class klass) { if (klass.isInstance(ui)) { return ui; } @@ -2256,4 +2256,4 @@ } } } -} \ No newline at end of file +} --- old/src/share/classes/javax/swing/plaf/basic/BasicMenuUI.java 2014-07-02 23:00:49.000000000 -0700 +++ new/src/share/classes/javax/swing/plaf/basic/BasicMenuUI.java 2014-07-02 23:00:48.000000000 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 @@ -609,7 +609,7 @@ MenuElement path[] = e.getPath(); if (key == Character.toLowerCase(e.getKeyChar())) { JPopupMenu popupMenu = ((JMenu)menuItem).getPopupMenu(); - ArrayList newList = new ArrayList(Arrays.asList(path)); + ArrayList newList = new ArrayList<>(Arrays.asList(path)); newList.add(popupMenu); MenuElement subs[] = popupMenu.getSubElements(); MenuElement sub = @@ -619,7 +619,7 @@ } MenuSelectionManager manager = e.getMenuSelectionManager(); MenuElement newPath[] = new MenuElement[0];; - newPath = (MenuElement[]) newList.toArray(newPath); + newPath = newList.toArray(newPath); manager.setSelectedPath(newPath); e.consume(); } --- old/src/share/classes/javax/swing/plaf/basic/BasicOptionPaneUI.java 2014-07-02 23:00:51.000000000 -0700 +++ new/src/share/classes/javax/swing/plaf/basic/BasicOptionPaneUI.java 2014-07-02 23:00:50.000000000 -0700 @@ -450,7 +450,7 @@ if (sValues != null) { if (sValues.length < 20) { - JComboBox cBox = new JComboBox(); + JComboBox cBox = new JComboBox<>(); cBox.setName("OptionPane.comboBox"); for(int counter = 0, maxCounter = sValues.length; @@ -464,7 +464,7 @@ toAdd = cBox; } else { - JList list = new JList(sValues); + JList list = new JList<>(sValues); JScrollPane sp = new JScrollPane(list); sp.setName("OptionPane.scrollPane"); @@ -1232,7 +1232,7 @@ public void mousePressed(MouseEvent e) { if (e.getClickCount() == 2) { - JList list = (JList)e.getSource(); + JList list = (JList)e.getSource(); int index = list.locationToIndex(e.getPoint()); optionPane.setInputValue(list.getModel().getElementAt(index)); --- old/src/share/classes/javax/swing/plaf/basic/BasicScrollBarUI.java 2014-07-02 23:00:53.000000000 -0700 +++ new/src/share/classes/javax/swing/plaf/basic/BasicScrollBarUI.java 2014-07-02 23:00:52.000000000 -0700 @@ -1265,7 +1265,7 @@ JViewport viewport = scrollpane.getViewport(); Component view = viewport.getView(); if (view instanceof JList) { - JList list = (JList)view; + JList list = (JList)view; if (DefaultLookup.getBoolean(list, list.getUI(), "List.lockToPositionOnScroll", false)) { int adjustedValue = value; --- old/src/share/classes/javax/swing/plaf/basic/BasicSliderUI.java 2014-07-02 23:00:55.000000000 -0700 +++ new/src/share/classes/javax/swing/plaf/basic/BasicSliderUI.java 2014-07-02 23:00:55.000000000 -0700 @@ -397,13 +397,13 @@ protected boolean labelsHaveSameBaselines() { if (!checkedLabelBaselines) { checkedLabelBaselines = true; - Dictionary dictionary = slider.getLabelTable(); + Dictionary dictionary = slider.getLabelTable(); if (dictionary != null) { sameLabelBaselines = true; - Enumeration elements = dictionary.elements(); + Enumeration elements = dictionary.elements(); int baseline = -1; while (elements.hasMoreElements()) { - JComponent label = (JComponent) elements.nextElement(); + JComponent label = elements.nextElement(); Dimension pref = label.getPreferredSize(); int labelBaseline = label.getBaseline(pref.width, pref.height); @@ -753,12 +753,12 @@ } protected int getWidthOfWidestLabel() { - Dictionary dictionary = slider.getLabelTable(); + Dictionary dictionary = slider.getLabelTable(); int widest = 0; if ( dictionary != null ) { - Enumeration keys = dictionary.keys(); + Enumeration keys = dictionary.keys(); while ( keys.hasMoreElements() ) { - JComponent label = (JComponent) dictionary.get(keys.nextElement()); + JComponent label = dictionary.get(keys.nextElement()); widest = Math.max( label.getPreferredSize().width, widest ); } } @@ -766,12 +766,12 @@ } protected int getHeightOfTallestLabel() { - Dictionary dictionary = slider.getLabelTable(); + Dictionary dictionary = slider.getLabelTable(); int tallest = 0; if ( dictionary != null ) { - Enumeration keys = dictionary.keys(); + Enumeration keys = dictionary.keys(); while ( keys.hasMoreElements() ) { - JComponent label = (JComponent) dictionary.get(keys.nextElement()); + JComponent label = dictionary.get(keys.nextElement()); tallest = Math.max( label.getPreferredSize().height, tallest ); } } @@ -842,18 +842,18 @@ * @since 1.6 */ protected Integer getHighestValue() { - Dictionary dictionary = slider.getLabelTable(); + Dictionary dictionary = slider.getLabelTable(); if (dictionary == null) { return null; } - Enumeration keys = dictionary.keys(); + Enumeration keys = dictionary.keys(); Integer max = null; while (keys.hasMoreElements()) { - Integer i = (Integer) keys.nextElement(); + Integer i = keys.nextElement(); if (max == null || i > max) { max = i; @@ -871,18 +871,18 @@ * @since 1.6 */ protected Integer getLowestValue() { - Dictionary dictionary = slider.getLabelTable(); + Dictionary dictionary = slider.getLabelTable(); if (dictionary == null) { return null; } - Enumeration keys = dictionary.keys(); + Enumeration keys = dictionary.keys(); Integer min = null; while (keys.hasMoreElements()) { - Integer i = (Integer) keys.nextElement(); + Integer i = keys.nextElement(); if (min == null || i < min) { min = i; @@ -1121,17 +1121,17 @@ public void paintLabels( Graphics g ) { Rectangle labelBounds = labelRect; - Dictionary dictionary = slider.getLabelTable(); + Dictionary dictionary = slider.getLabelTable(); if ( dictionary != null ) { - Enumeration keys = dictionary.keys(); + Enumeration keys = dictionary.keys(); int minValue = slider.getMinimum(); int maxValue = slider.getMaximum(); boolean enabled = slider.isEnabled(); while ( keys.hasMoreElements() ) { - Integer key = (Integer)keys.nextElement(); + Integer key = keys.nextElement(); int value = key.intValue(); if (value >= minValue && value <= maxValue) { - JComponent label = (JComponent) dictionary.get(key); + JComponent label = dictionary.get(key); label.setEnabled(enabled); if (label instanceof JLabel) { --- old/src/share/classes/javax/swing/plaf/basic/BasicSpinnerUI.java 2014-07-02 23:00:57.000000000 -0700 +++ new/src/share/classes/javax/swing/plaf/basic/BasicSpinnerUI.java 2014-07-02 23:00:57.000000000 -0700 @@ -707,7 +707,7 @@ iterator.first(); do { - Map attrs = iterator.getAttributes(); + Map attrs = iterator.getAttributes(); if (attrs != null && attrs.containsKey(field)){ int start = iterator.getRunStart(field); --- old/src/share/classes/javax/swing/plaf/basic/BasicTableHeaderUI.java 2014-07-02 23:00:59.000000000 -0700 +++ new/src/share/classes/javax/swing/plaf/basic/BasicTableHeaderUI.java 2014-07-02 23:00:59.000000000 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 @@ -103,7 +103,7 @@ if (e.getClickCount() % 2 == 1 && SwingUtilities.isLeftMouseButton(e)) { JTable table = header.getTable(); - RowSorter sorter; + RowSorter sorter; if (table != null && (sorter = table.getRowSorter()) != null) { int columnIndex = header.columnAtPoint(e.getPoint()); if (columnIndex != -1) { @@ -772,9 +772,9 @@ */ public Dimension getMinimumSize(JComponent c) { long width = 0; - Enumeration enumeration = header.getColumnModel().getColumns(); + Enumeration enumeration = header.getColumnModel().getColumns(); while (enumeration.hasMoreElements()) { - TableColumn aColumn = (TableColumn)enumeration.nextElement(); + TableColumn aColumn = enumeration.nextElement(); width = width + aColumn.getMinWidth(); } return createHeaderSize(width); @@ -788,9 +788,9 @@ */ public Dimension getPreferredSize(JComponent c) { long width = 0; - Enumeration enumeration = header.getColumnModel().getColumns(); + Enumeration enumeration = header.getColumnModel().getColumns(); while (enumeration.hasMoreElements()) { - TableColumn aColumn = (TableColumn)enumeration.nextElement(); + TableColumn aColumn = enumeration.nextElement(); width = width + aColumn.getPreferredWidth(); } return createHeaderSize(width); @@ -802,9 +802,9 @@ */ public Dimension getMaximumSize(JComponent c) { long width = 0; - Enumeration enumeration = header.getColumnModel().getColumns(); + Enumeration enumeration = header.getColumnModel().getColumns(); while (enumeration.hasMoreElements()) { - TableColumn aColumn = (TableColumn)enumeration.nextElement(); + TableColumn aColumn = enumeration.nextElement(); width = width + aColumn.getMaxWidth(); } return createHeaderSize(width); @@ -875,7 +875,7 @@ String name = getName(); if (TOGGLE_SORT_ORDER == name) { JTable table = th.getTable(); - RowSorter sorter = table == null ? null : table.getRowSorter(); + RowSorter sorter = table == null ? null : table.getRowSorter(); if (sorter != null) { int columnIndex = ui.getSelectedColumnIndex(); columnIndex = table.convertColumnIndexToModel( --- old/src/share/classes/javax/swing/plaf/basic/BasicTableUI.java 2014-07-02 23:01:01.000000000 -0700 +++ new/src/share/classes/javax/swing/plaf/basic/BasicTableUI.java 2014-07-02 23:01:01.000000000 -0700 @@ -1710,9 +1710,9 @@ */ public Dimension getMinimumSize(JComponent c) { long width = 0; - Enumeration enumeration = table.getColumnModel().getColumns(); + Enumeration enumeration = table.getColumnModel().getColumns(); while (enumeration.hasMoreElements()) { - TableColumn aColumn = (TableColumn)enumeration.nextElement(); + TableColumn aColumn = enumeration.nextElement(); width = width + aColumn.getMinWidth(); } return createTableSize(width); @@ -1725,9 +1725,9 @@ */ public Dimension getPreferredSize(JComponent c) { long width = 0; - Enumeration enumeration = table.getColumnModel().getColumns(); + Enumeration enumeration = table.getColumnModel().getColumns(); while (enumeration.hasMoreElements()) { - TableColumn aColumn = (TableColumn)enumeration.nextElement(); + TableColumn aColumn = enumeration.nextElement(); width = width + aColumn.getPreferredWidth(); } return createTableSize(width); @@ -1740,9 +1740,9 @@ */ public Dimension getMaximumSize(JComponent c) { long width = 0; - Enumeration enumeration = table.getColumnModel().getColumns(); + Enumeration enumeration = table.getColumnModel().getColumns(); while (enumeration.hasMoreElements()) { - TableColumn aColumn = (TableColumn)enumeration.nextElement(); + TableColumn aColumn = enumeration.nextElement(); width = width + aColumn.getMaxWidth(); } return createTableSize(width); --- old/src/share/classes/javax/swing/plaf/basic/BasicTreeUI.java 2014-07-02 23:01:03.000000000 -0700 +++ new/src/share/classes/javax/swing/plaf/basic/BasicTreeUI.java 2014-07-02 23:01:03.000000000 -0700 @@ -1148,7 +1148,7 @@ Insets insets = tree.getInsets(); TreePath initialPath = getClosestPathForLocation (tree, 0, paintBounds.y); - Enumeration paintingEnumerator = treeState.getVisiblePathsFrom + Enumeration paintingEnumerator = treeState.getVisiblePathsFrom (initialPath); int row = treeState.getRowForPath(initialPath); int endY = paintBounds.y + paintBounds.height; @@ -1694,7 +1694,7 @@ if(treeState != null) { treeState.setExpandedState(path, true); - Enumeration descendants = tree.getExpandedDescendants(path); + Enumeration descendants = tree.getExpandedDescendants(path); if(descendants != null) { while(descendants.hasMoreElements()) { --- old/src/share/classes/javax/swing/plaf/basic/ComboPopup.java 2014-07-02 23:01:05.000000000 -0700 +++ new/src/share/classes/javax/swing/plaf/basic/ComboPopup.java 2014-07-02 23:01:05.000000000 -0700 @@ -70,7 +70,7 @@ * This method is highly implementation specific and should not be used * for general list manipulation. */ - public JList getList(); + public JList getList(); /** * Returns a mouse listener that will be added to the combo box or null. --- old/src/share/classes/javax/swing/plaf/basic/LazyActionMap.java 2014-07-02 23:01:08.000000000 -0700 +++ new/src/share/classes/javax/swing/plaf/basic/LazyActionMap.java 2014-07-02 23:01:07.000000000 -0700 @@ -56,7 +56,7 @@ * @param defaultsKey Key to use to defaults table to check for * existing map and what resulting Map will be registered on. */ - static void installLazyActionMap(JComponent c, Class loaderClass, + static void installLazyActionMap(JComponent c, Class loaderClass, String defaultsKey) { ActionMap map = (ActionMap)UIManager.get(defaultsKey); if (map == null) { @@ -79,7 +79,7 @@ * @param defaultsKey Key to use to defaults table to check for * existing map and what resulting Map will be registered on. */ - static ActionMap getActionMap(Class loaderClass, + static ActionMap getActionMap(Class loaderClass, String defaultsKey) { ActionMap map = (ActionMap)UIManager.get(defaultsKey); if (map == null) { @@ -90,7 +90,7 @@ } - private LazyActionMap(Class loader) { + private LazyActionMap(Class loader) { _loader = loader; } @@ -146,7 +146,7 @@ Class klass = (Class)loader; try { Method method = klass.getDeclaredMethod("loadActionMap", - new Class[] { LazyActionMap.class }); + new Class[] { LazyActionMap.class }); method.invoke(klass, new Object[] { this }); } catch (NoSuchMethodException nsme) { assert false : "LazyActionMap unable to load actions " + --- old/src/share/classes/javax/swing/plaf/metal/MetalBumps.java 2014-07-02 23:01:09.000000000 -0700 +++ new/src/share/classes/javax/swing/plaf/metal/MetalBumps.java 2014-07-02 23:01:09.000000000 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 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 @@ -67,6 +67,7 @@ private static BumpBuffer createBuffer(GraphicsConfiguration gc, Color topColor, Color shadowColor, Color backColor) { AppContext context = AppContext.getAppContext(); + @SuppressWarnings("unchecked") List buffers = (List) context.get(METAL_BUMPS); if (buffers == null) { buffers = new ArrayList(); --- old/src/share/classes/javax/swing/plaf/metal/MetalComboBoxButton.java 2014-07-02 23:01:11.000000000 -0700 +++ new/src/share/classes/javax/swing/plaf/metal/MetalComboBoxButton.java 2014-07-02 23:01:11.000000000 -0700 @@ -54,12 +54,12 @@ /** * The instance of {@code JComboBox}. */ - protected JComboBox comboBox; + protected JComboBox comboBox; /** * The instance of {@code JList}. */ - protected JList listBox; + protected JList listBox; /** * The instance of {@code CellRendererPane}. @@ -81,14 +81,14 @@ * * @return the {@code JComboBox} */ - public final JComboBox getComboBox() { return comboBox;} + public final JComboBox getComboBox() { return comboBox;} /** * Sets the {@code JComboBox}. * * @param cb the {@code JComboBox} */ - public final void setComboBox( JComboBox cb ) { comboBox = cb;} + public final void setComboBox( JComboBox cb ) { comboBox = cb;} /** * Returns the icon of the {@code JComboBox}. @@ -136,8 +136,8 @@ * @param pane an instance of {@code CellRendererPane} * @param list an instance of {@code JList} */ - public MetalComboBoxButton( JComboBox cb, Icon i, - CellRendererPane pane, JList list ) { + public MetalComboBoxButton( JComboBox cb, Icon i, + CellRendererPane pane, JList list ) { this(); comboBox = cb; comboIcon = i; @@ -155,8 +155,8 @@ * @param pane an instance of {@code CellRendererPane} * @param list an instance of {@code JList} */ - public MetalComboBoxButton( JComboBox cb, Icon i, boolean onlyIcon, - CellRendererPane pane, JList list ) { + public MetalComboBoxButton( JComboBox cb, Icon i, boolean onlyIcon, + CellRendererPane pane, JList list ) { this( cb, i, pane, list ); iconOnly = onlyIcon; } @@ -238,7 +238,7 @@ // Let the renderer paint if ( ! iconOnly && comboBox != null ) { - ListCellRenderer renderer = comboBox.getRenderer(); + ListCellRenderer renderer = comboBox.getRenderer(); Component c; boolean renderPressed = getModel().isPressed(); c = renderer.getListCellRendererComponent(listBox, --- old/src/share/classes/javax/swing/plaf/metal/MetalComboBoxUI.java 2014-07-02 23:01:13.000000000 -0700 +++ new/src/share/classes/javax/swing/plaf/metal/MetalComboBoxUI.java 2014-07-02 23:01:13.000000000 -0700 @@ -391,7 +391,7 @@ * * @param cBox an instance of {@code JComboBox} */ - public MetalComboPopup( JComboBox cBox) { + public MetalComboPopup( JComboBox cBox) { super( cBox ); } --- old/src/share/classes/javax/swing/plaf/metal/MetalFileChooserUI.java 2014-07-02 23:01:15.000000000 -0700 +++ new/src/share/classes/javax/swing/plaf/metal/MetalFileChooserUI.java 2014-07-02 23:01:15.000000000 -0700 @@ -58,7 +58,7 @@ // made most things in this class private. private JLabel lookInLabel; - private JComboBox directoryComboBox; + private JComboBox directoryComboBox; private DirectoryComboBoxModel directoryComboBoxModel; private Action directoryComboBoxAction = new DirectoryComboBoxAction(); @@ -76,7 +76,7 @@ private JPanel buttonPanel; private JPanel bottomPanel; - private JComboBox filterComboBox; + private JComboBox filterComboBox; private static final Dimension hstrut5 = new Dimension(5, 1); private static final Dimension hstrut11 = new Dimension(11, 1); @@ -204,7 +204,7 @@ return MetalFileChooserUI.this.getNewFolderAction(); } - public MouseListener createDoubleClickListener(JList list) { + public MouseListener createDoubleClickListener(JList list) { return MetalFileChooserUI.this.createDoubleClickListener(getFileChooser(), list); } @@ -243,7 +243,7 @@ // CurrentDir ComboBox @SuppressWarnings("serial") // anonymous class - JComboBox tmp1 = new JComboBox() { + JComboBox tmp1 = new JComboBox() { public Dimension getPreferredSize() { Dimension d = super.getPreferredSize(); // Must be small enough to not affect total width. @@ -426,7 +426,7 @@ filterComboBoxModel = createFilterComboBoxModel(); fc.addPropertyChangeListener(filterComboBoxModel); - filterComboBox = new JComboBox(filterComboBoxModel); + filterComboBox = new JComboBox<>(filterComboBoxModel); filterComboBox.putClientProperty(AccessibleContext.ACCESSIBLE_DESCRIPTION_PROPERTY, filesOfTypeLabelText); filesOfTypeLabel.setLabelFor(filterComboBox); @@ -578,7 +578,7 @@ * * @param list an instance of {@code JList} */ - public SingleClickListener(JList list) { + public SingleClickListener(JList list) { } } @@ -927,7 +927,7 @@ @SuppressWarnings("serial") // Superclass is not serializable across versions class DirectoryComboBoxRenderer extends DefaultListCellRenderer { IndentIcon ii = new IndentIcon(); - public Component getListCellRendererComponent(JList list, Object value, + public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { @@ -1131,7 +1131,7 @@ */ @SuppressWarnings("serial") // Superclass is not serializable across versions public class FilterComboBoxRenderer extends DefaultListCellRenderer { - public Component getListCellRendererComponent(JList list, + public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { --- old/src/share/classes/javax/swing/plaf/metal/MetalToolBarUI.java 2014-07-02 23:01:17.000000000 -0700 +++ new/src/share/classes/javax/swing/plaf/metal/MetalToolBarUI.java 2014-07-02 23:01:17.000000000 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 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 @@ -117,7 +117,7 @@ * that shares the JRootPane ancestor of from. */ synchronized static Object findRegisteredComponentOfType(JComponent from, - Class target) { + Class target) { JRootPane rp = SwingUtilities.getRootPane(from); if (rp != null) { for (int counter = components.size() - 1; counter >= 0; counter--){ --- old/src/share/classes/javax/swing/plaf/metal/MetalUtils.java 2014-07-02 23:01:20.000000000 -0700 +++ new/src/share/classes/javax/swing/plaf/metal/MetalUtils.java 2014-07-02 23:01:19.000000000 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 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 @@ -210,7 +210,8 @@ */ static boolean drawGradient(Component c, Graphics g, String key, int x, int y, int w, int h, boolean vertical) { - java.util.List gradient = (java.util.List)UIManager.get(key); + @SuppressWarnings("unchecked") + java.util.List gradient = (java.util.List)UIManager.get(key); if (gradient == null || !(g instanceof Graphics2D)) { return false; } @@ -251,7 +252,7 @@ } public void paint(Component c, Graphics2D g, - java.util.List gradient, int x, int y, int w, + java.util.List gradient, int x, int y, int w, int h, boolean isVertical) { int imageWidth; int imageHeight; @@ -274,7 +275,8 @@ protected void paintToImage(Component c, Image image, Graphics g, int w, int h, Object[] args) { Graphics2D g2 = (Graphics2D)g; - java.util.List gradient = (java.util.List)args[0]; + @SuppressWarnings("unchecked") + java.util.List gradient = (java.util.List)args[0]; boolean isVertical = ((Boolean)args[1]).booleanValue(); // Render to the VolatileImage if (isVertical) { --- old/src/share/classes/javax/swing/plaf/metal/OceanTheme.java 2014-07-02 23:01:21.000000000 -0700 +++ new/src/share/classes/javax/swing/plaf/metal/OceanTheme.java 2014-07-02 23:01:21.000000000 -0700 @@ -133,7 +133,7 @@ UIDefaults.LazyValue focusBorder = t -> new BorderUIResource.LineBorderUIResource(getPrimary1()); // .30 0 DDE8F3 white secondary2 - java.util.List buttonGradient = Arrays.asList( + java.util.List buttonGradient = Arrays.asList( new Object[] {new Float(.3f), new Float(0f), new ColorUIResource(0xDDE8F3), getWhite(), getSecondary2() }); @@ -149,7 +149,7 @@ Color c8ddf2 = new ColorUIResource(0xC8DDF2); Object directoryIcon = getIconResource("icons/ocean/directory.gif"); Object fileIcon = getIconResource("icons/ocean/file.gif"); - java.util.List sliderGradient = Arrays.asList(new Object[] { + java.util.List sliderGradient = Arrays.asList(new Object[] { new Float(.3f), new Float(.2f), c8ddf2, getWhite(), new ColorUIResource(SECONDARY2) }); --- old/src/share/classes/javax/swing/plaf/multi/MultiButtonUI.java 2014-07-02 23:01:23.000000000 -0700 +++ new/src/share/classes/javax/swing/plaf/multi/MultiButtonUI.java 2014-07-02 23:01:23.000000000 -0700 @@ -47,7 +47,7 @@ * the getUIs method. The first element is guaranteed to be the real UI * obtained from the default look and feel. */ - protected Vector uis = new Vector(); + protected Vector uis = new Vector<>(); //////////////////// // Common UI methods @@ -80,9 +80,9 @@ */ public boolean contains(JComponent a, int b, int c) { boolean returnValue = - ((ComponentUI) (uis.elementAt(0))).contains(a,b,c); + uis.elementAt(0).contains(a,b,c); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).contains(a,b,c); + uis.elementAt(i).contains(a,b,c); } return returnValue; } @@ -92,7 +92,7 @@ */ public void update(Graphics a, JComponent b) { for (int i = 0; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).update(a,b); + uis.elementAt(i).update(a,b); } } @@ -105,10 +105,8 @@ * @return the UI delegate created */ public static ComponentUI createUI(JComponent a) { - ComponentUI mui = new MultiButtonUI(); - return MultiLookAndFeel.createUIs(mui, - ((MultiButtonUI) mui).uis, - a); + MultiButtonUI mui = new MultiButtonUI(); + return MultiLookAndFeel.createUIs(mui, mui.uis,a); } /** @@ -116,7 +114,7 @@ */ public void installUI(JComponent a) { for (int i = 0; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).installUI(a); + uis.elementAt(i).installUI(a); } } @@ -125,7 +123,7 @@ */ public void uninstallUI(JComponent a) { for (int i = 0; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).uninstallUI(a); + uis.elementAt(i).uninstallUI(a); } } @@ -134,7 +132,7 @@ */ public void paint(Graphics a, JComponent b) { for (int i = 0; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).paint(a,b); + uis.elementAt(i).paint(a,b); } } @@ -146,9 +144,9 @@ */ public Dimension getPreferredSize(JComponent a) { Dimension returnValue = - ((ComponentUI) (uis.elementAt(0))).getPreferredSize(a); + uis.elementAt(0).getPreferredSize(a); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).getPreferredSize(a); + uis.elementAt(i).getPreferredSize(a); } return returnValue; } @@ -161,9 +159,9 @@ */ public Dimension getMinimumSize(JComponent a) { Dimension returnValue = - ((ComponentUI) (uis.elementAt(0))).getMinimumSize(a); + uis.elementAt(0).getMinimumSize(a); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).getMinimumSize(a); + uis.elementAt(i).getMinimumSize(a); } return returnValue; } @@ -176,9 +174,9 @@ */ public Dimension getMaximumSize(JComponent a) { Dimension returnValue = - ((ComponentUI) (uis.elementAt(0))).getMaximumSize(a); + uis.elementAt(0).getMaximumSize(a); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).getMaximumSize(a); + uis.elementAt(i).getMaximumSize(a); } return returnValue; } @@ -191,9 +189,9 @@ */ public int getAccessibleChildrenCount(JComponent a) { int returnValue = - ((ComponentUI) (uis.elementAt(0))).getAccessibleChildrenCount(a); + uis.elementAt(0).getAccessibleChildrenCount(a); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).getAccessibleChildrenCount(a); + uis.elementAt(i).getAccessibleChildrenCount(a); } return returnValue; } @@ -206,9 +204,9 @@ */ public Accessible getAccessibleChild(JComponent a, int b) { Accessible returnValue = - ((ComponentUI) (uis.elementAt(0))).getAccessibleChild(a,b); + uis.elementAt(0).getAccessibleChild(a,b); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).getAccessibleChild(a,b); + uis.elementAt(i).getAccessibleChild(a,b); } return returnValue; } --- old/src/share/classes/javax/swing/plaf/multi/MultiColorChooserUI.java 2014-07-02 23:01:25.000000000 -0700 +++ new/src/share/classes/javax/swing/plaf/multi/MultiColorChooserUI.java 2014-07-02 23:01:25.000000000 -0700 @@ -47,7 +47,7 @@ * the getUIs method. The first element is guaranteed to be the real UI * obtained from the default look and feel. */ - protected Vector uis = new Vector(); + protected Vector uis = new Vector<>(); //////////////////// // Common UI methods @@ -80,9 +80,9 @@ */ public boolean contains(JComponent a, int b, int c) { boolean returnValue = - ((ComponentUI) (uis.elementAt(0))).contains(a,b,c); + uis.elementAt(0).contains(a,b,c); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).contains(a,b,c); + uis.elementAt(i).contains(a,b,c); } return returnValue; } @@ -92,7 +92,7 @@ */ public void update(Graphics a, JComponent b) { for (int i = 0; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).update(a,b); + uis.elementAt(i).update(a,b); } } @@ -105,10 +105,8 @@ * @return the UI delegate created */ public static ComponentUI createUI(JComponent a) { - ComponentUI mui = new MultiColorChooserUI(); - return MultiLookAndFeel.createUIs(mui, - ((MultiColorChooserUI) mui).uis, - a); + MultiColorChooserUI mui = new MultiColorChooserUI(); + return MultiLookAndFeel.createUIs(mui, mui.uis, a); } /** @@ -116,7 +114,7 @@ */ public void installUI(JComponent a) { for (int i = 0; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).installUI(a); + uis.elementAt(i).installUI(a); } } @@ -125,7 +123,7 @@ */ public void uninstallUI(JComponent a) { for (int i = 0; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).uninstallUI(a); + uis.elementAt(i).uninstallUI(a); } } @@ -134,7 +132,7 @@ */ public void paint(Graphics a, JComponent b) { for (int i = 0; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).paint(a,b); + uis.elementAt(i).paint(a,b); } } @@ -146,9 +144,9 @@ */ public Dimension getPreferredSize(JComponent a) { Dimension returnValue = - ((ComponentUI) (uis.elementAt(0))).getPreferredSize(a); + uis.elementAt(0).getPreferredSize(a); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).getPreferredSize(a); + uis.elementAt(i).getPreferredSize(a); } return returnValue; } @@ -161,9 +159,9 @@ */ public Dimension getMinimumSize(JComponent a) { Dimension returnValue = - ((ComponentUI) (uis.elementAt(0))).getMinimumSize(a); + uis.elementAt(0).getMinimumSize(a); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).getMinimumSize(a); + uis.elementAt(i).getMinimumSize(a); } return returnValue; } @@ -176,9 +174,9 @@ */ public Dimension getMaximumSize(JComponent a) { Dimension returnValue = - ((ComponentUI) (uis.elementAt(0))).getMaximumSize(a); + uis.elementAt(0).getMaximumSize(a); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).getMaximumSize(a); + uis.elementAt(i).getMaximumSize(a); } return returnValue; } @@ -191,9 +189,9 @@ */ public int getAccessibleChildrenCount(JComponent a) { int returnValue = - ((ComponentUI) (uis.elementAt(0))).getAccessibleChildrenCount(a); + uis.elementAt(0).getAccessibleChildrenCount(a); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).getAccessibleChildrenCount(a); + uis.elementAt(i).getAccessibleChildrenCount(a); } return returnValue; } @@ -206,9 +204,9 @@ */ public Accessible getAccessibleChild(JComponent a, int b) { Accessible returnValue = - ((ComponentUI) (uis.elementAt(0))).getAccessibleChild(a,b); + uis.elementAt(0).getAccessibleChild(a,b); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).getAccessibleChild(a,b); + uis.elementAt(i).getAccessibleChild(a,b); } return returnValue; } --- old/src/share/classes/javax/swing/plaf/multi/MultiComboBoxUI.java 2014-07-02 23:01:27.000000000 -0700 +++ new/src/share/classes/javax/swing/plaf/multi/MultiComboBoxUI.java 2014-07-02 23:01:27.000000000 -0700 @@ -48,7 +48,7 @@ * the getUIs method. The first element is guaranteed to be the real UI * obtained from the default look and feel. */ - protected Vector uis = new Vector(); + protected Vector uis = new Vector<>(); //////////////////// // Common UI methods @@ -75,7 +75,7 @@ * @return the value obtained from the first UI, which is * the UI obtained from the default LookAndFeel */ - public boolean isFocusTraversable(JComboBox a) { + public boolean isFocusTraversable(JComboBox a) { boolean returnValue = ((ComboBoxUI) (uis.elementAt(0))).isFocusTraversable(a); for (int i = 1; i < uis.size(); i++) { @@ -87,7 +87,7 @@ /** * Invokes the setPopupVisible method on each UI handled by this object. */ - public void setPopupVisible(JComboBox a, boolean b) { + public void setPopupVisible(JComboBox a, boolean b) { for (int i = 0; i < uis.size(); i++) { ((ComboBoxUI) (uis.elementAt(i))).setPopupVisible(a,b); } @@ -99,7 +99,7 @@ * @return the value obtained from the first UI, which is * the UI obtained from the default LookAndFeel */ - public boolean isPopupVisible(JComboBox a) { + public boolean isPopupVisible(JComboBox a) { boolean returnValue = ((ComboBoxUI) (uis.elementAt(0))).isPopupVisible(a); for (int i = 1; i < uis.size(); i++) { @@ -120,9 +120,9 @@ */ public boolean contains(JComponent a, int b, int c) { boolean returnValue = - ((ComponentUI) (uis.elementAt(0))).contains(a,b,c); + uis.elementAt(0).contains(a,b,c); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).contains(a,b,c); + uis.elementAt(i).contains(a,b,c); } return returnValue; } @@ -132,7 +132,7 @@ */ public void update(Graphics a, JComponent b) { for (int i = 0; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).update(a,b); + uis.elementAt(i).update(a,b); } } @@ -145,10 +145,8 @@ * @return the UI delegate created */ public static ComponentUI createUI(JComponent a) { - ComponentUI mui = new MultiComboBoxUI(); - return MultiLookAndFeel.createUIs(mui, - ((MultiComboBoxUI) mui).uis, - a); + MultiComboBoxUI mui = new MultiComboBoxUI(); + return MultiLookAndFeel.createUIs(mui, mui.uis, a); } /** @@ -156,7 +154,7 @@ */ public void installUI(JComponent a) { for (int i = 0; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).installUI(a); + uis.elementAt(i).installUI(a); } } @@ -165,7 +163,7 @@ */ public void uninstallUI(JComponent a) { for (int i = 0; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).uninstallUI(a); + uis.elementAt(i).uninstallUI(a); } } @@ -174,7 +172,7 @@ */ public void paint(Graphics a, JComponent b) { for (int i = 0; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).paint(a,b); + uis.elementAt(i).paint(a,b); } } @@ -186,9 +184,9 @@ */ public Dimension getPreferredSize(JComponent a) { Dimension returnValue = - ((ComponentUI) (uis.elementAt(0))).getPreferredSize(a); + uis.elementAt(0).getPreferredSize(a); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).getPreferredSize(a); + uis.elementAt(i).getPreferredSize(a); } return returnValue; } @@ -201,9 +199,9 @@ */ public Dimension getMinimumSize(JComponent a) { Dimension returnValue = - ((ComponentUI) (uis.elementAt(0))).getMinimumSize(a); + uis.elementAt(0).getMinimumSize(a); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).getMinimumSize(a); + uis.elementAt(i).getMinimumSize(a); } return returnValue; } @@ -216,9 +214,9 @@ */ public Dimension getMaximumSize(JComponent a) { Dimension returnValue = - ((ComponentUI) (uis.elementAt(0))).getMaximumSize(a); + uis.elementAt(0).getMaximumSize(a); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).getMaximumSize(a); + uis.elementAt(i).getMaximumSize(a); } return returnValue; } @@ -231,9 +229,9 @@ */ public int getAccessibleChildrenCount(JComponent a) { int returnValue = - ((ComponentUI) (uis.elementAt(0))).getAccessibleChildrenCount(a); + uis.elementAt(0).getAccessibleChildrenCount(a); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).getAccessibleChildrenCount(a); + uis.elementAt(i).getAccessibleChildrenCount(a); } return returnValue; } @@ -246,9 +244,9 @@ */ public Accessible getAccessibleChild(JComponent a, int b) { Accessible returnValue = - ((ComponentUI) (uis.elementAt(0))).getAccessibleChild(a,b); + uis.elementAt(0).getAccessibleChild(a,b); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).getAccessibleChild(a,b); + uis.elementAt(i).getAccessibleChild(a,b); } return returnValue; } --- old/src/share/classes/javax/swing/plaf/multi/MultiDesktopIconUI.java 2014-07-02 23:01:29.000000000 -0700 +++ new/src/share/classes/javax/swing/plaf/multi/MultiDesktopIconUI.java 2014-07-02 23:01:29.000000000 -0700 @@ -47,7 +47,7 @@ * the getUIs method. The first element is guaranteed to be the real UI * obtained from the default look and feel. */ - protected Vector uis = new Vector(); + protected Vector uis = new Vector<>(); //////////////////// // Common UI methods @@ -80,9 +80,9 @@ */ public boolean contains(JComponent a, int b, int c) { boolean returnValue = - ((ComponentUI) (uis.elementAt(0))).contains(a,b,c); + uis.elementAt(0).contains(a,b,c); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).contains(a,b,c); + uis.elementAt(i).contains(a,b,c); } return returnValue; } @@ -92,7 +92,7 @@ */ public void update(Graphics a, JComponent b) { for (int i = 0; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).update(a,b); + uis.elementAt(i).update(a,b); } } @@ -105,10 +105,8 @@ * @return the UI delegate created */ public static ComponentUI createUI(JComponent a) { - ComponentUI mui = new MultiDesktopIconUI(); - return MultiLookAndFeel.createUIs(mui, - ((MultiDesktopIconUI) mui).uis, - a); + MultiDesktopIconUI mui = new MultiDesktopIconUI(); + return MultiLookAndFeel.createUIs(mui, mui.uis, a); } /** @@ -116,7 +114,7 @@ */ public void installUI(JComponent a) { for (int i = 0; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).installUI(a); + uis.elementAt(i).installUI(a); } } @@ -125,7 +123,7 @@ */ public void uninstallUI(JComponent a) { for (int i = 0; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).uninstallUI(a); + uis.elementAt(i).uninstallUI(a); } } @@ -134,7 +132,7 @@ */ public void paint(Graphics a, JComponent b) { for (int i = 0; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).paint(a,b); + uis.elementAt(i).paint(a,b); } } @@ -146,9 +144,9 @@ */ public Dimension getPreferredSize(JComponent a) { Dimension returnValue = - ((ComponentUI) (uis.elementAt(0))).getPreferredSize(a); + uis.elementAt(0).getPreferredSize(a); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).getPreferredSize(a); + uis.elementAt(i).getPreferredSize(a); } return returnValue; } @@ -161,9 +159,9 @@ */ public Dimension getMinimumSize(JComponent a) { Dimension returnValue = - ((ComponentUI) (uis.elementAt(0))).getMinimumSize(a); + uis.elementAt(0).getMinimumSize(a); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).getMinimumSize(a); + uis.elementAt(i).getMinimumSize(a); } return returnValue; } @@ -176,9 +174,9 @@ */ public Dimension getMaximumSize(JComponent a) { Dimension returnValue = - ((ComponentUI) (uis.elementAt(0))).getMaximumSize(a); + uis.elementAt(0).getMaximumSize(a); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).getMaximumSize(a); + uis.elementAt(i).getMaximumSize(a); } return returnValue; } @@ -191,9 +189,9 @@ */ public int getAccessibleChildrenCount(JComponent a) { int returnValue = - ((ComponentUI) (uis.elementAt(0))).getAccessibleChildrenCount(a); + uis.elementAt(0).getAccessibleChildrenCount(a); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).getAccessibleChildrenCount(a); + uis.elementAt(i).getAccessibleChildrenCount(a); } return returnValue; } @@ -206,9 +204,9 @@ */ public Accessible getAccessibleChild(JComponent a, int b) { Accessible returnValue = - ((ComponentUI) (uis.elementAt(0))).getAccessibleChild(a,b); + uis.elementAt(0).getAccessibleChild(a,b); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).getAccessibleChild(a,b); + uis.elementAt(i).getAccessibleChild(a,b); } return returnValue; } --- old/src/share/classes/javax/swing/plaf/multi/MultiDesktopPaneUI.java 2014-07-02 23:01:31.000000000 -0700 +++ new/src/share/classes/javax/swing/plaf/multi/MultiDesktopPaneUI.java 2014-07-02 23:01:31.000000000 -0700 @@ -47,7 +47,7 @@ * the getUIs method. The first element is guaranteed to be the real UI * obtained from the default look and feel. */ - protected Vector uis = new Vector(); + protected Vector uis = new Vector<>(); //////////////////// // Common UI methods @@ -80,9 +80,9 @@ */ public boolean contains(JComponent a, int b, int c) { boolean returnValue = - ((ComponentUI) (uis.elementAt(0))).contains(a,b,c); + uis.elementAt(0).contains(a,b,c); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).contains(a,b,c); + uis.elementAt(i).contains(a,b,c); } return returnValue; } @@ -92,7 +92,7 @@ */ public void update(Graphics a, JComponent b) { for (int i = 0; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).update(a,b); + uis.elementAt(i).update(a,b); } } @@ -105,10 +105,8 @@ * @return the UI delegate created */ public static ComponentUI createUI(JComponent a) { - ComponentUI mui = new MultiDesktopPaneUI(); - return MultiLookAndFeel.createUIs(mui, - ((MultiDesktopPaneUI) mui).uis, - a); + MultiDesktopPaneUI mui = new MultiDesktopPaneUI(); + return MultiLookAndFeel.createUIs(mui, mui.uis, a); } /** @@ -116,7 +114,7 @@ */ public void installUI(JComponent a) { for (int i = 0; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).installUI(a); + uis.elementAt(i).installUI(a); } } @@ -125,7 +123,7 @@ */ public void uninstallUI(JComponent a) { for (int i = 0; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).uninstallUI(a); + uis.elementAt(i).uninstallUI(a); } } @@ -134,7 +132,7 @@ */ public void paint(Graphics a, JComponent b) { for (int i = 0; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).paint(a,b); + uis.elementAt(i).paint(a,b); } } @@ -146,9 +144,9 @@ */ public Dimension getPreferredSize(JComponent a) { Dimension returnValue = - ((ComponentUI) (uis.elementAt(0))).getPreferredSize(a); + uis.elementAt(0).getPreferredSize(a); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).getPreferredSize(a); + uis.elementAt(i).getPreferredSize(a); } return returnValue; } @@ -161,9 +159,9 @@ */ public Dimension getMinimumSize(JComponent a) { Dimension returnValue = - ((ComponentUI) (uis.elementAt(0))).getMinimumSize(a); + uis.elementAt(0).getMinimumSize(a); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).getMinimumSize(a); + uis.elementAt(i).getMinimumSize(a); } return returnValue; } @@ -176,9 +174,9 @@ */ public Dimension getMaximumSize(JComponent a) { Dimension returnValue = - ((ComponentUI) (uis.elementAt(0))).getMaximumSize(a); + uis.elementAt(0).getMaximumSize(a); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).getMaximumSize(a); + uis.elementAt(i).getMaximumSize(a); } return returnValue; } @@ -191,9 +189,9 @@ */ public int getAccessibleChildrenCount(JComponent a) { int returnValue = - ((ComponentUI) (uis.elementAt(0))).getAccessibleChildrenCount(a); + uis.elementAt(0).getAccessibleChildrenCount(a); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).getAccessibleChildrenCount(a); + uis.elementAt(i).getAccessibleChildrenCount(a); } return returnValue; } @@ -206,9 +204,9 @@ */ public Accessible getAccessibleChild(JComponent a, int b) { Accessible returnValue = - ((ComponentUI) (uis.elementAt(0))).getAccessibleChild(a,b); + uis.elementAt(0).getAccessibleChild(a,b); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).getAccessibleChild(a,b); + uis.elementAt(i).getAccessibleChild(a,b); } return returnValue; } --- old/src/share/classes/javax/swing/plaf/multi/MultiFileChooserUI.java 2014-07-02 23:01:33.000000000 -0700 +++ new/src/share/classes/javax/swing/plaf/multi/MultiFileChooserUI.java 2014-07-02 23:01:33.000000000 -0700 @@ -52,7 +52,7 @@ * the getUIs method. The first element is guaranteed to be the real UI * obtained from the default look and feel. */ - protected Vector uis = new Vector(); + protected Vector uis = new Vector<>(); //////////////////// // Common UI methods @@ -163,9 +163,9 @@ */ public boolean contains(JComponent a, int b, int c) { boolean returnValue = - ((ComponentUI) (uis.elementAt(0))).contains(a,b,c); + uis.elementAt(0).contains(a,b,c); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).contains(a,b,c); + uis.elementAt(i).contains(a,b,c); } return returnValue; } @@ -175,7 +175,7 @@ */ public void update(Graphics a, JComponent b) { for (int i = 0; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).update(a,b); + uis.elementAt(i).update(a,b); } } @@ -188,10 +188,8 @@ * @return the UI delegate created */ public static ComponentUI createUI(JComponent a) { - ComponentUI mui = new MultiFileChooserUI(); - return MultiLookAndFeel.createUIs(mui, - ((MultiFileChooserUI) mui).uis, - a); + MultiFileChooserUI mui = new MultiFileChooserUI(); + return MultiLookAndFeel.createUIs(mui, mui.uis, a); } /** @@ -199,7 +197,7 @@ */ public void installUI(JComponent a) { for (int i = 0; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).installUI(a); + uis.elementAt(i).installUI(a); } } @@ -208,7 +206,7 @@ */ public void uninstallUI(JComponent a) { for (int i = 0; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).uninstallUI(a); + uis.elementAt(i).uninstallUI(a); } } @@ -217,7 +215,7 @@ */ public void paint(Graphics a, JComponent b) { for (int i = 0; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).paint(a,b); + uis.elementAt(i).paint(a,b); } } @@ -229,9 +227,9 @@ */ public Dimension getPreferredSize(JComponent a) { Dimension returnValue = - ((ComponentUI) (uis.elementAt(0))).getPreferredSize(a); + uis.elementAt(0).getPreferredSize(a); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).getPreferredSize(a); + uis.elementAt(i).getPreferredSize(a); } return returnValue; } @@ -244,9 +242,9 @@ */ public Dimension getMinimumSize(JComponent a) { Dimension returnValue = - ((ComponentUI) (uis.elementAt(0))).getMinimumSize(a); + uis.elementAt(0).getMinimumSize(a); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).getMinimumSize(a); + uis.elementAt(i).getMinimumSize(a); } return returnValue; } @@ -259,9 +257,9 @@ */ public Dimension getMaximumSize(JComponent a) { Dimension returnValue = - ((ComponentUI) (uis.elementAt(0))).getMaximumSize(a); + uis.elementAt(0).getMaximumSize(a); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).getMaximumSize(a); + uis.elementAt(i).getMaximumSize(a); } return returnValue; } @@ -274,9 +272,9 @@ */ public int getAccessibleChildrenCount(JComponent a) { int returnValue = - ((ComponentUI) (uis.elementAt(0))).getAccessibleChildrenCount(a); + uis.elementAt(0).getAccessibleChildrenCount(a); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).getAccessibleChildrenCount(a); + uis.elementAt(i).getAccessibleChildrenCount(a); } return returnValue; } @@ -289,9 +287,9 @@ */ public Accessible getAccessibleChild(JComponent a, int b) { Accessible returnValue = - ((ComponentUI) (uis.elementAt(0))).getAccessibleChild(a,b); + uis.elementAt(0).getAccessibleChild(a,b); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).getAccessibleChild(a,b); + uis.elementAt(i).getAccessibleChild(a,b); } return returnValue; } --- old/src/share/classes/javax/swing/plaf/multi/MultiInternalFrameUI.java 2014-07-02 23:01:35.000000000 -0700 +++ new/src/share/classes/javax/swing/plaf/multi/MultiInternalFrameUI.java 2014-07-02 23:01:35.000000000 -0700 @@ -47,7 +47,7 @@ * the getUIs method. The first element is guaranteed to be the real UI * obtained from the default look and feel. */ - protected Vector uis = new Vector(); + protected Vector uis = new Vector<>(); //////////////////// // Common UI methods @@ -80,9 +80,9 @@ */ public boolean contains(JComponent a, int b, int c) { boolean returnValue = - ((ComponentUI) (uis.elementAt(0))).contains(a,b,c); + uis.elementAt(0).contains(a,b,c); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).contains(a,b,c); + uis.elementAt(i).contains(a,b,c); } return returnValue; } @@ -92,7 +92,7 @@ */ public void update(Graphics a, JComponent b) { for (int i = 0; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).update(a,b); + uis.elementAt(i).update(a,b); } } @@ -105,10 +105,8 @@ * @return the UI delegate created */ public static ComponentUI createUI(JComponent a) { - ComponentUI mui = new MultiInternalFrameUI(); - return MultiLookAndFeel.createUIs(mui, - ((MultiInternalFrameUI) mui).uis, - a); + MultiInternalFrameUI mui = new MultiInternalFrameUI(); + return MultiLookAndFeel.createUIs(mui, mui.uis, a); } /** @@ -116,7 +114,7 @@ */ public void installUI(JComponent a) { for (int i = 0; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).installUI(a); + uis.elementAt(i).installUI(a); } } @@ -125,7 +123,7 @@ */ public void uninstallUI(JComponent a) { for (int i = 0; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).uninstallUI(a); + uis.elementAt(i).uninstallUI(a); } } @@ -134,7 +132,7 @@ */ public void paint(Graphics a, JComponent b) { for (int i = 0; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).paint(a,b); + uis.elementAt(i).paint(a,b); } } @@ -146,9 +144,9 @@ */ public Dimension getPreferredSize(JComponent a) { Dimension returnValue = - ((ComponentUI) (uis.elementAt(0))).getPreferredSize(a); + uis.elementAt(0).getPreferredSize(a); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).getPreferredSize(a); + uis.elementAt(i).getPreferredSize(a); } return returnValue; } @@ -161,9 +159,9 @@ */ public Dimension getMinimumSize(JComponent a) { Dimension returnValue = - ((ComponentUI) (uis.elementAt(0))).getMinimumSize(a); + uis.elementAt(0).getMinimumSize(a); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).getMinimumSize(a); + uis.elementAt(i).getMinimumSize(a); } return returnValue; } @@ -176,9 +174,9 @@ */ public Dimension getMaximumSize(JComponent a) { Dimension returnValue = - ((ComponentUI) (uis.elementAt(0))).getMaximumSize(a); + uis.elementAt(0).getMaximumSize(a); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).getMaximumSize(a); + uis.elementAt(i).getMaximumSize(a); } return returnValue; } @@ -191,9 +189,9 @@ */ public int getAccessibleChildrenCount(JComponent a) { int returnValue = - ((ComponentUI) (uis.elementAt(0))).getAccessibleChildrenCount(a); + uis.elementAt(0).getAccessibleChildrenCount(a); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).getAccessibleChildrenCount(a); + uis.elementAt(i).getAccessibleChildrenCount(a); } return returnValue; } @@ -206,9 +204,9 @@ */ public Accessible getAccessibleChild(JComponent a, int b) { Accessible returnValue = - ((ComponentUI) (uis.elementAt(0))).getAccessibleChild(a,b); + uis.elementAt(0).getAccessibleChild(a,b); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).getAccessibleChild(a,b); + uis.elementAt(i).getAccessibleChild(a,b); } return returnValue; } --- old/src/share/classes/javax/swing/plaf/multi/MultiLabelUI.java 2014-07-02 23:01:37.000000000 -0700 +++ new/src/share/classes/javax/swing/plaf/multi/MultiLabelUI.java 2014-07-02 23:01:37.000000000 -0700 @@ -47,7 +47,7 @@ * the getUIs method. The first element is guaranteed to be the real UI * obtained from the default look and feel. */ - protected Vector uis = new Vector(); + protected Vector uis = new Vector<>(); //////////////////// // Common UI methods @@ -80,9 +80,9 @@ */ public boolean contains(JComponent a, int b, int c) { boolean returnValue = - ((ComponentUI) (uis.elementAt(0))).contains(a,b,c); + uis.elementAt(0).contains(a,b,c); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).contains(a,b,c); + uis.elementAt(i).contains(a,b,c); } return returnValue; } @@ -92,7 +92,7 @@ */ public void update(Graphics a, JComponent b) { for (int i = 0; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).update(a,b); + uis.elementAt(i).update(a,b); } } @@ -105,10 +105,8 @@ * @return the UI delegate created */ public static ComponentUI createUI(JComponent a) { - ComponentUI mui = new MultiLabelUI(); - return MultiLookAndFeel.createUIs(mui, - ((MultiLabelUI) mui).uis, - a); + MultiLabelUI mui = new MultiLabelUI(); + return MultiLookAndFeel.createUIs(mui, mui.uis, a); } /** @@ -116,7 +114,7 @@ */ public void installUI(JComponent a) { for (int i = 0; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).installUI(a); + uis.elementAt(i).installUI(a); } } @@ -125,7 +123,7 @@ */ public void uninstallUI(JComponent a) { for (int i = 0; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).uninstallUI(a); + uis.elementAt(i).uninstallUI(a); } } @@ -134,7 +132,7 @@ */ public void paint(Graphics a, JComponent b) { for (int i = 0; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).paint(a,b); + uis.elementAt(i).paint(a,b); } } @@ -146,9 +144,9 @@ */ public Dimension getPreferredSize(JComponent a) { Dimension returnValue = - ((ComponentUI) (uis.elementAt(0))).getPreferredSize(a); + uis.elementAt(0).getPreferredSize(a); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).getPreferredSize(a); + uis.elementAt(i).getPreferredSize(a); } return returnValue; } @@ -161,9 +159,9 @@ */ public Dimension getMinimumSize(JComponent a) { Dimension returnValue = - ((ComponentUI) (uis.elementAt(0))).getMinimumSize(a); + uis.elementAt(0).getMinimumSize(a); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).getMinimumSize(a); + uis.elementAt(i).getMinimumSize(a); } return returnValue; } @@ -176,9 +174,9 @@ */ public Dimension getMaximumSize(JComponent a) { Dimension returnValue = - ((ComponentUI) (uis.elementAt(0))).getMaximumSize(a); + uis.elementAt(0).getMaximumSize(a); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).getMaximumSize(a); + uis.elementAt(i).getMaximumSize(a); } return returnValue; } @@ -191,9 +189,9 @@ */ public int getAccessibleChildrenCount(JComponent a) { int returnValue = - ((ComponentUI) (uis.elementAt(0))).getAccessibleChildrenCount(a); + uis.elementAt(0).getAccessibleChildrenCount(a); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).getAccessibleChildrenCount(a); + uis.elementAt(i).getAccessibleChildrenCount(a); } return returnValue; } @@ -206,9 +204,9 @@ */ public Accessible getAccessibleChild(JComponent a, int b) { Accessible returnValue = - ((ComponentUI) (uis.elementAt(0))).getAccessibleChild(a,b); + uis.elementAt(0).getAccessibleChild(a,b); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).getAccessibleChild(a,b); + uis.elementAt(i).getAccessibleChild(a,b); } return returnValue; } --- old/src/share/classes/javax/swing/plaf/multi/MultiListUI.java 2014-07-02 23:01:39.000000000 -0700 +++ new/src/share/classes/javax/swing/plaf/multi/MultiListUI.java 2014-07-02 23:01:39.000000000 -0700 @@ -50,7 +50,7 @@ * the getUIs method. The first element is guaranteed to be the real UI * obtained from the default look and feel. */ - protected Vector uis = new Vector(); + protected Vector uis = new Vector<>(); //////////////////// // Common UI methods @@ -77,7 +77,7 @@ * @return the value obtained from the first UI, which is * the UI obtained from the default LookAndFeel */ - public int locationToIndex(JList a, Point b) { + public int locationToIndex(JList a, Point b) { int returnValue = ((ListUI) (uis.elementAt(0))).locationToIndex(a,b); for (int i = 1; i < uis.size(); i++) { @@ -92,7 +92,7 @@ * @return the value obtained from the first UI, which is * the UI obtained from the default LookAndFeel */ - public Point indexToLocation(JList a, int b) { + public Point indexToLocation(JList a, int b) { Point returnValue = ((ListUI) (uis.elementAt(0))).indexToLocation(a,b); for (int i = 1; i < uis.size(); i++) { @@ -107,7 +107,7 @@ * @return the value obtained from the first UI, which is * the UI obtained from the default LookAndFeel */ - public Rectangle getCellBounds(JList a, int b, int c) { + public Rectangle getCellBounds(JList a, int b, int c) { Rectangle returnValue = ((ListUI) (uis.elementAt(0))).getCellBounds(a,b,c); for (int i = 1; i < uis.size(); i++) { @@ -128,9 +128,9 @@ */ public boolean contains(JComponent a, int b, int c) { boolean returnValue = - ((ComponentUI) (uis.elementAt(0))).contains(a,b,c); + uis.elementAt(0).contains(a,b,c); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).contains(a,b,c); + uis.elementAt(i).contains(a,b,c); } return returnValue; } @@ -140,7 +140,7 @@ */ public void update(Graphics a, JComponent b) { for (int i = 0; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).update(a,b); + uis.elementAt(i).update(a,b); } } @@ -153,10 +153,8 @@ * @return the UI delegate created */ public static ComponentUI createUI(JComponent a) { - ComponentUI mui = new MultiListUI(); - return MultiLookAndFeel.createUIs(mui, - ((MultiListUI) mui).uis, - a); + MultiListUI mui = new MultiListUI(); + return MultiLookAndFeel.createUIs(mui, mui.uis, a); } /** @@ -164,7 +162,7 @@ */ public void installUI(JComponent a) { for (int i = 0; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).installUI(a); + uis.elementAt(i).installUI(a); } } @@ -173,7 +171,7 @@ */ public void uninstallUI(JComponent a) { for (int i = 0; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).uninstallUI(a); + uis.elementAt(i).uninstallUI(a); } } @@ -182,7 +180,7 @@ */ public void paint(Graphics a, JComponent b) { for (int i = 0; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).paint(a,b); + uis.elementAt(i).paint(a,b); } } @@ -194,9 +192,9 @@ */ public Dimension getPreferredSize(JComponent a) { Dimension returnValue = - ((ComponentUI) (uis.elementAt(0))).getPreferredSize(a); + uis.elementAt(0).getPreferredSize(a); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).getPreferredSize(a); + uis.elementAt(i).getPreferredSize(a); } return returnValue; } @@ -209,9 +207,9 @@ */ public Dimension getMinimumSize(JComponent a) { Dimension returnValue = - ((ComponentUI) (uis.elementAt(0))).getMinimumSize(a); + uis.elementAt(0).getMinimumSize(a); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).getMinimumSize(a); + uis.elementAt(i).getMinimumSize(a); } return returnValue; } @@ -224,9 +222,9 @@ */ public Dimension getMaximumSize(JComponent a) { Dimension returnValue = - ((ComponentUI) (uis.elementAt(0))).getMaximumSize(a); + uis.elementAt(0).getMaximumSize(a); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).getMaximumSize(a); + uis.elementAt(i).getMaximumSize(a); } return returnValue; } @@ -239,9 +237,9 @@ */ public int getAccessibleChildrenCount(JComponent a) { int returnValue = - ((ComponentUI) (uis.elementAt(0))).getAccessibleChildrenCount(a); + uis.elementAt(0).getAccessibleChildrenCount(a); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).getAccessibleChildrenCount(a); + uis.elementAt(i).getAccessibleChildrenCount(a); } return returnValue; } @@ -254,9 +252,9 @@ */ public Accessible getAccessibleChild(JComponent a, int b) { Accessible returnValue = - ((ComponentUI) (uis.elementAt(0))).getAccessibleChild(a,b); + uis.elementAt(0).getAccessibleChild(a,b); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).getAccessibleChild(a,b); + uis.elementAt(i).getAccessibleChild(a,b); } return returnValue; } --- old/src/share/classes/javax/swing/plaf/multi/MultiLookAndFeel.java 2014-07-02 23:01:41.000000000 -0700 +++ new/src/share/classes/javax/swing/plaf/multi/MultiLookAndFeel.java 2014-07-02 23:01:41.000000000 -0700 @@ -221,7 +221,7 @@ * @see MultiButtonUI#createUI */ public static ComponentUI createUIs(ComponentUI mui, - Vector uis, + Vector uis, JComponent target) { ComponentUI ui; @@ -248,7 +248,7 @@ // get a UI from just the default look and feel. // if (uis.size() == 1) { - return (ComponentUI) uis.elementAt(0); + return uis.elementAt(0); } else { return mui; } @@ -269,7 +269,7 @@ * @return an array equivalent to the passed-in vector * */ - protected static ComponentUI[] uisToArray(Vector uis) { + protected static ComponentUI[] uisToArray(Vector uis) { if (uis == null) { return new ComponentUI[0]; } else { @@ -277,7 +277,7 @@ if (count > 0) { ComponentUI[] u = new ComponentUI[count]; for (int i = 0; i < count; i++) { - u[i] = (ComponentUI)uis.elementAt(i); + u[i] = uis.elementAt(i); } return u; } else { --- old/src/share/classes/javax/swing/plaf/multi/MultiMenuBarUI.java 2014-07-02 23:01:43.000000000 -0700 +++ new/src/share/classes/javax/swing/plaf/multi/MultiMenuBarUI.java 2014-07-02 23:01:43.000000000 -0700 @@ -47,7 +47,7 @@ * the getUIs method. The first element is guaranteed to be the real UI * obtained from the default look and feel. */ - protected Vector uis = new Vector(); + protected Vector uis = new Vector<>(); //////////////////// // Common UI methods @@ -80,9 +80,9 @@ */ public boolean contains(JComponent a, int b, int c) { boolean returnValue = - ((ComponentUI) (uis.elementAt(0))).contains(a,b,c); + uis.elementAt(0).contains(a,b,c); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).contains(a,b,c); + uis.elementAt(i).contains(a,b,c); } return returnValue; } @@ -92,7 +92,7 @@ */ public void update(Graphics a, JComponent b) { for (int i = 0; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).update(a,b); + uis.elementAt(i).update(a,b); } } @@ -105,10 +105,8 @@ * @return the UI delegate created */ public static ComponentUI createUI(JComponent a) { - ComponentUI mui = new MultiMenuBarUI(); - return MultiLookAndFeel.createUIs(mui, - ((MultiMenuBarUI) mui).uis, - a); + MultiMenuBarUI mui = new MultiMenuBarUI(); + return MultiLookAndFeel.createUIs(mui,mui.uis, a); } /** @@ -116,7 +114,7 @@ */ public void installUI(JComponent a) { for (int i = 0; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).installUI(a); + uis.elementAt(i).installUI(a); } } @@ -125,7 +123,7 @@ */ public void uninstallUI(JComponent a) { for (int i = 0; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).uninstallUI(a); + uis.elementAt(i).uninstallUI(a); } } @@ -134,7 +132,7 @@ */ public void paint(Graphics a, JComponent b) { for (int i = 0; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).paint(a,b); + uis.elementAt(i).paint(a,b); } } @@ -146,9 +144,9 @@ */ public Dimension getPreferredSize(JComponent a) { Dimension returnValue = - ((ComponentUI) (uis.elementAt(0))).getPreferredSize(a); + uis.elementAt(0).getPreferredSize(a); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).getPreferredSize(a); + uis.elementAt(i).getPreferredSize(a); } return returnValue; } @@ -161,9 +159,9 @@ */ public Dimension getMinimumSize(JComponent a) { Dimension returnValue = - ((ComponentUI) (uis.elementAt(0))).getMinimumSize(a); + uis.elementAt(0).getMinimumSize(a); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).getMinimumSize(a); + uis.elementAt(i).getMinimumSize(a); } return returnValue; } @@ -176,9 +174,9 @@ */ public Dimension getMaximumSize(JComponent a) { Dimension returnValue = - ((ComponentUI) (uis.elementAt(0))).getMaximumSize(a); + uis.elementAt(0).getMaximumSize(a); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).getMaximumSize(a); + uis.elementAt(i).getMaximumSize(a); } return returnValue; } @@ -191,9 +189,9 @@ */ public int getAccessibleChildrenCount(JComponent a) { int returnValue = - ((ComponentUI) (uis.elementAt(0))).getAccessibleChildrenCount(a); + uis.elementAt(0).getAccessibleChildrenCount(a); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).getAccessibleChildrenCount(a); + uis.elementAt(i).getAccessibleChildrenCount(a); } return returnValue; } @@ -206,9 +204,9 @@ */ public Accessible getAccessibleChild(JComponent a, int b) { Accessible returnValue = - ((ComponentUI) (uis.elementAt(0))).getAccessibleChild(a,b); + uis.elementAt(0).getAccessibleChild(a,b); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).getAccessibleChild(a,b); + uis.elementAt(i).getAccessibleChild(a,b); } return returnValue; } --- old/src/share/classes/javax/swing/plaf/multi/MultiMenuItemUI.java 2014-07-02 23:01:45.000000000 -0700 +++ new/src/share/classes/javax/swing/plaf/multi/MultiMenuItemUI.java 2014-07-02 23:01:45.000000000 -0700 @@ -48,7 +48,7 @@ * the getUIs method. The first element is guaranteed to be the real UI * obtained from the default look and feel. */ - protected Vector uis = new Vector(); + protected Vector uis = new Vector<>(); //////////////////// // Common UI methods @@ -85,9 +85,9 @@ */ public boolean contains(JComponent a, int b, int c) { boolean returnValue = - ((ComponentUI) (uis.elementAt(0))).contains(a,b,c); + uis.elementAt(0).contains(a,b,c); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).contains(a,b,c); + uis.elementAt(i).contains(a,b,c); } return returnValue; } @@ -97,7 +97,7 @@ */ public void update(Graphics a, JComponent b) { for (int i = 0; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).update(a,b); + uis.elementAt(i).update(a,b); } } @@ -110,10 +110,8 @@ * @return the UI delegate created */ public static ComponentUI createUI(JComponent a) { - ComponentUI mui = new MultiMenuItemUI(); - return MultiLookAndFeel.createUIs(mui, - ((MultiMenuItemUI) mui).uis, - a); + MultiMenuItemUI mui = new MultiMenuItemUI(); + return MultiLookAndFeel.createUIs(mui, mui.uis, a); } /** @@ -121,7 +119,7 @@ */ public void installUI(JComponent a) { for (int i = 0; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).installUI(a); + uis.elementAt(i).installUI(a); } } @@ -130,7 +128,7 @@ */ public void uninstallUI(JComponent a) { for (int i = 0; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).uninstallUI(a); + uis.elementAt(i).uninstallUI(a); } } @@ -139,7 +137,7 @@ */ public void paint(Graphics a, JComponent b) { for (int i = 0; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).paint(a,b); + uis.elementAt(i).paint(a,b); } } @@ -151,9 +149,9 @@ */ public Dimension getPreferredSize(JComponent a) { Dimension returnValue = - ((ComponentUI) (uis.elementAt(0))).getPreferredSize(a); + uis.elementAt(0).getPreferredSize(a); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).getPreferredSize(a); + uis.elementAt(i).getPreferredSize(a); } return returnValue; } @@ -166,9 +164,9 @@ */ public Dimension getMinimumSize(JComponent a) { Dimension returnValue = - ((ComponentUI) (uis.elementAt(0))).getMinimumSize(a); + uis.elementAt(0).getMinimumSize(a); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).getMinimumSize(a); + uis.elementAt(i).getMinimumSize(a); } return returnValue; } @@ -181,9 +179,9 @@ */ public Dimension getMaximumSize(JComponent a) { Dimension returnValue = - ((ComponentUI) (uis.elementAt(0))).getMaximumSize(a); + uis.elementAt(0).getMaximumSize(a); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).getMaximumSize(a); + uis.elementAt(i).getMaximumSize(a); } return returnValue; } @@ -196,9 +194,9 @@ */ public int getAccessibleChildrenCount(JComponent a) { int returnValue = - ((ComponentUI) (uis.elementAt(0))).getAccessibleChildrenCount(a); + uis.elementAt(0).getAccessibleChildrenCount(a); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).getAccessibleChildrenCount(a); + uis.elementAt(i).getAccessibleChildrenCount(a); } return returnValue; } @@ -211,9 +209,9 @@ */ public Accessible getAccessibleChild(JComponent a, int b) { Accessible returnValue = - ((ComponentUI) (uis.elementAt(0))).getAccessibleChild(a,b); + uis.elementAt(0).getAccessibleChild(a,b); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).getAccessibleChild(a,b); + uis.elementAt(i).getAccessibleChild(a,b); } return returnValue; } --- old/src/share/classes/javax/swing/plaf/multi/MultiOptionPaneUI.java 2014-07-02 23:01:47.000000000 -0700 +++ new/src/share/classes/javax/swing/plaf/multi/MultiOptionPaneUI.java 2014-07-02 23:01:47.000000000 -0700 @@ -48,7 +48,7 @@ * the getUIs method. The first element is guaranteed to be the real UI * obtained from the default look and feel. */ - protected Vector uis = new Vector(); + protected Vector uis = new Vector<>(); //////////////////// // Common UI methods @@ -105,9 +105,9 @@ */ public boolean contains(JComponent a, int b, int c) { boolean returnValue = - ((ComponentUI) (uis.elementAt(0))).contains(a,b,c); + uis.elementAt(0).contains(a,b,c); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).contains(a,b,c); + uis.elementAt(i).contains(a,b,c); } return returnValue; } @@ -117,7 +117,7 @@ */ public void update(Graphics a, JComponent b) { for (int i = 0; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).update(a,b); + uis.elementAt(i).update(a,b); } } @@ -130,10 +130,8 @@ * @return the UI delegate created */ public static ComponentUI createUI(JComponent a) { - ComponentUI mui = new MultiOptionPaneUI(); - return MultiLookAndFeel.createUIs(mui, - ((MultiOptionPaneUI) mui).uis, - a); + MultiOptionPaneUI mui = new MultiOptionPaneUI(); + return MultiLookAndFeel.createUIs(mui, mui.uis, a); } /** @@ -141,7 +139,7 @@ */ public void installUI(JComponent a) { for (int i = 0; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).installUI(a); + uis.elementAt(i).installUI(a); } } @@ -150,7 +148,7 @@ */ public void uninstallUI(JComponent a) { for (int i = 0; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).uninstallUI(a); + uis.elementAt(i).uninstallUI(a); } } @@ -159,7 +157,7 @@ */ public void paint(Graphics a, JComponent b) { for (int i = 0; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).paint(a,b); + uis.elementAt(i).paint(a,b); } } @@ -171,9 +169,9 @@ */ public Dimension getPreferredSize(JComponent a) { Dimension returnValue = - ((ComponentUI) (uis.elementAt(0))).getPreferredSize(a); + uis.elementAt(0).getPreferredSize(a); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).getPreferredSize(a); + uis.elementAt(i).getPreferredSize(a); } return returnValue; } @@ -186,9 +184,9 @@ */ public Dimension getMinimumSize(JComponent a) { Dimension returnValue = - ((ComponentUI) (uis.elementAt(0))).getMinimumSize(a); + uis.elementAt(0).getMinimumSize(a); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).getMinimumSize(a); + uis.elementAt(i).getMinimumSize(a); } return returnValue; } @@ -201,9 +199,9 @@ */ public Dimension getMaximumSize(JComponent a) { Dimension returnValue = - ((ComponentUI) (uis.elementAt(0))).getMaximumSize(a); + uis.elementAt(0).getMaximumSize(a); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).getMaximumSize(a); + uis.elementAt(i).getMaximumSize(a); } return returnValue; } @@ -216,9 +214,9 @@ */ public int getAccessibleChildrenCount(JComponent a) { int returnValue = - ((ComponentUI) (uis.elementAt(0))).getAccessibleChildrenCount(a); + uis.elementAt(0).getAccessibleChildrenCount(a); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).getAccessibleChildrenCount(a); + uis.elementAt(i).getAccessibleChildrenCount(a); } return returnValue; } @@ -231,9 +229,9 @@ */ public Accessible getAccessibleChild(JComponent a, int b) { Accessible returnValue = - ((ComponentUI) (uis.elementAt(0))).getAccessibleChild(a,b); + uis.elementAt(0).getAccessibleChild(a,b); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).getAccessibleChild(a,b); + uis.elementAt(i).getAccessibleChild(a,b); } return returnValue; } --- old/src/share/classes/javax/swing/plaf/multi/MultiPanelUI.java 2014-07-02 23:01:49.000000000 -0700 +++ new/src/share/classes/javax/swing/plaf/multi/MultiPanelUI.java 2014-07-02 23:01:49.000000000 -0700 @@ -47,7 +47,7 @@ * the getUIs method. The first element is guaranteed to be the real UI * obtained from the default look and feel. */ - protected Vector uis = new Vector(); + protected Vector uis = new Vector<>(); //////////////////// // Common UI methods @@ -80,9 +80,9 @@ */ public boolean contains(JComponent a, int b, int c) { boolean returnValue = - ((ComponentUI) (uis.elementAt(0))).contains(a,b,c); + uis.elementAt(0).contains(a,b,c); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).contains(a,b,c); + uis.elementAt(i).contains(a,b,c); } return returnValue; } @@ -92,7 +92,7 @@ */ public void update(Graphics a, JComponent b) { for (int i = 0; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).update(a,b); + uis.elementAt(i).update(a,b); } } @@ -105,10 +105,8 @@ * @return the UI delegate created */ public static ComponentUI createUI(JComponent a) { - ComponentUI mui = new MultiPanelUI(); - return MultiLookAndFeel.createUIs(mui, - ((MultiPanelUI) mui).uis, - a); + MultiPanelUI mui = new MultiPanelUI(); + return MultiLookAndFeel.createUIs(mui, mui.uis, a); } /** @@ -116,7 +114,7 @@ */ public void installUI(JComponent a) { for (int i = 0; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).installUI(a); + uis.elementAt(i).installUI(a); } } @@ -125,7 +123,7 @@ */ public void uninstallUI(JComponent a) { for (int i = 0; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).uninstallUI(a); + uis.elementAt(i).uninstallUI(a); } } @@ -134,7 +132,7 @@ */ public void paint(Graphics a, JComponent b) { for (int i = 0; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).paint(a,b); + uis.elementAt(i).paint(a,b); } } @@ -146,9 +144,9 @@ */ public Dimension getPreferredSize(JComponent a) { Dimension returnValue = - ((ComponentUI) (uis.elementAt(0))).getPreferredSize(a); + uis.elementAt(0).getPreferredSize(a); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).getPreferredSize(a); + uis.elementAt(i).getPreferredSize(a); } return returnValue; } @@ -161,9 +159,9 @@ */ public Dimension getMinimumSize(JComponent a) { Dimension returnValue = - ((ComponentUI) (uis.elementAt(0))).getMinimumSize(a); + uis.elementAt(0).getMinimumSize(a); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).getMinimumSize(a); + uis.elementAt(i).getMinimumSize(a); } return returnValue; } @@ -176,9 +174,9 @@ */ public Dimension getMaximumSize(JComponent a) { Dimension returnValue = - ((ComponentUI) (uis.elementAt(0))).getMaximumSize(a); + uis.elementAt(0).getMaximumSize(a); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).getMaximumSize(a); + uis.elementAt(i).getMaximumSize(a); } return returnValue; } @@ -191,9 +189,9 @@ */ public int getAccessibleChildrenCount(JComponent a) { int returnValue = - ((ComponentUI) (uis.elementAt(0))).getAccessibleChildrenCount(a); + uis.elementAt(0).getAccessibleChildrenCount(a); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).getAccessibleChildrenCount(a); + uis.elementAt(i).getAccessibleChildrenCount(a); } return returnValue; } @@ -206,9 +204,9 @@ */ public Accessible getAccessibleChild(JComponent a, int b) { Accessible returnValue = - ((ComponentUI) (uis.elementAt(0))).getAccessibleChild(a,b); + uis.elementAt(0).getAccessibleChild(a,b); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).getAccessibleChild(a,b); + uis.elementAt(i).getAccessibleChild(a,b); } return returnValue; } --- old/src/share/classes/javax/swing/plaf/multi/MultiPopupMenuUI.java 2014-07-02 23:01:51.000000000 -0700 +++ new/src/share/classes/javax/swing/plaf/multi/MultiPopupMenuUI.java 2014-07-02 23:01:51.000000000 -0700 @@ -50,7 +50,7 @@ * the getUIs method. The first element is guaranteed to be the real UI * obtained from the default look and feel. */ - protected Vector uis = new Vector(); + protected Vector uis = new Vector<>(); //////////////////// // Common UI methods @@ -115,9 +115,9 @@ */ public boolean contains(JComponent a, int b, int c) { boolean returnValue = - ((ComponentUI) (uis.elementAt(0))).contains(a,b,c); + uis.elementAt(0).contains(a,b,c); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).contains(a,b,c); + uis.elementAt(i).contains(a,b,c); } return returnValue; } @@ -127,7 +127,7 @@ */ public void update(Graphics a, JComponent b) { for (int i = 0; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).update(a,b); + uis.elementAt(i).update(a,b); } } @@ -140,10 +140,8 @@ * @return the UI delegate created */ public static ComponentUI createUI(JComponent a) { - ComponentUI mui = new MultiPopupMenuUI(); - return MultiLookAndFeel.createUIs(mui, - ((MultiPopupMenuUI) mui).uis, - a); + MultiPopupMenuUI mui = new MultiPopupMenuUI(); + return MultiLookAndFeel.createUIs(mui, mui.uis, a); } /** @@ -151,7 +149,7 @@ */ public void installUI(JComponent a) { for (int i = 0; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).installUI(a); + uis.elementAt(i).installUI(a); } } @@ -160,7 +158,7 @@ */ public void uninstallUI(JComponent a) { for (int i = 0; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).uninstallUI(a); + uis.elementAt(i).uninstallUI(a); } } @@ -169,7 +167,7 @@ */ public void paint(Graphics a, JComponent b) { for (int i = 0; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).paint(a,b); + uis.elementAt(i).paint(a,b); } } @@ -181,9 +179,9 @@ */ public Dimension getPreferredSize(JComponent a) { Dimension returnValue = - ((ComponentUI) (uis.elementAt(0))).getPreferredSize(a); + uis.elementAt(0).getPreferredSize(a); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).getPreferredSize(a); + uis.elementAt(i).getPreferredSize(a); } return returnValue; } @@ -196,9 +194,9 @@ */ public Dimension getMinimumSize(JComponent a) { Dimension returnValue = - ((ComponentUI) (uis.elementAt(0))).getMinimumSize(a); + uis.elementAt(0).getMinimumSize(a); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).getMinimumSize(a); + uis.elementAt(i).getMinimumSize(a); } return returnValue; } @@ -211,9 +209,9 @@ */ public Dimension getMaximumSize(JComponent a) { Dimension returnValue = - ((ComponentUI) (uis.elementAt(0))).getMaximumSize(a); + uis.elementAt(0).getMaximumSize(a); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).getMaximumSize(a); + uis.elementAt(i).getMaximumSize(a); } return returnValue; } @@ -226,9 +224,9 @@ */ public int getAccessibleChildrenCount(JComponent a) { int returnValue = - ((ComponentUI) (uis.elementAt(0))).getAccessibleChildrenCount(a); + uis.elementAt(0).getAccessibleChildrenCount(a); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).getAccessibleChildrenCount(a); + uis.elementAt(i).getAccessibleChildrenCount(a); } return returnValue; } @@ -241,9 +239,9 @@ */ public Accessible getAccessibleChild(JComponent a, int b) { Accessible returnValue = - ((ComponentUI) (uis.elementAt(0))).getAccessibleChild(a,b); + uis.elementAt(0).getAccessibleChild(a,b); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).getAccessibleChild(a,b); + uis.elementAt(i).getAccessibleChild(a,b); } return returnValue; } --- old/src/share/classes/javax/swing/plaf/multi/MultiProgressBarUI.java 2014-07-02 23:01:53.000000000 -0700 +++ new/src/share/classes/javax/swing/plaf/multi/MultiProgressBarUI.java 2014-07-02 23:01:53.000000000 -0700 @@ -47,7 +47,7 @@ * the getUIs method. The first element is guaranteed to be the real UI * obtained from the default look and feel. */ - protected Vector uis = new Vector(); + protected Vector uis = new Vector<>(); //////////////////// // Common UI methods @@ -80,9 +80,9 @@ */ public boolean contains(JComponent a, int b, int c) { boolean returnValue = - ((ComponentUI) (uis.elementAt(0))).contains(a,b,c); + uis.elementAt(0).contains(a,b,c); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).contains(a,b,c); + uis.elementAt(i).contains(a,b,c); } return returnValue; } @@ -92,7 +92,7 @@ */ public void update(Graphics a, JComponent b) { for (int i = 0; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).update(a,b); + uis.elementAt(i).update(a,b); } } @@ -105,10 +105,8 @@ * @return the UI delegate created */ public static ComponentUI createUI(JComponent a) { - ComponentUI mui = new MultiProgressBarUI(); - return MultiLookAndFeel.createUIs(mui, - ((MultiProgressBarUI) mui).uis, - a); + MultiProgressBarUI mui = new MultiProgressBarUI(); + return MultiLookAndFeel.createUIs(mui, mui.uis, a); } /** @@ -116,7 +114,7 @@ */ public void installUI(JComponent a) { for (int i = 0; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).installUI(a); + uis.elementAt(i).installUI(a); } } @@ -125,7 +123,7 @@ */ public void uninstallUI(JComponent a) { for (int i = 0; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).uninstallUI(a); + uis.elementAt(i).uninstallUI(a); } } @@ -134,7 +132,7 @@ */ public void paint(Graphics a, JComponent b) { for (int i = 0; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).paint(a,b); + uis.elementAt(i).paint(a,b); } } @@ -146,9 +144,9 @@ */ public Dimension getPreferredSize(JComponent a) { Dimension returnValue = - ((ComponentUI) (uis.elementAt(0))).getPreferredSize(a); + uis.elementAt(0).getPreferredSize(a); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).getPreferredSize(a); + uis.elementAt(i).getPreferredSize(a); } return returnValue; } @@ -161,9 +159,9 @@ */ public Dimension getMinimumSize(JComponent a) { Dimension returnValue = - ((ComponentUI) (uis.elementAt(0))).getMinimumSize(a); + uis.elementAt(0).getMinimumSize(a); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).getMinimumSize(a); + uis.elementAt(i).getMinimumSize(a); } return returnValue; } @@ -176,9 +174,9 @@ */ public Dimension getMaximumSize(JComponent a) { Dimension returnValue = - ((ComponentUI) (uis.elementAt(0))).getMaximumSize(a); + uis.elementAt(0).getMaximumSize(a); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).getMaximumSize(a); + uis.elementAt(i).getMaximumSize(a); } return returnValue; } @@ -191,9 +189,9 @@ */ public int getAccessibleChildrenCount(JComponent a) { int returnValue = - ((ComponentUI) (uis.elementAt(0))).getAccessibleChildrenCount(a); + uis.elementAt(0).getAccessibleChildrenCount(a); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).getAccessibleChildrenCount(a); + uis.elementAt(i).getAccessibleChildrenCount(a); } return returnValue; } @@ -206,9 +204,9 @@ */ public Accessible getAccessibleChild(JComponent a, int b) { Accessible returnValue = - ((ComponentUI) (uis.elementAt(0))).getAccessibleChild(a,b); + uis.elementAt(0).getAccessibleChild(a,b); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).getAccessibleChild(a,b); + uis.elementAt(i).getAccessibleChild(a,b); } return returnValue; } --- old/src/share/classes/javax/swing/plaf/multi/MultiRootPaneUI.java 2014-07-02 23:01:55.000000000 -0700 +++ new/src/share/classes/javax/swing/plaf/multi/MultiRootPaneUI.java 2014-07-02 23:01:55.000000000 -0700 @@ -48,7 +48,7 @@ * the getUIs method. The first element is guaranteed to be the real UI * obtained from the default look and feel. */ - protected Vector uis = new Vector(); + protected Vector uis = new Vector<>(); //////////////////// // Common UI methods @@ -81,9 +81,9 @@ */ public boolean contains(JComponent a, int b, int c) { boolean returnValue = - ((ComponentUI) (uis.elementAt(0))).contains(a,b,c); + uis.elementAt(0).contains(a,b,c); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).contains(a,b,c); + uis.elementAt(i).contains(a,b,c); } return returnValue; } @@ -93,7 +93,7 @@ */ public void update(Graphics a, JComponent b) { for (int i = 0; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).update(a,b); + uis.elementAt(i).update(a,b); } } @@ -106,10 +106,8 @@ * @return the UI delegate created */ public static ComponentUI createUI(JComponent a) { - ComponentUI mui = new MultiRootPaneUI(); - return MultiLookAndFeel.createUIs(mui, - ((MultiRootPaneUI) mui).uis, - a); + MultiRootPaneUI mui = new MultiRootPaneUI(); + return MultiLookAndFeel.createUIs(mui, mui.uis, a); } /** @@ -117,7 +115,7 @@ */ public void installUI(JComponent a) { for (int i = 0; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).installUI(a); + uis.elementAt(i).installUI(a); } } @@ -126,7 +124,7 @@ */ public void uninstallUI(JComponent a) { for (int i = 0; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).uninstallUI(a); + uis.elementAt(i).uninstallUI(a); } } @@ -135,7 +133,7 @@ */ public void paint(Graphics a, JComponent b) { for (int i = 0; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).paint(a,b); + uis.elementAt(i).paint(a,b); } } @@ -147,9 +145,9 @@ */ public Dimension getPreferredSize(JComponent a) { Dimension returnValue = - ((ComponentUI) (uis.elementAt(0))).getPreferredSize(a); + uis.elementAt(0).getPreferredSize(a); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).getPreferredSize(a); + uis.elementAt(i).getPreferredSize(a); } return returnValue; } @@ -162,9 +160,9 @@ */ public Dimension getMinimumSize(JComponent a) { Dimension returnValue = - ((ComponentUI) (uis.elementAt(0))).getMinimumSize(a); + uis.elementAt(0).getMinimumSize(a); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).getMinimumSize(a); + uis.elementAt(i).getMinimumSize(a); } return returnValue; } @@ -177,9 +175,9 @@ */ public Dimension getMaximumSize(JComponent a) { Dimension returnValue = - ((ComponentUI) (uis.elementAt(0))).getMaximumSize(a); + uis.elementAt(0).getMaximumSize(a); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).getMaximumSize(a); + uis.elementAt(i).getMaximumSize(a); } return returnValue; } @@ -192,9 +190,9 @@ */ public int getAccessibleChildrenCount(JComponent a) { int returnValue = - ((ComponentUI) (uis.elementAt(0))).getAccessibleChildrenCount(a); + uis.elementAt(0).getAccessibleChildrenCount(a); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).getAccessibleChildrenCount(a); + uis.elementAt(i).getAccessibleChildrenCount(a); } return returnValue; } @@ -207,9 +205,9 @@ */ public Accessible getAccessibleChild(JComponent a, int b) { Accessible returnValue = - ((ComponentUI) (uis.elementAt(0))).getAccessibleChild(a,b); + uis.elementAt(0).getAccessibleChild(a,b); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).getAccessibleChild(a,b); + uis.elementAt(i).getAccessibleChild(a,b); } return returnValue; } --- old/src/share/classes/javax/swing/plaf/multi/MultiScrollBarUI.java 2014-07-02 23:01:57.000000000 -0700 +++ new/src/share/classes/javax/swing/plaf/multi/MultiScrollBarUI.java 2014-07-02 23:01:56.000000000 -0700 @@ -47,7 +47,7 @@ * the getUIs method. The first element is guaranteed to be the real UI * obtained from the default look and feel. */ - protected Vector uis = new Vector(); + protected Vector uis = new Vector<>(); //////////////////// // Common UI methods @@ -80,9 +80,9 @@ */ public boolean contains(JComponent a, int b, int c) { boolean returnValue = - ((ComponentUI) (uis.elementAt(0))).contains(a,b,c); + uis.elementAt(0).contains(a,b,c); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).contains(a,b,c); + uis.elementAt(i).contains(a,b,c); } return returnValue; } @@ -92,7 +92,7 @@ */ public void update(Graphics a, JComponent b) { for (int i = 0; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).update(a,b); + uis.elementAt(i).update(a,b); } } @@ -105,10 +105,8 @@ * @return the UI delegate created */ public static ComponentUI createUI(JComponent a) { - ComponentUI mui = new MultiScrollBarUI(); - return MultiLookAndFeel.createUIs(mui, - ((MultiScrollBarUI) mui).uis, - a); + MultiScrollBarUI mui = new MultiScrollBarUI(); + return MultiLookAndFeel.createUIs(mui, mui.uis, a); } /** @@ -116,7 +114,7 @@ */ public void installUI(JComponent a) { for (int i = 0; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).installUI(a); + uis.elementAt(i).installUI(a); } } @@ -125,7 +123,7 @@ */ public void uninstallUI(JComponent a) { for (int i = 0; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).uninstallUI(a); + uis.elementAt(i).uninstallUI(a); } } @@ -134,7 +132,7 @@ */ public void paint(Graphics a, JComponent b) { for (int i = 0; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).paint(a,b); + uis.elementAt(i).paint(a,b); } } @@ -146,9 +144,9 @@ */ public Dimension getPreferredSize(JComponent a) { Dimension returnValue = - ((ComponentUI) (uis.elementAt(0))).getPreferredSize(a); + uis.elementAt(0).getPreferredSize(a); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).getPreferredSize(a); + uis.elementAt(i).getPreferredSize(a); } return returnValue; } @@ -161,9 +159,9 @@ */ public Dimension getMinimumSize(JComponent a) { Dimension returnValue = - ((ComponentUI) (uis.elementAt(0))).getMinimumSize(a); + uis.elementAt(0).getMinimumSize(a); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).getMinimumSize(a); + uis.elementAt(i).getMinimumSize(a); } return returnValue; } @@ -176,9 +174,9 @@ */ public Dimension getMaximumSize(JComponent a) { Dimension returnValue = - ((ComponentUI) (uis.elementAt(0))).getMaximumSize(a); + uis.elementAt(0).getMaximumSize(a); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).getMaximumSize(a); + uis.elementAt(i).getMaximumSize(a); } return returnValue; } @@ -191,9 +189,9 @@ */ public int getAccessibleChildrenCount(JComponent a) { int returnValue = - ((ComponentUI) (uis.elementAt(0))).getAccessibleChildrenCount(a); + uis.elementAt(0).getAccessibleChildrenCount(a); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).getAccessibleChildrenCount(a); + uis.elementAt(i).getAccessibleChildrenCount(a); } return returnValue; } @@ -206,9 +204,9 @@ */ public Accessible getAccessibleChild(JComponent a, int b) { Accessible returnValue = - ((ComponentUI) (uis.elementAt(0))).getAccessibleChild(a,b); + uis.elementAt(0).getAccessibleChild(a,b); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).getAccessibleChild(a,b); + uis.elementAt(i).getAccessibleChild(a,b); } return returnValue; } --- old/src/share/classes/javax/swing/plaf/multi/MultiScrollPaneUI.java 2014-07-02 23:01:59.000000000 -0700 +++ new/src/share/classes/javax/swing/plaf/multi/MultiScrollPaneUI.java 2014-07-02 23:01:58.000000000 -0700 @@ -47,7 +47,7 @@ * the getUIs method. The first element is guaranteed to be the real UI * obtained from the default look and feel. */ - protected Vector uis = new Vector(); + protected Vector uis = new Vector<>(); //////////////////// // Common UI methods @@ -80,9 +80,9 @@ */ public boolean contains(JComponent a, int b, int c) { boolean returnValue = - ((ComponentUI) (uis.elementAt(0))).contains(a,b,c); + uis.elementAt(0).contains(a,b,c); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).contains(a,b,c); + uis.elementAt(i).contains(a,b,c); } return returnValue; } @@ -92,7 +92,7 @@ */ public void update(Graphics a, JComponent b) { for (int i = 0; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).update(a,b); + uis.elementAt(i).update(a,b); } } @@ -105,10 +105,8 @@ * @return the UI delegate created */ public static ComponentUI createUI(JComponent a) { - ComponentUI mui = new MultiScrollPaneUI(); - return MultiLookAndFeel.createUIs(mui, - ((MultiScrollPaneUI) mui).uis, - a); + MultiScrollPaneUI mui = new MultiScrollPaneUI(); + return MultiLookAndFeel.createUIs(mui, mui.uis, a); } /** @@ -116,7 +114,7 @@ */ public void installUI(JComponent a) { for (int i = 0; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).installUI(a); + uis.elementAt(i).installUI(a); } } @@ -125,7 +123,7 @@ */ public void uninstallUI(JComponent a) { for (int i = 0; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).uninstallUI(a); + uis.elementAt(i).uninstallUI(a); } } @@ -134,7 +132,7 @@ */ public void paint(Graphics a, JComponent b) { for (int i = 0; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).paint(a,b); + uis.elementAt(i).paint(a,b); } } @@ -146,9 +144,9 @@ */ public Dimension getPreferredSize(JComponent a) { Dimension returnValue = - ((ComponentUI) (uis.elementAt(0))).getPreferredSize(a); + uis.elementAt(0).getPreferredSize(a); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).getPreferredSize(a); + uis.elementAt(i).getPreferredSize(a); } return returnValue; } @@ -161,9 +159,9 @@ */ public Dimension getMinimumSize(JComponent a) { Dimension returnValue = - ((ComponentUI) (uis.elementAt(0))).getMinimumSize(a); + uis.elementAt(0).getMinimumSize(a); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).getMinimumSize(a); + uis.elementAt(i).getMinimumSize(a); } return returnValue; } @@ -176,9 +174,9 @@ */ public Dimension getMaximumSize(JComponent a) { Dimension returnValue = - ((ComponentUI) (uis.elementAt(0))).getMaximumSize(a); + uis.elementAt(0).getMaximumSize(a); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).getMaximumSize(a); + uis.elementAt(i).getMaximumSize(a); } return returnValue; } @@ -191,9 +189,9 @@ */ public int getAccessibleChildrenCount(JComponent a) { int returnValue = - ((ComponentUI) (uis.elementAt(0))).getAccessibleChildrenCount(a); + uis.elementAt(0).getAccessibleChildrenCount(a); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).getAccessibleChildrenCount(a); + uis.elementAt(i).getAccessibleChildrenCount(a); } return returnValue; } @@ -206,9 +204,9 @@ */ public Accessible getAccessibleChild(JComponent a, int b) { Accessible returnValue = - ((ComponentUI) (uis.elementAt(0))).getAccessibleChild(a,b); + uis.elementAt(0).getAccessibleChild(a,b); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).getAccessibleChild(a,b); + uis.elementAt(i).getAccessibleChild(a,b); } return returnValue; } --- old/src/share/classes/javax/swing/plaf/multi/MultiSeparatorUI.java 2014-07-02 23:02:01.000000000 -0700 +++ new/src/share/classes/javax/swing/plaf/multi/MultiSeparatorUI.java 2014-07-02 23:02:00.000000000 -0700 @@ -47,7 +47,7 @@ * the getUIs method. The first element is guaranteed to be the real UI * obtained from the default look and feel. */ - protected Vector uis = new Vector(); + protected Vector uis = new Vector<>(); //////////////////// // Common UI methods @@ -80,9 +80,9 @@ */ public boolean contains(JComponent a, int b, int c) { boolean returnValue = - ((ComponentUI) (uis.elementAt(0))).contains(a,b,c); + uis.elementAt(0).contains(a,b,c); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).contains(a,b,c); + uis.elementAt(i).contains(a,b,c); } return returnValue; } @@ -92,7 +92,7 @@ */ public void update(Graphics a, JComponent b) { for (int i = 0; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).update(a,b); + uis.elementAt(i).update(a,b); } } @@ -105,10 +105,8 @@ * @return the UI delegate created */ public static ComponentUI createUI(JComponent a) { - ComponentUI mui = new MultiSeparatorUI(); - return MultiLookAndFeel.createUIs(mui, - ((MultiSeparatorUI) mui).uis, - a); + MultiSeparatorUI mui = new MultiSeparatorUI(); + return MultiLookAndFeel.createUIs(mui, mui.uis, a); } /** @@ -116,7 +114,7 @@ */ public void installUI(JComponent a) { for (int i = 0; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).installUI(a); + uis.elementAt(i).installUI(a); } } @@ -125,7 +123,7 @@ */ public void uninstallUI(JComponent a) { for (int i = 0; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).uninstallUI(a); + uis.elementAt(i).uninstallUI(a); } } @@ -134,7 +132,7 @@ */ public void paint(Graphics a, JComponent b) { for (int i = 0; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).paint(a,b); + uis.elementAt(i).paint(a,b); } } @@ -146,9 +144,9 @@ */ public Dimension getPreferredSize(JComponent a) { Dimension returnValue = - ((ComponentUI) (uis.elementAt(0))).getPreferredSize(a); + uis.elementAt(0).getPreferredSize(a); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).getPreferredSize(a); + uis.elementAt(i).getPreferredSize(a); } return returnValue; } @@ -161,9 +159,9 @@ */ public Dimension getMinimumSize(JComponent a) { Dimension returnValue = - ((ComponentUI) (uis.elementAt(0))).getMinimumSize(a); + uis.elementAt(0).getMinimumSize(a); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).getMinimumSize(a); + uis.elementAt(i).getMinimumSize(a); } return returnValue; } @@ -176,9 +174,9 @@ */ public Dimension getMaximumSize(JComponent a) { Dimension returnValue = - ((ComponentUI) (uis.elementAt(0))).getMaximumSize(a); + uis.elementAt(0).getMaximumSize(a); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).getMaximumSize(a); + uis.elementAt(i).getMaximumSize(a); } return returnValue; } @@ -191,9 +189,9 @@ */ public int getAccessibleChildrenCount(JComponent a) { int returnValue = - ((ComponentUI) (uis.elementAt(0))).getAccessibleChildrenCount(a); + uis.elementAt(0).getAccessibleChildrenCount(a); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).getAccessibleChildrenCount(a); + uis.elementAt(i).getAccessibleChildrenCount(a); } return returnValue; } @@ -206,9 +204,9 @@ */ public Accessible getAccessibleChild(JComponent a, int b) { Accessible returnValue = - ((ComponentUI) (uis.elementAt(0))).getAccessibleChild(a,b); + uis.elementAt(0).getAccessibleChild(a,b); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).getAccessibleChild(a,b); + uis.elementAt(i).getAccessibleChild(a,b); } return returnValue; } --- old/src/share/classes/javax/swing/plaf/multi/MultiSliderUI.java 2014-07-02 23:02:03.000000000 -0700 +++ new/src/share/classes/javax/swing/plaf/multi/MultiSliderUI.java 2014-07-02 23:02:02.000000000 -0700 @@ -47,7 +47,7 @@ * the getUIs method. The first element is guaranteed to be the real UI * obtained from the default look and feel. */ - protected Vector uis = new Vector(); + protected Vector uis = new Vector<>(); //////////////////// // Common UI methods @@ -80,9 +80,9 @@ */ public boolean contains(JComponent a, int b, int c) { boolean returnValue = - ((ComponentUI) (uis.elementAt(0))).contains(a,b,c); + uis.elementAt(0).contains(a,b,c); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).contains(a,b,c); + uis.elementAt(i).contains(a,b,c); } return returnValue; } @@ -92,7 +92,7 @@ */ public void update(Graphics a, JComponent b) { for (int i = 0; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).update(a,b); + uis.elementAt(i).update(a,b); } } @@ -105,10 +105,8 @@ * @return the UI delegate created */ public static ComponentUI createUI(JComponent a) { - ComponentUI mui = new MultiSliderUI(); - return MultiLookAndFeel.createUIs(mui, - ((MultiSliderUI) mui).uis, - a); + MultiSliderUI mui = new MultiSliderUI(); + return MultiLookAndFeel.createUIs(mui, mui.uis, a); } /** @@ -116,7 +114,7 @@ */ public void installUI(JComponent a) { for (int i = 0; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).installUI(a); + uis.elementAt(i).installUI(a); } } @@ -125,7 +123,7 @@ */ public void uninstallUI(JComponent a) { for (int i = 0; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).uninstallUI(a); + uis.elementAt(i).uninstallUI(a); } } @@ -134,7 +132,7 @@ */ public void paint(Graphics a, JComponent b) { for (int i = 0; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).paint(a,b); + uis.elementAt(i).paint(a,b); } } @@ -146,9 +144,9 @@ */ public Dimension getPreferredSize(JComponent a) { Dimension returnValue = - ((ComponentUI) (uis.elementAt(0))).getPreferredSize(a); + uis.elementAt(0).getPreferredSize(a); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).getPreferredSize(a); + uis.elementAt(i).getPreferredSize(a); } return returnValue; } @@ -161,9 +159,9 @@ */ public Dimension getMinimumSize(JComponent a) { Dimension returnValue = - ((ComponentUI) (uis.elementAt(0))).getMinimumSize(a); + uis.elementAt(0).getMinimumSize(a); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).getMinimumSize(a); + uis.elementAt(i).getMinimumSize(a); } return returnValue; } @@ -176,9 +174,9 @@ */ public Dimension getMaximumSize(JComponent a) { Dimension returnValue = - ((ComponentUI) (uis.elementAt(0))).getMaximumSize(a); + uis.elementAt(0).getMaximumSize(a); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).getMaximumSize(a); + uis.elementAt(i).getMaximumSize(a); } return returnValue; } @@ -191,9 +189,9 @@ */ public int getAccessibleChildrenCount(JComponent a) { int returnValue = - ((ComponentUI) (uis.elementAt(0))).getAccessibleChildrenCount(a); + uis.elementAt(0).getAccessibleChildrenCount(a); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).getAccessibleChildrenCount(a); + uis.elementAt(i).getAccessibleChildrenCount(a); } return returnValue; } @@ -206,9 +204,9 @@ */ public Accessible getAccessibleChild(JComponent a, int b) { Accessible returnValue = - ((ComponentUI) (uis.elementAt(0))).getAccessibleChild(a,b); + uis.elementAt(0).getAccessibleChild(a,b); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).getAccessibleChild(a,b); + uis.elementAt(i).getAccessibleChild(a,b); } return returnValue; } --- old/src/share/classes/javax/swing/plaf/multi/MultiSpinnerUI.java 2014-07-02 23:02:05.000000000 -0700 +++ new/src/share/classes/javax/swing/plaf/multi/MultiSpinnerUI.java 2014-07-02 23:02:04.000000000 -0700 @@ -48,7 +48,7 @@ * the getUIs method. The first element is guaranteed to be the real UI * obtained from the default look and feel. */ - protected Vector uis = new Vector(); + protected Vector uis = new Vector<>(); //////////////////// // Common UI methods @@ -81,9 +81,9 @@ */ public boolean contains(JComponent a, int b, int c) { boolean returnValue = - ((ComponentUI) (uis.elementAt(0))).contains(a,b,c); + uis.elementAt(0).contains(a,b,c); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).contains(a,b,c); + uis.elementAt(i).contains(a,b,c); } return returnValue; } @@ -93,7 +93,7 @@ */ public void update(Graphics a, JComponent b) { for (int i = 0; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).update(a,b); + uis.elementAt(i).update(a,b); } } @@ -106,10 +106,8 @@ * @return the UI delegate created */ public static ComponentUI createUI(JComponent a) { - ComponentUI mui = new MultiSpinnerUI(); - return MultiLookAndFeel.createUIs(mui, - ((MultiSpinnerUI) mui).uis, - a); + MultiSpinnerUI mui = new MultiSpinnerUI(); + return MultiLookAndFeel.createUIs(mui, mui.uis, a); } /** @@ -117,7 +115,7 @@ */ public void installUI(JComponent a) { for (int i = 0; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).installUI(a); + uis.elementAt(i).installUI(a); } } @@ -126,7 +124,7 @@ */ public void uninstallUI(JComponent a) { for (int i = 0; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).uninstallUI(a); + uis.elementAt(i).uninstallUI(a); } } @@ -135,7 +133,7 @@ */ public void paint(Graphics a, JComponent b) { for (int i = 0; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).paint(a,b); + uis.elementAt(i).paint(a,b); } } @@ -147,9 +145,9 @@ */ public Dimension getPreferredSize(JComponent a) { Dimension returnValue = - ((ComponentUI) (uis.elementAt(0))).getPreferredSize(a); + uis.elementAt(0).getPreferredSize(a); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).getPreferredSize(a); + uis.elementAt(i).getPreferredSize(a); } return returnValue; } @@ -162,9 +160,9 @@ */ public Dimension getMinimumSize(JComponent a) { Dimension returnValue = - ((ComponentUI) (uis.elementAt(0))).getMinimumSize(a); + uis.elementAt(0).getMinimumSize(a); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).getMinimumSize(a); + uis.elementAt(i).getMinimumSize(a); } return returnValue; } @@ -177,9 +175,9 @@ */ public Dimension getMaximumSize(JComponent a) { Dimension returnValue = - ((ComponentUI) (uis.elementAt(0))).getMaximumSize(a); + uis.elementAt(0).getMaximumSize(a); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).getMaximumSize(a); + uis.elementAt(i).getMaximumSize(a); } return returnValue; } @@ -192,9 +190,9 @@ */ public int getAccessibleChildrenCount(JComponent a) { int returnValue = - ((ComponentUI) (uis.elementAt(0))).getAccessibleChildrenCount(a); + uis.elementAt(0).getAccessibleChildrenCount(a); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).getAccessibleChildrenCount(a); + uis.elementAt(i).getAccessibleChildrenCount(a); } return returnValue; } @@ -207,9 +205,9 @@ */ public Accessible getAccessibleChild(JComponent a, int b) { Accessible returnValue = - ((ComponentUI) (uis.elementAt(0))).getAccessibleChild(a,b); + uis.elementAt(0).getAccessibleChild(a,b); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).getAccessibleChild(a,b); + uis.elementAt(i).getAccessibleChild(a,b); } return returnValue; } --- old/src/share/classes/javax/swing/plaf/multi/MultiSplitPaneUI.java 2014-07-02 23:02:07.000000000 -0700 +++ new/src/share/classes/javax/swing/plaf/multi/MultiSplitPaneUI.java 2014-07-02 23:02:06.000000000 -0700 @@ -48,7 +48,7 @@ * the getUIs method. The first element is guaranteed to be the real UI * obtained from the default look and feel. */ - protected Vector uis = new Vector(); + protected Vector uis = new Vector<>(); //////////////////// // Common UI methods @@ -153,9 +153,9 @@ */ public boolean contains(JComponent a, int b, int c) { boolean returnValue = - ((ComponentUI) (uis.elementAt(0))).contains(a,b,c); + uis.elementAt(0).contains(a,b,c); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).contains(a,b,c); + uis.elementAt(i).contains(a,b,c); } return returnValue; } @@ -165,7 +165,7 @@ */ public void update(Graphics a, JComponent b) { for (int i = 0; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).update(a,b); + uis.elementAt(i).update(a,b); } } @@ -178,10 +178,8 @@ * @return the UI delegate created */ public static ComponentUI createUI(JComponent a) { - ComponentUI mui = new MultiSplitPaneUI(); - return MultiLookAndFeel.createUIs(mui, - ((MultiSplitPaneUI) mui).uis, - a); + MultiSplitPaneUI mui = new MultiSplitPaneUI(); + return MultiLookAndFeel.createUIs(mui, mui.uis, a); } /** @@ -189,7 +187,7 @@ */ public void installUI(JComponent a) { for (int i = 0; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).installUI(a); + uis.elementAt(i).installUI(a); } } @@ -198,7 +196,7 @@ */ public void uninstallUI(JComponent a) { for (int i = 0; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).uninstallUI(a); + uis.elementAt(i).uninstallUI(a); } } @@ -207,7 +205,7 @@ */ public void paint(Graphics a, JComponent b) { for (int i = 0; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).paint(a,b); + uis.elementAt(i).paint(a,b); } } @@ -219,9 +217,9 @@ */ public Dimension getPreferredSize(JComponent a) { Dimension returnValue = - ((ComponentUI) (uis.elementAt(0))).getPreferredSize(a); + uis.elementAt(0).getPreferredSize(a); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).getPreferredSize(a); + uis.elementAt(i).getPreferredSize(a); } return returnValue; } @@ -234,9 +232,9 @@ */ public Dimension getMinimumSize(JComponent a) { Dimension returnValue = - ((ComponentUI) (uis.elementAt(0))).getMinimumSize(a); + uis.elementAt(0).getMinimumSize(a); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).getMinimumSize(a); + uis.elementAt(i).getMinimumSize(a); } return returnValue; } @@ -249,9 +247,9 @@ */ public Dimension getMaximumSize(JComponent a) { Dimension returnValue = - ((ComponentUI) (uis.elementAt(0))).getMaximumSize(a); + uis.elementAt(0).getMaximumSize(a); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).getMaximumSize(a); + uis.elementAt(i).getMaximumSize(a); } return returnValue; } @@ -264,9 +262,9 @@ */ public int getAccessibleChildrenCount(JComponent a) { int returnValue = - ((ComponentUI) (uis.elementAt(0))).getAccessibleChildrenCount(a); + uis.elementAt(0).getAccessibleChildrenCount(a); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).getAccessibleChildrenCount(a); + uis.elementAt(i).getAccessibleChildrenCount(a); } return returnValue; } @@ -279,9 +277,9 @@ */ public Accessible getAccessibleChild(JComponent a, int b) { Accessible returnValue = - ((ComponentUI) (uis.elementAt(0))).getAccessibleChild(a,b); + uis.elementAt(0).getAccessibleChild(a,b); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).getAccessibleChild(a,b); + uis.elementAt(i).getAccessibleChild(a,b); } return returnValue; } --- old/src/share/classes/javax/swing/plaf/multi/MultiTabbedPaneUI.java 2014-07-02 23:02:09.000000000 -0700 +++ new/src/share/classes/javax/swing/plaf/multi/MultiTabbedPaneUI.java 2014-07-02 23:02:08.000000000 -0700 @@ -49,7 +49,7 @@ * the getUIs method. The first element is guaranteed to be the real UI * obtained from the default look and feel. */ - protected Vector uis = new Vector(); + protected Vector uis = new Vector<>(); //////////////////// // Common UI methods @@ -127,9 +127,9 @@ */ public boolean contains(JComponent a, int b, int c) { boolean returnValue = - ((ComponentUI) (uis.elementAt(0))).contains(a,b,c); + uis.elementAt(0).contains(a,b,c); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).contains(a,b,c); + uis.elementAt(i).contains(a,b,c); } return returnValue; } @@ -139,7 +139,7 @@ */ public void update(Graphics a, JComponent b) { for (int i = 0; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).update(a,b); + uis.elementAt(i).update(a,b); } } @@ -152,10 +152,8 @@ * @return the UI delegate created */ public static ComponentUI createUI(JComponent a) { - ComponentUI mui = new MultiTabbedPaneUI(); - return MultiLookAndFeel.createUIs(mui, - ((MultiTabbedPaneUI) mui).uis, - a); + MultiTabbedPaneUI mui = new MultiTabbedPaneUI(); + return MultiLookAndFeel.createUIs(mui, mui.uis, a); } /** @@ -163,7 +161,7 @@ */ public void installUI(JComponent a) { for (int i = 0; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).installUI(a); + uis.elementAt(i).installUI(a); } } @@ -172,7 +170,7 @@ */ public void uninstallUI(JComponent a) { for (int i = 0; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).uninstallUI(a); + uis.elementAt(i).uninstallUI(a); } } @@ -181,7 +179,7 @@ */ public void paint(Graphics a, JComponent b) { for (int i = 0; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).paint(a,b); + uis.elementAt(i).paint(a,b); } } @@ -193,9 +191,9 @@ */ public Dimension getPreferredSize(JComponent a) { Dimension returnValue = - ((ComponentUI) (uis.elementAt(0))).getPreferredSize(a); + uis.elementAt(0).getPreferredSize(a); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).getPreferredSize(a); + uis.elementAt(i).getPreferredSize(a); } return returnValue; } @@ -208,9 +206,9 @@ */ public Dimension getMinimumSize(JComponent a) { Dimension returnValue = - ((ComponentUI) (uis.elementAt(0))).getMinimumSize(a); + uis.elementAt(0).getMinimumSize(a); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).getMinimumSize(a); + uis.elementAt(i).getMinimumSize(a); } return returnValue; } @@ -223,9 +221,9 @@ */ public Dimension getMaximumSize(JComponent a) { Dimension returnValue = - ((ComponentUI) (uis.elementAt(0))).getMaximumSize(a); + uis.elementAt(0).getMaximumSize(a); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).getMaximumSize(a); + uis.elementAt(i).getMaximumSize(a); } return returnValue; } @@ -238,9 +236,9 @@ */ public int getAccessibleChildrenCount(JComponent a) { int returnValue = - ((ComponentUI) (uis.elementAt(0))).getAccessibleChildrenCount(a); + uis.elementAt(0).getAccessibleChildrenCount(a); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).getAccessibleChildrenCount(a); + uis.elementAt(i).getAccessibleChildrenCount(a); } return returnValue; } @@ -253,9 +251,9 @@ */ public Accessible getAccessibleChild(JComponent a, int b) { Accessible returnValue = - ((ComponentUI) (uis.elementAt(0))).getAccessibleChild(a,b); + uis.elementAt(0).getAccessibleChild(a,b); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).getAccessibleChild(a,b); + uis.elementAt(i).getAccessibleChild(a,b); } return returnValue; } --- old/src/share/classes/javax/swing/plaf/multi/MultiTableHeaderUI.java 2014-07-02 23:02:11.000000000 -0700 +++ new/src/share/classes/javax/swing/plaf/multi/MultiTableHeaderUI.java 2014-07-02 23:02:10.000000000 -0700 @@ -47,7 +47,7 @@ * the getUIs method. The first element is guaranteed to be the real UI * obtained from the default look and feel. */ - protected Vector uis = new Vector(); + protected Vector uis = new Vector<>(); //////////////////// // Common UI methods @@ -80,9 +80,9 @@ */ public boolean contains(JComponent a, int b, int c) { boolean returnValue = - ((ComponentUI) (uis.elementAt(0))).contains(a,b,c); + uis.elementAt(0).contains(a,b,c); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).contains(a,b,c); + uis.elementAt(i).contains(a,b,c); } return returnValue; } @@ -92,7 +92,7 @@ */ public void update(Graphics a, JComponent b) { for (int i = 0; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).update(a,b); + uis.elementAt(i).update(a,b); } } @@ -105,10 +105,8 @@ * @return the UI delegate created */ public static ComponentUI createUI(JComponent a) { - ComponentUI mui = new MultiTableHeaderUI(); - return MultiLookAndFeel.createUIs(mui, - ((MultiTableHeaderUI) mui).uis, - a); + MultiTableHeaderUI mui = new MultiTableHeaderUI(); + return MultiLookAndFeel.createUIs(mui, mui.uis, a); } /** @@ -116,7 +114,7 @@ */ public void installUI(JComponent a) { for (int i = 0; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).installUI(a); + uis.elementAt(i).installUI(a); } } @@ -125,7 +123,7 @@ */ public void uninstallUI(JComponent a) { for (int i = 0; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).uninstallUI(a); + uis.elementAt(i).uninstallUI(a); } } @@ -134,7 +132,7 @@ */ public void paint(Graphics a, JComponent b) { for (int i = 0; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).paint(a,b); + uis.elementAt(i).paint(a,b); } } @@ -146,9 +144,9 @@ */ public Dimension getPreferredSize(JComponent a) { Dimension returnValue = - ((ComponentUI) (uis.elementAt(0))).getPreferredSize(a); + uis.elementAt(0).getPreferredSize(a); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).getPreferredSize(a); + uis.elementAt(i).getPreferredSize(a); } return returnValue; } @@ -161,9 +159,9 @@ */ public Dimension getMinimumSize(JComponent a) { Dimension returnValue = - ((ComponentUI) (uis.elementAt(0))).getMinimumSize(a); + uis.elementAt(0).getMinimumSize(a); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).getMinimumSize(a); + uis.elementAt(i).getMinimumSize(a); } return returnValue; } @@ -176,9 +174,9 @@ */ public Dimension getMaximumSize(JComponent a) { Dimension returnValue = - ((ComponentUI) (uis.elementAt(0))).getMaximumSize(a); + uis.elementAt(0).getMaximumSize(a); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).getMaximumSize(a); + uis.elementAt(i).getMaximumSize(a); } return returnValue; } @@ -191,9 +189,9 @@ */ public int getAccessibleChildrenCount(JComponent a) { int returnValue = - ((ComponentUI) (uis.elementAt(0))).getAccessibleChildrenCount(a); + uis.elementAt(0).getAccessibleChildrenCount(a); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).getAccessibleChildrenCount(a); + uis.elementAt(i).getAccessibleChildrenCount(a); } return returnValue; } @@ -206,9 +204,9 @@ */ public Accessible getAccessibleChild(JComponent a, int b) { Accessible returnValue = - ((ComponentUI) (uis.elementAt(0))).getAccessibleChild(a,b); + uis.elementAt(0).getAccessibleChild(a,b); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).getAccessibleChild(a,b); + uis.elementAt(i).getAccessibleChild(a,b); } return returnValue; } --- old/src/share/classes/javax/swing/plaf/multi/MultiTableUI.java 2014-07-02 23:02:13.000000000 -0700 +++ new/src/share/classes/javax/swing/plaf/multi/MultiTableUI.java 2014-07-02 23:02:12.000000000 -0700 @@ -47,7 +47,7 @@ * the getUIs method. The first element is guaranteed to be the real UI * obtained from the default look and feel. */ - protected Vector uis = new Vector(); + protected Vector uis = new Vector<>(); //////////////////// // Common UI methods @@ -80,9 +80,9 @@ */ public boolean contains(JComponent a, int b, int c) { boolean returnValue = - ((ComponentUI) (uis.elementAt(0))).contains(a,b,c); + uis.elementAt(0).contains(a,b,c); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).contains(a,b,c); + uis.elementAt(i).contains(a,b,c); } return returnValue; } @@ -92,7 +92,7 @@ */ public void update(Graphics a, JComponent b) { for (int i = 0; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).update(a,b); + uis.elementAt(i).update(a,b); } } @@ -105,10 +105,8 @@ * @return the UI delegate created */ public static ComponentUI createUI(JComponent a) { - ComponentUI mui = new MultiTableUI(); - return MultiLookAndFeel.createUIs(mui, - ((MultiTableUI) mui).uis, - a); + MultiTableUI mui = new MultiTableUI(); + return MultiLookAndFeel.createUIs(mui, mui.uis, a); } /** @@ -116,7 +114,7 @@ */ public void installUI(JComponent a) { for (int i = 0; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).installUI(a); + uis.elementAt(i).installUI(a); } } @@ -125,7 +123,7 @@ */ public void uninstallUI(JComponent a) { for (int i = 0; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).uninstallUI(a); + uis.elementAt(i).uninstallUI(a); } } @@ -134,7 +132,7 @@ */ public void paint(Graphics a, JComponent b) { for (int i = 0; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).paint(a,b); + uis.elementAt(i).paint(a,b); } } @@ -146,9 +144,9 @@ */ public Dimension getPreferredSize(JComponent a) { Dimension returnValue = - ((ComponentUI) (uis.elementAt(0))).getPreferredSize(a); + uis.elementAt(0).getPreferredSize(a); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).getPreferredSize(a); + uis.elementAt(i).getPreferredSize(a); } return returnValue; } @@ -161,9 +159,9 @@ */ public Dimension getMinimumSize(JComponent a) { Dimension returnValue = - ((ComponentUI) (uis.elementAt(0))).getMinimumSize(a); + uis.elementAt(0).getMinimumSize(a); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).getMinimumSize(a); + uis.elementAt(i).getMinimumSize(a); } return returnValue; } @@ -176,9 +174,9 @@ */ public Dimension getMaximumSize(JComponent a) { Dimension returnValue = - ((ComponentUI) (uis.elementAt(0))).getMaximumSize(a); + uis.elementAt(0).getMaximumSize(a); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).getMaximumSize(a); + uis.elementAt(i).getMaximumSize(a); } return returnValue; } @@ -191,9 +189,9 @@ */ public int getAccessibleChildrenCount(JComponent a) { int returnValue = - ((ComponentUI) (uis.elementAt(0))).getAccessibleChildrenCount(a); + uis.elementAt(0).getAccessibleChildrenCount(a); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).getAccessibleChildrenCount(a); + uis.elementAt(i).getAccessibleChildrenCount(a); } return returnValue; } @@ -206,9 +204,9 @@ */ public Accessible getAccessibleChild(JComponent a, int b) { Accessible returnValue = - ((ComponentUI) (uis.elementAt(0))).getAccessibleChild(a,b); + uis.elementAt(0).getAccessibleChild(a,b); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).getAccessibleChild(a,b); + uis.elementAt(i).getAccessibleChild(a,b); } return returnValue; } --- old/src/share/classes/javax/swing/plaf/multi/MultiTextUI.java 2014-07-02 23:02:15.000000000 -0700 +++ new/src/share/classes/javax/swing/plaf/multi/MultiTextUI.java 2014-07-02 23:02:14.000000000 -0700 @@ -55,7 +55,7 @@ * the getUIs method. The first element is guaranteed to be the real UI * obtained from the default look and feel. */ - protected Vector uis = new Vector(); + protected Vector uis = new Vector<>(); //////////////////// // Common UI methods @@ -230,9 +230,9 @@ */ public boolean contains(JComponent a, int b, int c) { boolean returnValue = - ((ComponentUI) (uis.elementAt(0))).contains(a,b,c); + uis.elementAt(0).contains(a,b,c); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).contains(a,b,c); + uis.elementAt(i).contains(a,b,c); } return returnValue; } @@ -242,7 +242,7 @@ */ public void update(Graphics a, JComponent b) { for (int i = 0; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).update(a,b); + uis.elementAt(i).update(a,b); } } @@ -255,10 +255,8 @@ * @return the UI delegate created */ public static ComponentUI createUI(JComponent a) { - ComponentUI mui = new MultiTextUI(); - return MultiLookAndFeel.createUIs(mui, - ((MultiTextUI) mui).uis, - a); + MultiTextUI mui = new MultiTextUI(); + return MultiLookAndFeel.createUIs(mui, mui.uis, a); } /** @@ -266,7 +264,7 @@ */ public void installUI(JComponent a) { for (int i = 0; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).installUI(a); + uis.elementAt(i).installUI(a); } } @@ -275,7 +273,7 @@ */ public void uninstallUI(JComponent a) { for (int i = 0; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).uninstallUI(a); + uis.elementAt(i).uninstallUI(a); } } @@ -284,7 +282,7 @@ */ public void paint(Graphics a, JComponent b) { for (int i = 0; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).paint(a,b); + uis.elementAt(i).paint(a,b); } } @@ -296,9 +294,9 @@ */ public Dimension getPreferredSize(JComponent a) { Dimension returnValue = - ((ComponentUI) (uis.elementAt(0))).getPreferredSize(a); + uis.elementAt(0).getPreferredSize(a); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).getPreferredSize(a); + uis.elementAt(i).getPreferredSize(a); } return returnValue; } @@ -311,9 +309,9 @@ */ public Dimension getMinimumSize(JComponent a) { Dimension returnValue = - ((ComponentUI) (uis.elementAt(0))).getMinimumSize(a); + uis.elementAt(0).getMinimumSize(a); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).getMinimumSize(a); + uis.elementAt(i).getMinimumSize(a); } return returnValue; } @@ -326,9 +324,9 @@ */ public Dimension getMaximumSize(JComponent a) { Dimension returnValue = - ((ComponentUI) (uis.elementAt(0))).getMaximumSize(a); + uis.elementAt(0).getMaximumSize(a); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).getMaximumSize(a); + uis.elementAt(i).getMaximumSize(a); } return returnValue; } @@ -341,9 +339,9 @@ */ public int getAccessibleChildrenCount(JComponent a) { int returnValue = - ((ComponentUI) (uis.elementAt(0))).getAccessibleChildrenCount(a); + uis.elementAt(0).getAccessibleChildrenCount(a); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).getAccessibleChildrenCount(a); + uis.elementAt(i).getAccessibleChildrenCount(a); } return returnValue; } @@ -356,9 +354,9 @@ */ public Accessible getAccessibleChild(JComponent a, int b) { Accessible returnValue = - ((ComponentUI) (uis.elementAt(0))).getAccessibleChild(a,b); + uis.elementAt(0).getAccessibleChild(a,b); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).getAccessibleChild(a,b); + uis.elementAt(i).getAccessibleChild(a,b); } return returnValue; } --- old/src/share/classes/javax/swing/plaf/multi/MultiToolBarUI.java 2014-07-02 23:02:17.000000000 -0700 +++ new/src/share/classes/javax/swing/plaf/multi/MultiToolBarUI.java 2014-07-02 23:02:16.000000000 -0700 @@ -47,7 +47,7 @@ * the getUIs method. The first element is guaranteed to be the real UI * obtained from the default look and feel. */ - protected Vector uis = new Vector(); + protected Vector uis = new Vector<>(); //////////////////// // Common UI methods @@ -80,9 +80,9 @@ */ public boolean contains(JComponent a, int b, int c) { boolean returnValue = - ((ComponentUI) (uis.elementAt(0))).contains(a,b,c); + uis.elementAt(0).contains(a,b,c); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).contains(a,b,c); + uis.elementAt(i).contains(a,b,c); } return returnValue; } @@ -92,7 +92,7 @@ */ public void update(Graphics a, JComponent b) { for (int i = 0; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).update(a,b); + uis.elementAt(i).update(a,b); } } @@ -105,10 +105,8 @@ * @return the UI delegate created */ public static ComponentUI createUI(JComponent a) { - ComponentUI mui = new MultiToolBarUI(); - return MultiLookAndFeel.createUIs(mui, - ((MultiToolBarUI) mui).uis, - a); + MultiToolBarUI mui = new MultiToolBarUI(); + return MultiLookAndFeel.createUIs(mui, mui.uis, a); } /** @@ -116,7 +114,7 @@ */ public void installUI(JComponent a) { for (int i = 0; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).installUI(a); + uis.elementAt(i).installUI(a); } } @@ -125,7 +123,7 @@ */ public void uninstallUI(JComponent a) { for (int i = 0; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).uninstallUI(a); + uis.elementAt(i).uninstallUI(a); } } @@ -134,7 +132,7 @@ */ public void paint(Graphics a, JComponent b) { for (int i = 0; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).paint(a,b); + uis.elementAt(i).paint(a,b); } } @@ -146,9 +144,9 @@ */ public Dimension getPreferredSize(JComponent a) { Dimension returnValue = - ((ComponentUI) (uis.elementAt(0))).getPreferredSize(a); + uis.elementAt(0).getPreferredSize(a); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).getPreferredSize(a); + uis.elementAt(i).getPreferredSize(a); } return returnValue; } @@ -161,9 +159,9 @@ */ public Dimension getMinimumSize(JComponent a) { Dimension returnValue = - ((ComponentUI) (uis.elementAt(0))).getMinimumSize(a); + uis.elementAt(0).getMinimumSize(a); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).getMinimumSize(a); + uis.elementAt(i).getMinimumSize(a); } return returnValue; } @@ -176,9 +174,9 @@ */ public Dimension getMaximumSize(JComponent a) { Dimension returnValue = - ((ComponentUI) (uis.elementAt(0))).getMaximumSize(a); + uis.elementAt(0).getMaximumSize(a); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).getMaximumSize(a); + uis.elementAt(i).getMaximumSize(a); } return returnValue; } @@ -191,9 +189,9 @@ */ public int getAccessibleChildrenCount(JComponent a) { int returnValue = - ((ComponentUI) (uis.elementAt(0))).getAccessibleChildrenCount(a); + uis.elementAt(0).getAccessibleChildrenCount(a); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).getAccessibleChildrenCount(a); + uis.elementAt(i).getAccessibleChildrenCount(a); } return returnValue; } @@ -206,9 +204,9 @@ */ public Accessible getAccessibleChild(JComponent a, int b) { Accessible returnValue = - ((ComponentUI) (uis.elementAt(0))).getAccessibleChild(a,b); + uis.elementAt(0).getAccessibleChild(a,b); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).getAccessibleChild(a,b); + uis.elementAt(i).getAccessibleChild(a,b); } return returnValue; } --- old/src/share/classes/javax/swing/plaf/multi/MultiToolTipUI.java 2014-07-02 23:02:19.000000000 -0700 +++ new/src/share/classes/javax/swing/plaf/multi/MultiToolTipUI.java 2014-07-02 23:02:18.000000000 -0700 @@ -47,7 +47,7 @@ * the getUIs method. The first element is guaranteed to be the real UI * obtained from the default look and feel. */ - protected Vector uis = new Vector(); + protected Vector uis = new Vector<>(); //////////////////// // Common UI methods @@ -80,9 +80,9 @@ */ public boolean contains(JComponent a, int b, int c) { boolean returnValue = - ((ComponentUI) (uis.elementAt(0))).contains(a,b,c); + uis.elementAt(0).contains(a,b,c); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).contains(a,b,c); + uis.elementAt(i).contains(a,b,c); } return returnValue; } @@ -92,7 +92,7 @@ */ public void update(Graphics a, JComponent b) { for (int i = 0; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).update(a,b); + uis.elementAt(i).update(a,b); } } @@ -105,10 +105,8 @@ * @return the UI delegate created */ public static ComponentUI createUI(JComponent a) { - ComponentUI mui = new MultiToolTipUI(); - return MultiLookAndFeel.createUIs(mui, - ((MultiToolTipUI) mui).uis, - a); + MultiToolTipUI mui = new MultiToolTipUI(); + return MultiLookAndFeel.createUIs(mui, mui.uis, a); } /** @@ -116,7 +114,7 @@ */ public void installUI(JComponent a) { for (int i = 0; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).installUI(a); + uis.elementAt(i).installUI(a); } } @@ -125,7 +123,7 @@ */ public void uninstallUI(JComponent a) { for (int i = 0; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).uninstallUI(a); + uis.elementAt(i).uninstallUI(a); } } @@ -134,7 +132,7 @@ */ public void paint(Graphics a, JComponent b) { for (int i = 0; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).paint(a,b); + uis.elementAt(i).paint(a,b); } } @@ -146,9 +144,9 @@ */ public Dimension getPreferredSize(JComponent a) { Dimension returnValue = - ((ComponentUI) (uis.elementAt(0))).getPreferredSize(a); + uis.elementAt(0).getPreferredSize(a); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).getPreferredSize(a); + uis.elementAt(i).getPreferredSize(a); } return returnValue; } @@ -161,9 +159,9 @@ */ public Dimension getMinimumSize(JComponent a) { Dimension returnValue = - ((ComponentUI) (uis.elementAt(0))).getMinimumSize(a); + uis.elementAt(0).getMinimumSize(a); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).getMinimumSize(a); + uis.elementAt(i).getMinimumSize(a); } return returnValue; } @@ -176,9 +174,9 @@ */ public Dimension getMaximumSize(JComponent a) { Dimension returnValue = - ((ComponentUI) (uis.elementAt(0))).getMaximumSize(a); + uis.elementAt(0).getMaximumSize(a); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).getMaximumSize(a); + uis.elementAt(i).getMaximumSize(a); } return returnValue; } @@ -191,9 +189,9 @@ */ public int getAccessibleChildrenCount(JComponent a) { int returnValue = - ((ComponentUI) (uis.elementAt(0))).getAccessibleChildrenCount(a); + uis.elementAt(0).getAccessibleChildrenCount(a); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).getAccessibleChildrenCount(a); + uis.elementAt(i).getAccessibleChildrenCount(a); } return returnValue; } @@ -206,9 +204,9 @@ */ public Accessible getAccessibleChild(JComponent a, int b) { Accessible returnValue = - ((ComponentUI) (uis.elementAt(0))).getAccessibleChild(a,b); + uis.elementAt(0).getAccessibleChild(a,b); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).getAccessibleChild(a,b); + uis.elementAt(i).getAccessibleChild(a,b); } return returnValue; } --- old/src/share/classes/javax/swing/plaf/multi/MultiTreeUI.java 2014-07-02 23:02:21.000000000 -0700 +++ new/src/share/classes/javax/swing/plaf/multi/MultiTreeUI.java 2014-07-02 23:02:20.000000000 -0700 @@ -50,7 +50,7 @@ * the getUIs method. The first element is guaranteed to be the real UI * obtained from the default look and feel. */ - protected Vector uis = new Vector(); + protected Vector uis = new Vector<>(); //////////////////// // Common UI methods @@ -221,9 +221,9 @@ */ public boolean contains(JComponent a, int b, int c) { boolean returnValue = - ((ComponentUI) (uis.elementAt(0))).contains(a,b,c); + uis.elementAt(0).contains(a,b,c); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).contains(a,b,c); + uis.elementAt(i).contains(a,b,c); } return returnValue; } @@ -233,7 +233,7 @@ */ public void update(Graphics a, JComponent b) { for (int i = 0; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).update(a,b); + uis.elementAt(i).update(a,b); } } @@ -246,10 +246,8 @@ * @return the UI delegate created */ public static ComponentUI createUI(JComponent a) { - ComponentUI mui = new MultiTreeUI(); - return MultiLookAndFeel.createUIs(mui, - ((MultiTreeUI) mui).uis, - a); + MultiTreeUI mui = new MultiTreeUI(); + return MultiLookAndFeel.createUIs(mui, mui.uis, a); } /** @@ -257,7 +255,7 @@ */ public void installUI(JComponent a) { for (int i = 0; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).installUI(a); + uis.elementAt(i).installUI(a); } } @@ -266,7 +264,7 @@ */ public void uninstallUI(JComponent a) { for (int i = 0; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).uninstallUI(a); + uis.elementAt(i).uninstallUI(a); } } @@ -275,7 +273,7 @@ */ public void paint(Graphics a, JComponent b) { for (int i = 0; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).paint(a,b); + uis.elementAt(i).paint(a,b); } } @@ -287,9 +285,9 @@ */ public Dimension getPreferredSize(JComponent a) { Dimension returnValue = - ((ComponentUI) (uis.elementAt(0))).getPreferredSize(a); + uis.elementAt(0).getPreferredSize(a); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).getPreferredSize(a); + uis.elementAt(i).getPreferredSize(a); } return returnValue; } @@ -302,9 +300,9 @@ */ public Dimension getMinimumSize(JComponent a) { Dimension returnValue = - ((ComponentUI) (uis.elementAt(0))).getMinimumSize(a); + uis.elementAt(0).getMinimumSize(a); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).getMinimumSize(a); + uis.elementAt(i).getMinimumSize(a); } return returnValue; } @@ -317,9 +315,9 @@ */ public Dimension getMaximumSize(JComponent a) { Dimension returnValue = - ((ComponentUI) (uis.elementAt(0))).getMaximumSize(a); + uis.elementAt(0).getMaximumSize(a); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).getMaximumSize(a); + uis.elementAt(i).getMaximumSize(a); } return returnValue; } @@ -332,9 +330,9 @@ */ public int getAccessibleChildrenCount(JComponent a) { int returnValue = - ((ComponentUI) (uis.elementAt(0))).getAccessibleChildrenCount(a); + uis.elementAt(0).getAccessibleChildrenCount(a); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).getAccessibleChildrenCount(a); + uis.elementAt(i).getAccessibleChildrenCount(a); } return returnValue; } @@ -347,9 +345,9 @@ */ public Accessible getAccessibleChild(JComponent a, int b) { Accessible returnValue = - ((ComponentUI) (uis.elementAt(0))).getAccessibleChild(a,b); + uis.elementAt(0).getAccessibleChild(a,b); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).getAccessibleChild(a,b); + uis.elementAt(i).getAccessibleChild(a,b); } return returnValue; } --- old/src/share/classes/javax/swing/plaf/multi/MultiViewportUI.java 2014-07-02 23:02:23.000000000 -0700 +++ new/src/share/classes/javax/swing/plaf/multi/MultiViewportUI.java 2014-07-02 23:02:22.000000000 -0700 @@ -47,7 +47,7 @@ * the getUIs method. The first element is guaranteed to be the real UI * obtained from the default look and feel. */ - protected Vector uis = new Vector(); + protected Vector uis = new Vector<>(); //////////////////// // Common UI methods @@ -80,9 +80,9 @@ */ public boolean contains(JComponent a, int b, int c) { boolean returnValue = - ((ComponentUI) (uis.elementAt(0))).contains(a,b,c); + uis.elementAt(0).contains(a,b,c); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).contains(a,b,c); + uis.elementAt(i).contains(a,b,c); } return returnValue; } @@ -92,7 +92,7 @@ */ public void update(Graphics a, JComponent b) { for (int i = 0; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).update(a,b); + uis.elementAt(i).update(a,b); } } @@ -105,10 +105,8 @@ * @return the UI delegate created */ public static ComponentUI createUI(JComponent a) { - ComponentUI mui = new MultiViewportUI(); - return MultiLookAndFeel.createUIs(mui, - ((MultiViewportUI) mui).uis, - a); + MultiViewportUI mui = new MultiViewportUI(); + return MultiLookAndFeel.createUIs(mui, mui.uis, a); } /** @@ -116,7 +114,7 @@ */ public void installUI(JComponent a) { for (int i = 0; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).installUI(a); + uis.elementAt(i).installUI(a); } } @@ -125,7 +123,7 @@ */ public void uninstallUI(JComponent a) { for (int i = 0; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).uninstallUI(a); + uis.elementAt(i).uninstallUI(a); } } @@ -134,7 +132,7 @@ */ public void paint(Graphics a, JComponent b) { for (int i = 0; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).paint(a,b); + uis.elementAt(i).paint(a,b); } } @@ -146,9 +144,9 @@ */ public Dimension getPreferredSize(JComponent a) { Dimension returnValue = - ((ComponentUI) (uis.elementAt(0))).getPreferredSize(a); + uis.elementAt(0).getPreferredSize(a); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).getPreferredSize(a); + uis.elementAt(i).getPreferredSize(a); } return returnValue; } @@ -161,9 +159,9 @@ */ public Dimension getMinimumSize(JComponent a) { Dimension returnValue = - ((ComponentUI) (uis.elementAt(0))).getMinimumSize(a); + uis.elementAt(0).getMinimumSize(a); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).getMinimumSize(a); + uis.elementAt(i).getMinimumSize(a); } return returnValue; } @@ -176,9 +174,9 @@ */ public Dimension getMaximumSize(JComponent a) { Dimension returnValue = - ((ComponentUI) (uis.elementAt(0))).getMaximumSize(a); + uis.elementAt(0).getMaximumSize(a); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).getMaximumSize(a); + uis.elementAt(i).getMaximumSize(a); } return returnValue; } @@ -191,9 +189,9 @@ */ public int getAccessibleChildrenCount(JComponent a) { int returnValue = - ((ComponentUI) (uis.elementAt(0))).getAccessibleChildrenCount(a); + uis.elementAt(0).getAccessibleChildrenCount(a); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).getAccessibleChildrenCount(a); + uis.elementAt(i).getAccessibleChildrenCount(a); } return returnValue; } @@ -206,9 +204,9 @@ */ public Accessible getAccessibleChild(JComponent a, int b) { Accessible returnValue = - ((ComponentUI) (uis.elementAt(0))).getAccessibleChild(a,b); + uis.elementAt(0).getAccessibleChild(a,b); for (int i = 1; i < uis.size(); i++) { - ((ComponentUI) (uis.elementAt(i))).getAccessibleChild(a,b); + uis.elementAt(i).getAccessibleChild(a,b); } return returnValue; } --- old/src/share/classes/javax/swing/plaf/nimbus/NimbusIcon.java 2014-07-02 23:02:25.000000000 -0700 +++ new/src/share/classes/javax/swing/plaf/nimbus/NimbusIcon.java 2014-07-02 23:02:24.000000000 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 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 @@ -50,15 +50,20 @@ this.key = key; } + @SuppressWarnings("unchecked") + private static Painter paintFilter(@SuppressWarnings("rawtypes") Painter painter) { + return (Painter) painter; + } + @Override public void paintIcon(SynthContext context, Graphics g, int x, int y, int w, int h) { - Painter painter = null; + Painter painter = null; if (context != null) { - painter = (Painter)context.getStyle().get(context, key); + painter = paintFilter((Painter)context.getStyle().get(context, key)); } if (painter == null){ - painter = (Painter) UIManager.get(prefix + "[Enabled]." + key); + painter = paintFilter((Painter)UIManager.get(prefix + "[Enabled]." + key)); } if (painter != null && context != null) { @@ -140,7 +145,8 @@ */ @Override public void paintIcon(Component c, Graphics g, int x, int y) { - Painter painter = (Painter)UIManager.get(prefix + "[Enabled]." + key); + Painter painter = + paintFilter((Painter)UIManager.get(prefix + "[Enabled]." + key)); if (painter != null){ JComponent jc = (c instanceof JComponent) ? (JComponent)c : null; Graphics2D gfx = (Graphics2D)g; --- old/src/share/classes/javax/swing/plaf/nimbus/NimbusStyle.java 2014-07-02 23:02:27.000000000 -0700 +++ new/src/share/classes/javax/swing/plaf/nimbus/NimbusStyle.java 2014-07-02 23:02:26.000000000 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 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 @@ -283,12 +283,12 @@ //list may contain only "standard" states (those defined by Synth), //or it may contain custom states, or it may contain only "standard" //states but list them in a non-standard order. - List states = new ArrayList(); + List> states = new ArrayList<>(); //a map of state name to code - Map stateCodes = new HashMap(); + Map stateCodes = new HashMap<>(); //This is a list of runtime "state" context objects. These contain //the values associated with each state. - List runtimeStates = new ArrayList(); + List runtimeStates = new ArrayList<>(); //determine whether there are any custom states, or custom state //order. If so, then read all those custom states and define the @@ -304,7 +304,7 @@ //this is a non-standard state name, so look for the //custom state associated with it String stateName = prefix + "." + s[i]; - State customState = (State)defaults.get(stateName); + State customState = (State)defaults.get(stateName); if (customState != null) { states.add(customState); } @@ -317,12 +317,12 @@ //to be non-null. Otherwise, leave it null (meaning, use the //standard synth states). if (states.size() > 0) { - values.stateTypes = states.toArray(new State[states.size()]); + values.stateTypes = states.toArray(new State[states.size()]); } //assign codes for each of the state types int code = 1; - for (State state : states) { + for (State state : states) { stateCodes.put(state.getName(), code); code <<= 1; } @@ -463,12 +463,14 @@ values.states = runtimeStates.toArray(new RuntimeState[runtimeStates.size()]); } - private Painter getPainter(Map defaults, String key) { + private Painter getPainter(Map defaults, String key) { Object p = defaults.get(key); if (p instanceof UIDefaults.LazyValue) { p = ((UIDefaults.LazyValue)p).createValue(UIManager.getDefaults()); } - return (p instanceof Painter ? (Painter)p : null); + @SuppressWarnings("unchecked") + Painter tmp = (p instanceof Painter ? (Painter)p : null); + return tmp; } /** @@ -689,6 +691,12 @@ return obj == NULL ? null : obj; } + @SuppressWarnings("unchecked") + private static Painter paintFilter(@SuppressWarnings("rawtypes") Painter painter) { + return (Painter) painter; + } + + /** * Gets the appropriate background Painter, if there is one, for the state * specified in the given SynthContext. This method does appropriate @@ -698,14 +706,14 @@ * @return The background painter associated for the given state, or null if * none could be found. */ - public Painter getBackgroundPainter(SynthContext ctx) { + public Painter getBackgroundPainter(SynthContext ctx) { Values v = getValues(ctx); int xstate = getExtendedState(ctx, v); - Painter p = null; + Painter p = null; // check the cache tmpKey.init("backgroundPainter$$instance", xstate); - p = (Painter)v.cache.get(tmpKey); + p = paintFilter((Painter)v.cache.get(tmpKey)); if (p != null) return p; // not in cache, so lookup and store in cache @@ -713,11 +721,11 @@ int[] lastIndex = new int[] {-1}; while ((s = getNextState(v.states, lastIndex, xstate)) != null) { if (s.backgroundPainter != null) { - p = s.backgroundPainter; + p = paintFilter(s.backgroundPainter); break; } } - if (p == null) p = (Painter)get(ctx, "backgroundPainter"); + if (p == null) p = paintFilter((Painter)get(ctx, "backgroundPainter")); if (p != null) { v.cache.put(new CacheKey("backgroundPainter$$instance", xstate), p); } @@ -733,14 +741,14 @@ * @return The foreground painter associated for the given state, or null if * none could be found. */ - public Painter getForegroundPainter(SynthContext ctx) { + public Painter getForegroundPainter(SynthContext ctx) { Values v = getValues(ctx); int xstate = getExtendedState(ctx, v); - Painter p = null; + Painter p = null; // check the cache tmpKey.init("foregroundPainter$$instance", xstate); - p = (Painter)v.cache.get(tmpKey); + p = paintFilter((Painter)v.cache.get(tmpKey)); if (p != null) return p; // not in cache, so lookup and store in cache @@ -748,11 +756,11 @@ int[] lastIndex = new int[] {-1}; while ((s = getNextState(v.states, lastIndex, xstate)) != null) { if (s.foregroundPainter != null) { - p = s.foregroundPainter; + p = paintFilter(s.foregroundPainter); break; } } - if (p == null) p = (Painter)get(ctx, "foregroundPainter"); + if (p == null) p = paintFilter((Painter)get(ctx, "foregroundPainter")); if (p != null) { v.cache.put(new CacheKey("foregroundPainter$$instance", xstate), p); } @@ -768,14 +776,14 @@ * @return The border painter associated for the given state, or null if * none could be found. */ - public Painter getBorderPainter(SynthContext ctx) { + public Painter getBorderPainter(SynthContext ctx) { Values v = getValues(ctx); int xstate = getExtendedState(ctx, v); - Painter p = null; + Painter p = null; // check the cache tmpKey.init("borderPainter$$instance", xstate); - p = (Painter)v.cache.get(tmpKey); + p = paintFilter((Painter)v.cache.get(tmpKey)); if (p != null) return p; // not in cache, so lookup and store in cache @@ -783,11 +791,11 @@ int[] lastIndex = new int[] {-1}; while ((s = getNextState(v.states, lastIndex, xstate)) != null) { if (s.borderPainter != null) { - p = s.borderPainter; + p = paintFilter(s.borderPainter); break; } } - if (p == null) p = (Painter)get(ctx, "borderPainter"); + if (p == null) p = paintFilter((Painter)get(ctx, "borderPainter")); if (p != null) { v.cache.put(new CacheKey("borderPainter$$instance", xstate), p); } @@ -851,6 +859,7 @@ * @param v * @return */ + @SuppressWarnings({"unchecked", "rawtypes"}) private int getExtendedState(SynthContext ctx, Values v) { JComponent c = ctx.getComponent(); int xstate = 0; @@ -871,7 +880,7 @@ } } else { // custom states - for (State s : v.stateTypes) { + for (State s : v.stateTypes) { if (contains(states, s.getName())) { xstate |= mask; } @@ -1018,9 +1027,9 @@ */ private final class RuntimeState implements Cloneable { int state; - Painter backgroundPainter; - Painter foregroundPainter; - Painter borderPainter; + Painter backgroundPainter; + Painter foregroundPainter; + Painter borderPainter; String stateName; UIDefaults defaults = new UIDefaults(10, .7f); @@ -1055,7 +1064,7 @@ * The list of State types. A State represents a type of state, such * as Enabled, Default, WindowFocused, etc. These can be custom states. */ - State[] stateTypes = null; + State[] stateTypes = null; /** * The list of actual runtime state representations. These can represent things such * as Enabled + Focused. Thus, they differ from States in that they contain --- old/src/share/classes/javax/swing/plaf/nimbus/State.java 2014-07-02 23:02:29.000000000 -0700 +++ new/src/share/classes/javax/swing/plaf/nimbus/State.java 2014-07-02 23:02:28.000000000 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 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 @@ -72,13 +72,13 @@ */ public abstract class State{ static final Map standardStates = new HashMap(7); - static final State Enabled = new StandardState(SynthConstants.ENABLED); - static final State MouseOver = new StandardState(SynthConstants.MOUSE_OVER); - static final State Pressed = new StandardState(SynthConstants.PRESSED); - static final State Disabled = new StandardState(SynthConstants.DISABLED); - static final State Focused = new StandardState(SynthConstants.FOCUSED); - static final State Selected = new StandardState(SynthConstants.SELECTED); - static final State Default = new StandardState(SynthConstants.DEFAULT); + static final State Enabled = new StandardState(SynthConstants.ENABLED); + static final State MouseOver = new StandardState(SynthConstants.MOUSE_OVER); + static final State Pressed = new StandardState(SynthConstants.PRESSED); + static final State Disabled = new StandardState(SynthConstants.DISABLED); + static final State Focused = new StandardState(SynthConstants.FOCUSED); + static final State Selected = new StandardState(SynthConstants.SELECTED); + static final State Default = new StandardState(SynthConstants.DEFAULT); private String name; --- old/src/share/classes/javax/swing/plaf/nimbus/SynthPainterImpl.java 2014-07-02 23:02:31.000000000 -0700 +++ new/src/share/classes/javax/swing/plaf/nimbus/SynthPainterImpl.java 2014-07-02 23:02:30.000000000 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 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 @@ -49,7 +49,7 @@ * position and size. Handles if g is a non 2D Graphics by painting via a * BufferedImage. */ - private void paint(Painter p, SynthContext ctx, Graphics g, int x, int y, + private void paint(Painter p, SynthContext ctx, Graphics g, int x, int y, int w, int h, AffineTransform transform) { if (p != null) { if (g instanceof Graphics2D){ @@ -96,7 +96,8 @@ Component c = ctx.getComponent(); Color bg = (c != null) ? c.getBackground() : null; if (bg == null || bg.getAlpha() > 0){ - Painter backgroundPainter = style.getBackgroundPainter(ctx); + + Painter backgroundPainter = style.getBackgroundPainter(ctx); if (backgroundPainter != null) { paint(backgroundPainter, ctx, g, x, y, w, h,transform); } @@ -105,7 +106,7 @@ private void paintForeground(SynthContext ctx, Graphics g, int x, int y, int w, int h, AffineTransform transform) { - Painter foregroundPainter = style.getForegroundPainter(ctx); + Painter foregroundPainter = style.getForegroundPainter(ctx); if (foregroundPainter != null) { paint(foregroundPainter, ctx, g, x, y, w, h,transform); } @@ -113,7 +114,7 @@ private void paintBorder(SynthContext ctx, Graphics g, int x, int y, int w, int h, AffineTransform transform) { - Painter borderPainter = style.getBorderPainter(ctx); + Painter borderPainter = style.getBorderPainter(ctx); if (borderPainter != null) { paint(borderPainter, ctx, g, x, y, w, h,transform); } --- old/src/share/classes/javax/swing/plaf/nimbus/TableScrollPaneCorner.java 2014-07-02 23:02:33.000000000 -0700 +++ new/src/share/classes/javax/swing/plaf/nimbus/TableScrollPaneCorner.java 2014-07-02 23:02:32.000000000 -0700 @@ -48,7 +48,8 @@ * Paint the component using the Nimbus Table Header Background Painter */ @Override protected void paintComponent(Graphics g) { - Painter painter = (Painter) UIManager.get( + @SuppressWarnings("unchecked") + Painter painter = (Painter) UIManager.get( "TableHeader:\"TableHeader.renderer\"[Enabled].backgroundPainter"); if (painter != null){ if (g instanceof Graphics2D){ --- old/src/share/classes/javax/swing/plaf/synth/DefaultSynthStyleFactory.java 2014-07-02 23:02:35.000000000 -0700 +++ new/src/share/classes/javax/swing/plaf/synth/DefaultSynthStyleFactory.java 2014-07-02 23:02:34.000000000 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 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 @@ -58,12 +58,12 @@ /** * Used during lookup. */ - private BakedArrayList _tmpList; + private BakedArrayList _tmpList; /** * Maps from a List (BakedArrayList to be precise) to the merged style. */ - private Map _resolvedStyles; + private Map, SynthStyle> _resolvedStyles; /** * Used if there are no styles matching a widget. @@ -72,9 +72,9 @@ DefaultSynthStyleFactory() { - _tmpList = new BakedArrayList(5); - _styles = new ArrayList(); - _resolvedStyles = new HashMap(); + _tmpList = new BakedArrayList(5); + _styles = new ArrayList<>(); + _resolvedStyles = new HashMap<>(); } public synchronized void addStyle(DefaultSynthStyle style, @@ -100,7 +100,7 @@ * @param id ID of the Component */ public synchronized SynthStyle getStyle(JComponent c, Region id) { - BakedArrayList matches = _tmpList; + BakedArrayList matches = _tmpList; matches.clear(); getMatchingStyles(matches, c, id); @@ -138,7 +138,7 @@ * Fetches any styles that match the passed into arguments into * matches. */ - private void getMatchingStyles(List matches, JComponent c, + private void getMatchingStyles(List matches, JComponent c, Region id) { String idName = id.getLowerCaseName(); String cName = c.getName(); @@ -166,8 +166,8 @@ /** * Caches the specified style. */ - private void cacheStyle(List styles, SynthStyle style) { - BakedArrayList cachedStyles = new BakedArrayList(styles); + private void cacheStyle(List styles, SynthStyle style) { + BakedArrayList cachedStyles = new BakedArrayList<>(styles); _resolvedStyles.put(cachedStyles, style); } @@ -175,7 +175,7 @@ /** * Returns the cached style from the passed in arguments. */ - private SynthStyle getCachedStyle(List styles) { + private SynthStyle getCachedStyle(List styles) { // ?? if (styles.size() == 0) { return null; } @@ -187,7 +187,7 @@ * is reverse sorted, that is the most recently added style found to * match will be first. */ - private SynthStyle mergeStyles(List styles) { + private SynthStyle mergeStyles(List styles) { int size = styles.size(); if (size == 0) { --- old/src/share/classes/javax/swing/plaf/synth/ImagePainter.java 2014-07-02 23:02:37.000000000 -0700 +++ new/src/share/classes/javax/swing/plaf/synth/ImagePainter.java 2014-07-02 23:02:36.000000000 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 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 @@ -60,6 +60,7 @@ // we use a AppContext specific Paint9Painter. It's backed via // a WeakRef so that it can go away if the look and feel changes. synchronized(CACHE_KEY) { + @SuppressWarnings("unchecked") WeakReference cacheRef = (WeakReference)AppContext.getAppContext(). get(CACHE_KEY); --- old/src/share/classes/javax/swing/plaf/synth/Region.java 2014-07-02 23:02:39.000000000 -0700 +++ new/src/share/classes/javax/swing/plaf/synth/Region.java 2014-07-02 23:02:38.000000000 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 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 @@ -427,6 +427,7 @@ private static Map getUItoRegionMap() { AppContext context = AppContext.getAppContext(); + @SuppressWarnings("unchecked") Map map = (Map) context.get(UI_TO_REGION_MAP_KEY); if (map == null) { map = new HashMap(); @@ -482,6 +483,7 @@ private static Map getLowerCaseNameMap() { AppContext context = AppContext.getAppContext(); + @SuppressWarnings("unchecked") Map map = (Map) context.get(LOWER_CASE_NAME_MAP_KEY); if (map == null) { map = new HashMap(); --- old/src/share/classes/javax/swing/plaf/synth/SynthComboBoxUI.java 2014-07-02 23:02:41.000000000 -0700 +++ new/src/share/classes/javax/swing/plaf/synth/SynthComboBoxUI.java 2014-07-02 23:02:41.000000000 -0700 @@ -120,7 +120,7 @@ updateStyle(comboBox); } - private void updateStyle(JComboBox comboBox) { + private void updateStyle(JComboBox comboBox) { SynthStyle oldStyle = style; SynthContext context = getContext(comboBox, ENABLED); @@ -220,7 +220,7 @@ // instead of doing anything special if (!(c instanceof JComboBox)) return SynthLookAndFeel.getComponentState(c); - JComboBox box = (JComboBox)c; + JComboBox box = (JComboBox)c; if (shouldActLikeButton()) { int state = ENABLED; if ((!c.isEnabled())) { @@ -263,7 +263,7 @@ * {@inheritDoc} */ @Override - protected ListCellRenderer createRenderer() { + protected ListCellRenderer createRenderer() { return new SynthComboBoxRenderer(); } @@ -372,7 +372,7 @@ */ @Override public void paintCurrentValue(Graphics g,Rectangle bounds,boolean hasFocus) { - ListCellRenderer renderer = comboBox.getRenderer(); + ListCellRenderer renderer = comboBox.getRenderer(); Component c; c = renderer.getListCellRendererComponent( @@ -710,11 +710,11 @@ */ private static class EditorFocusHandler implements FocusListener, PropertyChangeListener { - private JComboBox comboBox; + private JComboBox comboBox; private ComboBoxEditor editor = null; private Component editorComponent = null; - private EditorFocusHandler(JComboBox comboBox) { + private EditorFocusHandler(JComboBox comboBox) { this.comboBox = comboBox; editor = comboBox.getEditor(); if (editor != null){ --- old/src/share/classes/javax/swing/plaf/synth/SynthComboPopup.java 2014-07-02 23:02:43.000000000 -0700 +++ new/src/share/classes/javax/swing/plaf/synth/SynthComboPopup.java 2014-07-02 23:02:43.000000000 -0700 @@ -38,7 +38,7 @@ */ @SuppressWarnings("serial") // Superclass is not serializable across versions class SynthComboPopup extends BasicComboPopup { - public SynthComboPopup( JComboBox combo ) { + public SynthComboPopup( JComboBox combo ) { super(combo); } --- old/src/share/classes/javax/swing/plaf/synth/SynthListUI.java 2014-07-02 23:02:45.000000000 -0700 +++ new/src/share/classes/javax/swing/plaf/synth/SynthListUI.java 2014-07-02 23:02:45.000000000 -0700 @@ -207,7 +207,7 @@ } } - @Override public Component getListCellRendererComponent(JList list, Object value, + @Override public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { if (!useListColors && (isSelected || cellHasFocus)) { SynthLookAndFeel.setSelectedUI((SynthLabelUI)SynthLookAndFeel. --- old/src/share/classes/javax/swing/plaf/synth/SynthLookAndFeel.java 2014-07-02 23:02:47.000000000 -0700 +++ new/src/share/classes/javax/swing/plaf/synth/SynthLookAndFeel.java 2014-07-02 23:02:47.000000000 -0700 @@ -382,7 +382,7 @@ * Returns the ui that is of type klass, or null if * one can not be found. */ - static Object getUIOfType(ComponentUI ui, Class klass) { + static Object getUIOfType(ComponentUI ui, Class klass) { if (klass.isInstance(ui)) { return ui; } --- old/src/share/classes/javax/swing/plaf/synth/SynthParser.java 2014-07-02 23:02:49.000000000 -0700 +++ new/src/share/classes/javax/swing/plaf/synth/SynthParser.java 2014-07-02 23:02:49.000000000 -0700 @@ -322,7 +322,7 @@ * If value is an instance of type it is * returned, otherwise a SAXException is thrown. */ - private Object checkCast(Object value, Class type) throws SAXException { + private Object checkCast(Object value, Class type) throws SAXException { if (!type.isInstance(value)) { throw new SAXException("Expected type " + type + " got " + value.getClass()); @@ -334,7 +334,7 @@ * Returns an object created with id=key. If the object is not of * type type, this will throw an exception. */ - private Object lookup(String key, Class type) throws SAXException { + private Object lookup(String key, Class type) throws SAXException { Object value; if (_handler != null) { if (_handler.hasVariable(key)) { @@ -641,7 +641,7 @@ while (tokenizer.hasMoreTokens()) { String typeName = tokenizer.nextToken(); int classIndex = typeName.lastIndexOf('.'); - Class typeClass; + Class typeClass; if (classIndex == -1) { typeClass = ColorType.class; @@ -783,13 +783,13 @@ } else if (_stateInfo != null) { if (_stateInfo.getData() == null) { - _stateInfo.setData(new HashMap()); + _stateInfo.setData(new HashMap<>()); } _stateInfo.getData().put(key, value); } else if (_style != null) { if (_style.getData() == null) { - _style.setData(new HashMap()); + _style.setData(new HashMap<>()); } _style.getData().put(key, value); } --- old/src/share/classes/javax/swing/plaf/synth/SynthSliderUI.java 2014-07-02 23:02:51.000000000 -0700 +++ new/src/share/classes/javax/swing/plaf/synth/SynthSliderUI.java 2014-07-02 23:02:51.000000000 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 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 @@ -269,7 +269,7 @@ centerY += valueHeight + 2; centerY += trackHeight + trackInsets.top + trackInsets.bottom; centerY += tickHeight + 2; - JComponent label = (JComponent) slider.getLabelTable().elements().nextElement(); + JComponent label = slider.getLabelTable().elements().nextElement(); Dimension pref = label.getPreferredSize(); return centerY + label.getBaseline(pref.width, pref.height); } @@ -291,7 +291,7 @@ int trackHeight = contentHeight - valueHeight; int yPosition = yPositionForValue(value.intValue(), trackY, trackHeight); - JComponent label = (JComponent) slider.getLabelTable().get(value); + JComponent label = slider.getLabelTable().get(value); Dimension pref = label.getPreferredSize(); return yPosition - pref.height / 2 + label.getBaseline(pref.width, pref.height); @@ -392,7 +392,7 @@ trackRect.x = insetCache.left; trackRect.width = contentRect.width; - Dictionary dictionary = slider.getLabelTable(); + Dictionary dictionary = slider.getLabelTable(); if (dictionary != null) { int minValue = slider.getMinimum(); int maxValue = slider.getMaximum(); @@ -402,9 +402,9 @@ // slider range. int firstLblIdx = Integer.MAX_VALUE; int lastLblIdx = Integer.MIN_VALUE; - for (Enumeration keys = dictionary.keys(); + for (Enumeration keys = dictionary.keys(); keys.hasMoreElements(); ) { - int keyInt = ((Integer)keys.nextElement()).intValue(); + int keyInt = keys.nextElement().intValue(); if (keyInt >= minValue && keyInt < firstLblIdx) { firstLblIdx = keyInt; } @@ -517,7 +517,7 @@ private int getPadForLabel(int i) { int pad = 0; - JComponent c = (JComponent) slider.getLabelTable().get(i); + JComponent c = slider.getLabelTable().get(i); if (c != null) { int centerX = xPositionForValue(i); int cHalfWidth = c.getPreferredSize().width / 2; --- old/src/share/classes/javax/swing/plaf/synth/SynthTableHeaderUI.java 2014-07-02 23:02:52.000000000 -0700 +++ new/src/share/classes/javax/swing/plaf/synth/SynthTableHeaderUI.java 2014-07-02 23:02:52.000000000 -0700 @@ -240,7 +240,7 @@ //stuff a variable into the client property of this renderer indicating the sort order, //so that different rendering can be done for the header based on sorted state. - RowSorter rs = table == null ? null : table.getRowSorter(); + RowSorter rs = table == null ? null : table.getRowSorter(); java.util.List sortKeys = rs == null ? null : rs.getSortKeys(); if (sortKeys != null && sortKeys.size() > 0 && sortKeys.get(0).getColumn() == table.convertColumnIndexToModel(column)) { --- old/src/share/classes/javax/swing/plaf/synth/SynthTableUI.java 2014-07-02 23:02:52.000000000 -0700 +++ new/src/share/classes/javax/swing/plaf/synth/SynthTableUI.java 2014-07-02 23:02:52.000000000 -0700 @@ -120,7 +120,7 @@ updateStyle(table); } - private TableCellRenderer installRendererIfPossible(Class objectClass, + private TableCellRenderer installRendererIfPossible(Class objectClass, TableCellRenderer renderer) { TableCellRenderer currentRenderer = table.getDefaultRenderer( objectClass); @@ -792,7 +792,7 @@ return this; } - private void configureValue(Object value, Class columnClass) { + private void configureValue(Object value, Class columnClass) { if (columnClass == Object.class || columnClass == null) { setHorizontalAlignment(JLabel.LEADING); } else if (columnClass == Float.class || columnClass == Double.class) { --- old/src/share/classes/javax/swing/plaf/synth/SynthTreeUI.java 2014-07-02 23:02:53.000000000 -0700 +++ new/src/share/classes/javax/swing/plaf/synth/SynthTreeUI.java 2014-07-02 23:02:53.000000000 -0700 @@ -312,7 +312,7 @@ Insets insets = tree.getInsets(); TreePath initialPath = getClosestPathForLocation(tree, 0, paintBounds.y); - Enumeration paintingEnumerator = treeState.getVisiblePathsFrom + Enumeration paintingEnumerator = treeState.getVisiblePathsFrom (initialPath); int row = treeState.getRowForPath(initialPath); int endY = paintBounds.y + paintBounds.height; --- old/src/share/classes/sun/swing/BakedArrayList.java 2014-07-02 23:02:54.000000000 -0700 +++ new/src/share/classes/sun/swing/BakedArrayList.java 2014-07-02 23:02:54.000000000 -0700 @@ -44,7 +44,7 @@ * @author Scott Violet */ @SuppressWarnings("serial") // JDK-implementation class -public class BakedArrayList extends ArrayList { +public class BakedArrayList extends ArrayList { /** * The cached hashCode. */ @@ -54,7 +54,7 @@ super(size); } - public BakedArrayList(java.util.List data) { + public BakedArrayList(java.util.List data) { this(data.size()); for (int counter = 0, max = data.size(); counter < max; counter++){ add(data.get(counter)); @@ -78,7 +78,8 @@ } public boolean equals(Object o) { - BakedArrayList list = (BakedArrayList)o; + @SuppressWarnings("unchecked") + BakedArrayList list = (BakedArrayList)o; int size = size(); if (list.size() != size) {