8044862: Fix raw and unchecked lint warnings in macosx specific code
authorhenryjen
Fri, 27 Jun 2014 10:29:08 -0700
changeset 25762 c4a3548120c6
parent 25761 c408b10ef757
child 25763 51d1f910f68d
8044862: Fix raw and unchecked lint warnings in macosx specific code Reviewed-by: darcy, pchelko
jdk/src/macosx/classes/apple/security/KeychainStore.java
jdk/src/macosx/classes/com/apple/eawt/_AppDockIconHandler.java
jdk/src/macosx/classes/com/apple/laf/AquaBorder.java
jdk/src/macosx/classes/com/apple/laf/AquaComboBoxButton.java
jdk/src/macosx/classes/com/apple/laf/AquaComboBoxPopup.java
jdk/src/macosx/classes/com/apple/laf/AquaComboBoxRenderer.java
jdk/src/macosx/classes/com/apple/laf/AquaComboBoxRendererInternal.java
jdk/src/macosx/classes/com/apple/laf/AquaComboBoxUI.java
jdk/src/macosx/classes/com/apple/laf/AquaFileChooserUI.java
jdk/src/macosx/classes/com/apple/laf/AquaFocusHandler.java
jdk/src/macosx/classes/com/apple/laf/AquaListUI.java
jdk/src/macosx/classes/com/apple/laf/AquaTabbedPaneCopyFromBasicUI.java
jdk/src/macosx/classes/com/apple/laf/AquaTableHeaderUI.java
jdk/src/macosx/classes/com/apple/laf/AquaUtilControlSize.java
jdk/src/macosx/classes/com/apple/laf/AquaUtils.java
jdk/src/macosx/classes/com/apple/laf/ClientPropertyApplicator.java
jdk/src/macosx/classes/com/apple/laf/ScreenMenuBar.java
jdk/src/macosx/classes/sun/lwawt/macosx/CDragSourceContextPeer.java
jdk/src/macosx/classes/sun/lwawt/macosx/CInputMethod.java
jdk/src/macosx/classes/sun/lwawt/macosx/CInputMethodDescriptor.java
jdk/src/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java
jdk/src/macosx/classes/sun/lwawt/macosx/LWCToolkit.java
--- a/jdk/src/macosx/classes/apple/security/KeychainStore.java	Wed Jul 09 17:11:53 2014 +0400
+++ b/jdk/src/macosx/classes/apple/security/KeychainStore.java	Fri Jun 27 10:29:08 2014 -0700
@@ -74,19 +74,19 @@
      * Entries that have been deleted.  When something calls engineStore we'll
      * remove them from the keychain.
      */
-    private Hashtable deletedEntries = new Hashtable();
+    private Hashtable<String, Object> deletedEntries = new Hashtable<>();
 
     /**
      * Entries that have been added.  When something calls engineStore we'll
      * add them to the keychain.
      */
-    private Hashtable addedEntries = new Hashtable();
+    private Hashtable<String, Object> addedEntries = new Hashtable<>();
 
     /**
      * Private keys and certificates are stored in a hashtable.
      * Hash entries are keyed by alias names.
      */
-    private Hashtable entries = new Hashtable();
+    private Hashtable<String, Object> entries = new Hashtable<>();
 
     /**
      * Algorithm identifiers and corresponding OIDs for the contents of the PKCS12 bag we get from the Keychain.
@@ -471,7 +471,7 @@
 
             // This will be slow, but necessary.  Enumerate the values and then see if the cert matches the one in the trusted cert entry.
             // Security framework doesn't support the same certificate twice in a keychain.
-            Collection allValues = entries.values();
+            Collection<Object> allValues = entries.values();
 
             for (Object value : allValues) {
                 if (value instanceof TrustedCertEntry) {
@@ -517,7 +517,7 @@
      *
      * @return enumeration of the alias names
      */
-    public Enumeration engineAliases() {
+    public Enumeration<String> engineAliases() {
         permissionCheck();
         return entries.keys();
     }
@@ -598,8 +598,8 @@
         permissionCheck();
         Certificate certElem;
 
-        for (Enumeration e = entries.keys(); e.hasMoreElements(); ) {
-            String alias = (String)e.nextElement();
+        for (Enumeration<String> e = entries.keys(); e.hasMoreElements(); ) {
+            String alias = e.nextElement();
             Object entry = entries.get(alias);
             if (entry instanceof TrustedCertEntry) {
                 certElem = ((TrustedCertEntry)entry).cert;
@@ -634,8 +634,8 @@
         permissionCheck();
 
         // Delete items that do have a keychain item ref.
-        for (Enumeration e = deletedEntries.keys(); e.hasMoreElements(); ) {
-            String alias = (String)e.nextElement();
+        for (Enumeration<String> e = deletedEntries.keys(); e.hasMoreElements(); ) {
+            String alias = e.nextElement();
             Object entry = deletedEntries.get(alias);
             if (entry instanceof TrustedCertEntry) {
                 if (((TrustedCertEntry)entry).certRef != 0) {
@@ -664,8 +664,8 @@
 
         // Add all of the certs or keys in the added entries.
         // No need to check for 0 refs, as they are in the added list.
-        for (Enumeration e = addedEntries.keys(); e.hasMoreElements(); ) {
-            String alias = (String)e.nextElement();
+        for (Enumeration<String> e = addedEntries.keys(); e.hasMoreElements(); ) {
+            String alias = e.nextElement();
             Object entry = addedEntries.get(alias);
             if (entry instanceof TrustedCertEntry) {
                 TrustedCertEntry tce = (TrustedCertEntry)entry;
@@ -730,8 +730,8 @@
 
         // Release any stray keychain references before clearing out the entries.
         synchronized(entries) {
-            for (Enumeration e = entries.keys(); e.hasMoreElements(); ) {
-                String alias = (String)e.nextElement();
+            for (Enumeration<String> e = entries.keys(); e.hasMoreElements(); ) {
+                String alias = e.nextElement();
                 Object entry = entries.get(alias);
                 if (entry instanceof TrustedCertEntry) {
                     if (((TrustedCertEntry)entry).certRef != 0) {
@@ -816,7 +816,7 @@
 
         // Next, create X.509 Certificate objects from the raw data.  This is complicated
         // because a certificate's public key may be too long for Java's default encryption strength.
-        List createdCerts = new ArrayList();
+        List<CertKeychainItemPair> createdCerts = new ArrayList<>();
 
         try {
             CertificateFactory cf = CertificateFactory.getInstance("X.509");
@@ -842,12 +842,12 @@
 
         // We have our certificates in the List, so now extract them into an array of
         // Certificates and SecCertificateRefs.
-        Object[] objArray = createdCerts.toArray();
+        CertKeychainItemPair[] objArray = createdCerts.toArray(new CertKeychainItemPair[0]);
         Certificate[] certArray = new Certificate[objArray.length];
         long[] certRefArray = new long[objArray.length];
 
         for (int i = 0; i < objArray.length; i++) {
-            CertKeychainItemPair addedItem = (CertKeychainItemPair)objArray[i];
+            CertKeychainItemPair addedItem = objArray[i];
             certArray[i] = addedItem.mCert;
             certRefArray[i] = addedItem.mCertificateRef;
         }
--- a/jdk/src/macosx/classes/com/apple/eawt/_AppDockIconHandler.java	Wed Jul 09 17:11:53 2014 +0400
+++ b/jdk/src/macosx/classes/com/apple/eawt/_AppDockIconHandler.java	Fri Jun 27 10:29:08 2014 -0700
@@ -95,7 +95,7 @@
 
     static Creator getCImageCreator() {
         try {
-            final Method getCreatorMethod = CImage.class.getDeclaredMethod("getCreator", new Class[] {});
+            final Method getCreatorMethod = CImage.class.getDeclaredMethod("getCreator", new Class<?>[] {});
             getCreatorMethod.setAccessible(true);
             return (Creator)getCreatorMethod.invoke(null, new Object[] {});
         } catch (final Throwable e) {
--- a/jdk/src/macosx/classes/com/apple/laf/AquaBorder.java	Wed Jul 09 17:11:53 2014 +0400
+++ b/jdk/src/macosx/classes/com/apple/laf/AquaBorder.java	Fri Jun 27 10:29:08 2014 -0700
@@ -75,7 +75,7 @@
     protected AquaBorder deriveBorderForSize(final Size size) {
         try {
             final Class<? extends AquaBorder> clazz = getClass();
-            final AquaBorder border = clazz.getConstructor(new Class[] { clazz }).newInstance(new Object[] { this });
+            final AquaBorder border = clazz.getConstructor(new Class<?>[] { clazz }).newInstance(new Object[] { this });
             border.setSize(size);
             return border;
         } catch (final Throwable e) {
--- a/jdk/src/macosx/classes/com/apple/laf/AquaComboBoxButton.java	Wed Jul 09 17:11:53 2014 +0400
+++ b/jdk/src/macosx/classes/com/apple/laf/AquaComboBoxButton.java	Fri Jun 27 10:29:08 2014 -0700
@@ -35,8 +35,8 @@
 
 @SuppressWarnings("serial") // Superclass is not serializable across versions
 class AquaComboBoxButton extends JButton {
-    final protected JComboBox comboBox;
-    final protected JList list;
+    final protected JComboBox<Object> comboBox;
+    final protected JList<?> list;
     final protected CellRendererPane rendererPane;
     final protected AquaComboBoxUI ui;
 
@@ -45,7 +45,10 @@
     boolean isSquare;
 
     @SuppressWarnings("serial") // anonymous class
-    protected AquaComboBoxButton(final AquaComboBoxUI ui, final JComboBox comboBox, final CellRendererPane rendererPane, final JList list) {
+    protected AquaComboBoxButton(final AquaComboBoxUI ui,
+                                 final JComboBox<Object> comboBox,
+                                 final CellRendererPane rendererPane,
+                                 final JList<?> list) {
         super("");
         putClientProperty("JButton.buttonType", "comboboxInternal");
 
@@ -163,7 +166,7 @@
     }
 
     protected void doRendererPaint(final Graphics g, final ButtonModel buttonModel, final boolean editable, final Insets insets, int left, int top, int width, int height) {
-        final ListCellRenderer renderer = comboBox.getRenderer();
+        final ListCellRenderer<Object> renderer = comboBox.getRenderer();
 
         // fake it out! not renderPressed
         final Component c = renderer.getListCellRendererComponent(list, comboBox.getSelectedItem(), -1, false, false);
--- a/jdk/src/macosx/classes/com/apple/laf/AquaComboBoxPopup.java	Wed Jul 09 17:11:53 2014 +0400
+++ b/jdk/src/macosx/classes/com/apple/laf/AquaComboBoxPopup.java	Fri Jun 27 10:29:08 2014 -0700
@@ -43,7 +43,7 @@
     protected Component bottomStrut;
     protected boolean isPopDown = false;
 
-    public AquaComboBoxPopup(final JComboBox cBox) {
+    public AquaComboBoxPopup(final JComboBox<Object> cBox) {
         super(cBox);
     }
 
@@ -93,7 +93,7 @@
         final int rowCount = Math.min(maxRowCount, currentElementCount);
 
         final Dimension popupSize = new Dimension();
-        final ListCellRenderer renderer = list.getCellRenderer();
+        final ListCellRenderer<Object> renderer = list.getCellRenderer();
 
         for (int i = 0; i < rowCount; i++) {
             final Object value = list.getModel().getElementAt(i);
@@ -149,8 +149,8 @@
 
     @Override
     @SuppressWarnings("serial") // anonymous class
-    protected JList createList() {
-        return new JList(comboBox.getModel()) {
+    protected JList<Object> createList() {
+        return new JList<Object>(comboBox.getModel()) {
             @Override
             public void processMouseEvent(MouseEvent e) {
                 if (e.isMetaDown()) {
--- a/jdk/src/macosx/classes/com/apple/laf/AquaComboBoxRenderer.java	Wed Jul 09 17:11:53 2014 +0400
+++ b/jdk/src/macosx/classes/com/apple/laf/AquaComboBoxRenderer.java	Fri Jun 27 10:29:08 2014 -0700
@@ -29,8 +29,8 @@
 import javax.swing.plaf.UIResource;
 
 @SuppressWarnings("serial") // Superclass is not serializable across versions
-class AquaComboBoxRenderer extends AquaComboBoxRendererInternal implements UIResource {
-    public AquaComboBoxRenderer(final JComboBox comboBox) {
+class AquaComboBoxRenderer extends AquaComboBoxRendererInternal<Object> implements UIResource {
+    public AquaComboBoxRenderer(final JComboBox<?> comboBox) {
         super(comboBox);
     }
 }
--- a/jdk/src/macosx/classes/com/apple/laf/AquaComboBoxRendererInternal.java	Wed Jul 09 17:11:53 2014 +0400
+++ b/jdk/src/macosx/classes/com/apple/laf/AquaComboBoxRendererInternal.java	Fri Jun 27 10:29:08 2014 -0700
@@ -31,8 +31,8 @@
 import java.awt.*;
 
 @SuppressWarnings("serial") // Superclass is not serializable across versions
-class AquaComboBoxRendererInternal extends JLabel implements ListCellRenderer {
-    final JComboBox fComboBox;
+class AquaComboBoxRendererInternal<E> extends JLabel implements ListCellRenderer<E> {
+    final JComboBox<?> fComboBox;
     boolean fSelected;
     boolean fChecked;
     boolean fInList;
@@ -40,7 +40,7 @@
     boolean fDrawCheckedItem = true;
 
     // Provides space for a checkbox, and is translucent
-    public AquaComboBoxRendererInternal(final JComboBox comboBox) {
+    public AquaComboBoxRendererInternal(final JComboBox<?> comboBox) {
         super();
         fComboBox = comboBox;
     }
@@ -72,7 +72,10 @@
     }
 
     // Really means is the one with the mouse over it
-    public Component getListCellRendererComponent(final JList list, final Object value, int index, final boolean isSelected, final boolean cellHasFocus) {
+    public Component getListCellRendererComponent(final JList<? extends E> list,
+                                                  final E value, int index,
+                                                  final boolean isSelected,
+                                                  final boolean cellHasFocus) {
         fInList = (index >= 0); // When the button wants the item painted, it passes in -1
         fSelected = isSelected;
         if (index < 0) {
--- a/jdk/src/macosx/classes/com/apple/laf/AquaComboBoxUI.java	Wed Jul 09 17:11:53 2014 +0400
+++ b/jdk/src/macosx/classes/com/apple/laf/AquaComboBoxUI.java	Fri Jun 27 10:29:08 2014 -0700
@@ -102,13 +102,13 @@
                 if (now - 1000 < lastBlink) return;
                 lastBlink = now;
 
-                final JList itemList = popup.getList();
+                final JList<Object> itemList = popup.getList();
                 final ListUI listUI = itemList.getUI();
                 if (!(listUI instanceof AquaListUI)) return;
                 final AquaListUI aquaListUI = (AquaListUI)listUI;
 
                 final int selectedIndex = comboBox.getSelectedIndex();
-                final ListModel dataModel = itemList.getModel();
+                final ListModel<Object> dataModel = itemList.getModel();
                 if (dataModel == null) return;
 
                 final Object value = dataModel.getElementAt(selectedIndex);
@@ -125,7 +125,7 @@
         // this space intentionally left blank
     }
 
-    protected ListCellRenderer createRenderer() {
+    protected ListCellRenderer<Object> createRenderer() {
         return new AquaComboBoxRenderer(comboBox);
     }
 
@@ -185,7 +185,7 @@
 
             final Object text = editor.getText();
 
-            final ListModel model = listBox.getModel();
+            final ListModel<Object> model = listBox.getModel();
             final int items = model.getSize();
             for (int i = 0; i < items; i++) {
                 final Object element = model.getElementAt(i);
@@ -423,7 +423,7 @@
                 return;
             }
 
-            final JComboBox cb = (JComboBox)parent;
+            final JComboBox<?> cb = (JComboBox<?>) parent;
             final int width = cb.getWidth();
             final int height = cb.getHeight();
 
@@ -450,11 +450,11 @@
         return Boolean.TRUE.equals(c.getClientProperty(AquaComboBoxUI.IS_TABLE_CELL_EDITOR));
     }
 
-    protected static boolean isPopdown(final JComboBox c) {
+    protected static boolean isPopdown(final JComboBox<?> c) {
         return c.isEditable() || Boolean.TRUE.equals(c.getClientProperty(AquaComboBoxUI.POPDOWN_CLIENT_PROPERTY_KEY));
     }
 
-    protected static void triggerSelectionEvent(final JComboBox comboBox, final ActionEvent e) {
+    protected static void triggerSelectionEvent(final JComboBox<?> comboBox, final ActionEvent e) {
         if (!comboBox.isEnabled()) return;
 
         final AquaComboBoxUI aquaUi = (AquaComboBoxUI)comboBox.getUI();
@@ -505,7 +505,7 @@
     @SuppressWarnings("serial") // anonymous class
     private static final Action toggleSelectionAction = new AbstractAction() {
         public void actionPerformed(final ActionEvent e) {
-            final JComboBox comboBox = (JComboBox)e.getSource();
+            final JComboBox<?> comboBox = (JComboBox<?>) e.getSource();
             if (!comboBox.isEnabled()) return;
             if (comboBox.isEditable()) return;
 
@@ -525,7 +525,7 @@
     private final Action hideAction = new AbstractAction() {
         @Override
         public void actionPerformed(final ActionEvent e) {
-            final JComboBox comboBox = (JComboBox)e.getSource();
+            final JComboBox<?> comboBox = (JComboBox<?>) e.getSource();
             comboBox.firePopupMenuCanceled();
             comboBox.setPopupVisible(false);
         }
@@ -588,10 +588,11 @@
     }
 
     @SuppressWarnings("unchecked")
-    static final RecyclableSingleton<ClientPropertyApplicator<JComboBox, AquaComboBoxUI>> APPLICATOR = new RecyclableSingleton<ClientPropertyApplicator<JComboBox, AquaComboBoxUI>>() {
+    static final RecyclableSingleton<ClientPropertyApplicator<JComboBox<?>, AquaComboBoxUI>> APPLICATOR = new
+            RecyclableSingleton<ClientPropertyApplicator<JComboBox<?>, AquaComboBoxUI>>() {
         @Override
-        protected ClientPropertyApplicator<JComboBox, AquaComboBoxUI> getInstance() {
-            return new ClientPropertyApplicator<JComboBox, AquaComboBoxUI>(
+        protected ClientPropertyApplicator<JComboBox<?>, AquaComboBoxUI> getInstance() {
+            return new ClientPropertyApplicator<JComboBox<?>, AquaComboBoxUI>(
                 new Property<AquaComboBoxUI>(AquaFocusHandler.FRAME_ACTIVE_PROPERTY) {
                     public void applyProperty(final AquaComboBoxUI target, final Object value) {
                         if (Boolean.FALSE.equals(value)) {
@@ -633,7 +634,7 @@
                     }
                 }
             ) {
-                public AquaComboBoxUI convertJComponentToTarget(final JComboBox combo) {
+                public AquaComboBoxUI convertJComponentToTarget(final JComboBox<?> combo) {
                     final ComboBoxUI comboUI = combo.getUI();
                     if (comboUI instanceof AquaComboBoxUI) return (AquaComboBoxUI)comboUI;
                     return null;
@@ -641,7 +642,7 @@
             };
         }
     };
-    static ClientPropertyApplicator<JComboBox, AquaComboBoxUI> getApplicator() {
+    static ClientPropertyApplicator<JComboBox<?>, AquaComboBoxUI> getApplicator() {
         return APPLICATOR.get();
     }
 }
--- a/jdk/src/macosx/classes/com/apple/laf/AquaFileChooserUI.java	Wed Jul 09 17:11:53 2014 +0400
+++ b/jdk/src/macosx/classes/com/apple/laf/AquaFileChooserUI.java	Fri Jun 27 10:29:08 2014 -0700
@@ -724,6 +724,7 @@
             final Transferable transferable = dtde.getTransferable();
 
             try {
+                @SuppressWarnings("unchecked")
                 final java.util.List<File> fileList = (java.util.List<File>)transferable.getTransferData(DataFlavor.javaFileListFlavor);
                 dropFiles(fileList.toArray(new File[fileList.size()]));
                 dtde.dropComplete(true);
@@ -1144,11 +1145,14 @@
     }
 
     @SuppressWarnings("serial") // anonymous class
-    protected ListCellRenderer createDirectoryComboBoxRenderer(final JFileChooser fc) {
-        return new AquaComboBoxRendererInternal(directoryComboBox) {
-            public Component getListCellRendererComponent(final JList list, final Object value, final int index, final boolean isSelected, final boolean cellHasFocus) {
-                super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
-                final File directory = (File)value;
+    protected ListCellRenderer<File> createDirectoryComboBoxRenderer(final JFileChooser fc) {
+        return new AquaComboBoxRendererInternal<File>(directoryComboBox) {
+            public Component getListCellRendererComponent(final JList<? extends File> list,
+                                                          final File directory,
+                                                          final int index,
+                                                          final boolean isSelected,
+                                                          final boolean cellHasFocus) {
+                super.getListCellRendererComponent(list, directory, index, isSelected, cellHasFocus);
                 if (directory == null) {
                     setText("");
                     return this;
@@ -1173,7 +1177,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<File> implements ComboBoxModel<File> {
         Vector<File> fDirectories = new Vector<File>();
         int topIndex = -1;
         int fPathCount = 0;
@@ -1248,7 +1252,7 @@
             return fDirectories.size();
         }
 
-        public Object getElementAt(final int index) {
+        public File getElementAt(final int index) {
             return fDirectories.elementAt(index);
         }
     }
@@ -1257,11 +1261,14 @@
     // Renderer for Types ComboBox
     //
     @SuppressWarnings("serial") // anonymous class
-    protected ListCellRenderer createFilterComboBoxRenderer() {
-        return new AquaComboBoxRendererInternal(filterComboBox) {
-            public Component getListCellRendererComponent(final JList list, final Object value, final int index, final boolean isSelected, final boolean cellHasFocus) {
-                super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
-                final FileFilter filter = (FileFilter)value;
+    protected ListCellRenderer<FileFilter> createFilterComboBoxRenderer() {
+        return new AquaComboBoxRendererInternal<FileFilter>(filterComboBox) {
+            public Component getListCellRendererComponent(final JList<? extends FileFilter> list,
+                                                          final FileFilter filter,
+                                                          final int index,
+                                                          final boolean isSelected,
+                                                          final boolean cellHasFocus) {
+                super.getListCellRendererComponent(list, filter, index, isSelected, cellHasFocus);
                 if (filter != null) setText(filter.getDescription());
                 return this;
             }
@@ -1356,7 +1363,7 @@
         }
 
         public void actionPerformed(final ActionEvent e) {
-            getFileChooser().setFileFilter((FileFilter)filterComboBox.getSelectedItem());
+            getFileChooser().setFileFilter((FileFilter) filterComboBox.getSelectedItem());
         }
     }
 
@@ -1503,7 +1510,7 @@
         fTextfieldPanel.add(tPanel, BorderLayout.CENTER);
 
         // DirectoryComboBox, left-justified, 200x20 not including drop shadow
-        directoryComboBox = new JComboBox();
+        directoryComboBox = new JComboBox<>();
         directoryComboBox.putClientProperty("JComboBox.lightweightKeyboardNavigation", "Lightweight");
         fDirectoryComboBoxModel = createDirectoryComboBoxModel(fc);
         directoryComboBox.setModel(fDirectoryComboBoxModel);
@@ -1551,7 +1558,7 @@
         // Combobox
         filterComboBoxModel = createFilterComboBoxModel();
         fc.addPropertyChangeListener(filterComboBoxModel);
-        filterComboBox = new JComboBox(filterComboBoxModel);
+        filterComboBox = new JComboBox<>(filterComboBoxModel);
         formatLabel.setLabelFor(filterComboBox);
         filterComboBox.setRenderer(createFilterComboBoxRenderer());
         d = new Dimension(220, (int)filterComboBox.getMinimumSize().getHeight());
@@ -1788,7 +1795,7 @@
         }
     }
 
-    JComboBox directoryComboBox;
+    JComboBox<File> directoryComboBox;
     DirectoryComboBoxModel fDirectoryComboBoxModel;
     private final Action directoryComboBoxAction = new DirectoryComboBoxAction();
 
@@ -1797,7 +1804,7 @@
     JTableExtension fFileList;
 
     private FilterComboBoxModel filterComboBoxModel;
-    JComboBox filterComboBox;
+    JComboBox<FileFilter> filterComboBox;
     private final Action filterComboBoxAction = new FilterComboBoxAction();
 
     private static final Dimension hstrut10 = new Dimension(10, 1);
--- a/jdk/src/macosx/classes/com/apple/laf/AquaFocusHandler.java	Wed Jul 09 17:11:53 2014 +0400
+++ b/jdk/src/macosx/classes/com/apple/laf/AquaFocusHandler.java	Fri Jun 27 10:29:08 2014 -0700
@@ -131,7 +131,7 @@
         c.setSelectionBackground(UIManager.getColor(bgName));
     }
 
-    static void swapSelectionColors(final String prefix, final JList c, final Object value) {
+    static void swapSelectionColors(final String prefix, final JList<?> c, final Object value) {
         if (!isComponentValid(c)) return;
 
         final Color bg = c.getSelectionBackground();
@@ -149,7 +149,7 @@
         }
     }
 
-    static void setSelectionColors(final JList c, final String fgName, final String bgName) {
+    static void setSelectionColors(final JList<?> c, final String fgName, final String bgName) {
         c.setSelectionForeground(UIManager.getColor(fgName));
         c.setSelectionBackground(UIManager.getColor(bgName));
     }
--- a/jdk/src/macosx/classes/com/apple/laf/AquaListUI.java	Wed Jul 09 17:11:53 2014 +0400
+++ b/jdk/src/macosx/classes/com/apple/laf/AquaListUI.java	Fri Jun 27 10:29:08 2014 -0700
@@ -79,7 +79,7 @@
          * For a Home action, scrolls to the top. Otherwise, scroll to the end.
          */
         public void actionPerformed(final ActionEvent e) {
-            final JList list = (JList)e.getSource();
+            final JList<?> list = (JList<?>)e.getSource();
 
             if (fHomeAction) {
                 list.ensureIndexIsVisible(0);
@@ -135,7 +135,7 @@
         }*/
     }
 
-    JList getComponent() {
+    JList<Object> getComponent() {
         return list;
     }
 
@@ -144,7 +144,7 @@
         final Rectangle rowBounds = getCellBounds(list, selectedIndex, selectedIndex);
         if (rowBounds == null) return;
 
-        final ListCellRenderer renderer = list.getCellRenderer();
+        final ListCellRenderer<Object> renderer = list.getCellRenderer();
         if (renderer == null) return;
 
         final Component rendererComponent = renderer.getListCellRendererComponent(list, value, selectedIndex, selected, true);
--- a/jdk/src/macosx/classes/com/apple/laf/AquaTabbedPaneCopyFromBasicUI.java	Wed Jul 09 17:11:53 2014 +0400
+++ b/jdk/src/macosx/classes/com/apple/laf/AquaTabbedPaneCopyFromBasicUI.java	Fri Jun 27 10:29:08 2014 -0700
@@ -3820,7 +3820,7 @@
                 _loader = null;
                 final Class<?> klass = (Class<?>)loader;
                 try {
-                    final java.lang.reflect.Method method = klass.getDeclaredMethod("loadActionMap", new Class[] { LazyActionMap.class });
+                    final java.lang.reflect.Method method = klass.getDeclaredMethod("loadActionMap", new Class<?>[] { LazyActionMap.class });
                     method.invoke(klass, new Object[] { this });
                 } catch (final NoSuchMethodException nsme) {
                     assert false : "LazyActionMap unable to load actions " + klass;
--- a/jdk/src/macosx/classes/com/apple/laf/AquaTableHeaderUI.java	Wed Jul 09 17:11:53 2014 +0400
+++ b/jdk/src/macosx/classes/com/apple/laf/AquaTableHeaderUI.java	Fri Jun 27 10:29:08 2014 -0700
@@ -69,6 +69,7 @@
 
     final static RecyclableSingleton<ClientPropertyApplicator<JTableHeader, JTableHeader>> TABLE_HEADER_APPLICATORS = new RecyclableSingleton<ClientPropertyApplicator<JTableHeader, JTableHeader>>() {
         @Override
+        @SuppressWarnings("unchecked")
         protected ClientPropertyApplicator<JTableHeader, JTableHeader> getInstance() {
             return new ClientPropertyApplicator<JTableHeader, JTableHeader>(
                     new Property<JTableHeader>("JTableHeader.selectedColumn") {
--- a/jdk/src/macosx/classes/com/apple/laf/AquaUtilControlSize.java	Wed Jul 09 17:11:53 2014 +0400
+++ b/jdk/src/macosx/classes/com/apple/laf/AquaUtilControlSize.java	Fri Jun 27 10:29:08 2014 -0700
@@ -121,7 +121,7 @@
         try {
             // see if this component has a "getUI" method
             final Class<? extends JComponent> clazz = c.getClass();
-            final Method getUIMethod = clazz.getMethod("getUI", new Class[0]);
+            final Method getUIMethod = clazz.getMethod("getUI", new Class<?>[0]);
 
             // see if that UI is one of ours that understands sizing
             final Object ui = getUIMethod.invoke(c, new Object[0]);
--- a/jdk/src/macosx/classes/com/apple/laf/AquaUtils.java	Wed Jul 09 17:11:53 2014 +0400
+++ b/jdk/src/macosx/classes/com/apple/laf/AquaUtils.java	Fri Jun 27 10:29:08 2014 -0700
@@ -82,7 +82,8 @@
             @Override
             public Creator run() {
                 try {
-                    final Method getCreatorMethod = CImage.class.getDeclaredMethod("getCreator", new Class[] {});
+                    final Method getCreatorMethod = CImage.class.getDeclaredMethod(
+                                "getCreator", new Class<?>[] {});
                     getCreatorMethod.setAccessible(true);
                     return (Creator)getCreatorMethod.invoke(null, new Object[] {});
                 } catch (final Exception ignored) {
@@ -383,7 +384,8 @@
                     @Override
                     public Method run() {
                         try {
-                            final Method method = JComponent.class.getDeclaredMethod("getFlag", new Class[] { int.class });
+                            final Method method = JComponent.class.getDeclaredMethod(
+                                    "getFlag", new Class<?>[] { int.class });
                             method.setAccessible(true);
                             return method;
                         } catch (final Throwable ignored) {
--- a/jdk/src/macosx/classes/com/apple/laf/ClientPropertyApplicator.java	Wed Jul 09 17:11:53 2014 +0400
+++ b/jdk/src/macosx/classes/com/apple/laf/ClientPropertyApplicator.java	Fri Jun 27 10:29:08 2014 -0700
@@ -33,6 +33,7 @@
 public class ClientPropertyApplicator<T extends JComponent, N> implements PropertyChangeListener {
     private final Map<String, Property<N>> properties = new HashMap<String, Property<N>>();
 
+    @SuppressWarnings("unchecked")
     public ClientPropertyApplicator(final Property<N>... propertyList) {
         for (final Property<N> p : propertyList) {
             properties.put(p.name, p);
--- a/jdk/src/macosx/classes/com/apple/laf/ScreenMenuBar.java	Wed Jul 09 17:11:53 2014 +0400
+++ b/jdk/src/macosx/classes/com/apple/laf/ScreenMenuBar.java	Fri Jun 27 10:29:08 2014 -0700
@@ -273,6 +273,7 @@
             try {
                 if (stolenFields == null) return m;
 
+                @SuppressWarnings("unchecked")
                 final Vector<Menu> menus = (Vector<Menu>)stolenFields[0].get(this);
                     menus.insertElementAt(m, index);
 
--- a/jdk/src/macosx/classes/sun/lwawt/macosx/CDragSourceContextPeer.java	Wed Jul 09 17:11:53 2014 +0400
+++ b/jdk/src/macosx/classes/sun/lwawt/macosx/CDragSourceContextPeer.java	Fri Jun 27 10:29:08 2014 -0700
@@ -88,7 +88,7 @@
         super.startDrag(dsc, cursor, dragImage, dragImageOffset);
     }
 
-    protected void startDrag(Transferable transferable, long[] formats, Map formatMap) {
+    protected void startDrag(Transferable transferable, long[] formats, Map<Long, DataFlavor> formatMap) {
         DragGestureEvent trigger = getTrigger();
         InputEvent         triggerEvent = trigger.getTriggerEvent();
 
@@ -311,7 +311,7 @@
         }
     }
 
-    private void setDefaultDragImage(JList component) {
+    private void setDefaultDragImage(JList<?> component) {
         Rectangle selectedOutline = null;
 
         // This code actually works, even under the (non-existant) multiple-selections, because we only draw a union outline
@@ -485,7 +485,7 @@
     private native long createNativeDragSource(Component component, long nativePeer, Transferable transferable,
         InputEvent triggerEvent, int dragPosX, int dragPosY, int extModifiers, int clickCount, long timestamp,
         long nsDragImagePtr, int dragImageOffsetX, int dragImageOffsetY,
-        int sourceActions, long[] formats, Map formatMap);
+        int sourceActions, long[] formats, Map<Long, DataFlavor> formatMap);
 
     private native void doDragging(long nativeDragSource);
 
--- a/jdk/src/macosx/classes/sun/lwawt/macosx/CInputMethod.java	Wed Jul 09 17:11:53 2014 +0400
+++ b/jdk/src/macosx/classes/sun/lwawt/macosx/CInputMethod.java	Fri Jun 27 10:29:08 2014 -0700
@@ -44,13 +44,14 @@
 public class CInputMethod extends InputMethodAdapter {
     private InputMethodContext fIMContext;
     private Component fAwtFocussedComponent;
-    private LWComponentPeer fAwtFocussedComponentPeer;
+    private LWComponentPeer<?, ?> fAwtFocussedComponentPeer;
     private boolean isActive;
 
     private static Map<TextAttribute, Integer>[] sHighlightStyles;
 
     // Intitalize highlight mapping table and its mapper.
     static {
+        @SuppressWarnings({"rawtypes", "unchecked"})
         Map<TextAttribute, Integer> styles[] = new Map[4];
         HashMap<TextAttribute, Integer> map;
 
@@ -242,7 +243,7 @@
     public void hideWindows() {
     }
 
-    long getNativeViewPtr(LWComponentPeer peer) {
+    long getNativeViewPtr(LWComponentPeer<?, ?> peer) {
         if (peer.getPlatformWindow() instanceof CPlatformWindow) {
             CPlatformWindow platformWindow = (CPlatformWindow) peer.getPlatformWindow();
             CPlatformView platformView = platformWindow.getContentView();
@@ -272,7 +273,7 @@
      * to talk to when responding to key events.
      */
     protected void setAWTFocussedComponent(Component component) {
-        LWComponentPeer peer = null;
+        LWComponentPeer<?, ?> peer = null;
         long modelPtr = 0;
         CInputMethod imInstance = this;
 
@@ -305,7 +306,7 @@
     /**
         * @see java.awt.Toolkit#mapInputMethodHighlight
      */
-    public static Map mapInputMethodHighlight(InputMethodHighlight highlight) {
+    public static Map<TextAttribute, ?> mapInputMethodHighlight(InputMethodHighlight highlight) {
         int index;
         int state = highlight.getState();
         if (state == InputMethodHighlight.RAW_TEXT) {
@@ -384,7 +385,7 @@
 
     // java.awt.Toolkit#getNativeContainer() is not available
     //    from this package
-    private LWComponentPeer getNearestNativePeer(Component comp) {
+    private LWComponentPeer<?, ?> getNearestNativePeer(Component comp) {
         if (comp==null)
             return null;
 
@@ -796,7 +797,7 @@
     // these calls will be ignored.
     private native void nativeNotifyPeer(long nativePeer, CInputMethod imInstance);
     private native void nativeEndComposition(long nativePeer);
-    private native void nativeHandleEvent(LWComponentPeer peer, AWTEvent event);
+    private native void nativeHandleEvent(LWComponentPeer<?, ?> peer, AWTEvent event);
 
     // Returns the locale of the active input method.
     static native Locale getNativeLocale();
--- a/jdk/src/macosx/classes/sun/lwawt/macosx/CInputMethodDescriptor.java	Wed Jul 09 17:11:53 2014 +0400
+++ b/jdk/src/macosx/classes/sun/lwawt/macosx/CInputMethodDescriptor.java	Fri Jun 27 10:29:08 2014 -0700
@@ -57,7 +57,7 @@
     }
 
     static Object[] getAvailableLocalesInternal() {
-        List workList = nativeGetAvailableLocales();
+        List<?> workList = nativeGetAvailableLocales();
 
         if (workList != null) {
             return workList.toArray();
@@ -119,5 +119,5 @@
     }
 
     private static native void nativeInit();
-    private static native List nativeGetAvailableLocales();
+    private static native List<?> nativeGetAvailableLocales();
 }
--- a/jdk/src/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java	Wed Jul 09 17:11:53 2014 +0400
+++ b/jdk/src/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java	Fri Jun 27 10:29:08 2014 -0700
@@ -151,7 +151,7 @@
         return (bits & mask) != 0;
     }
 
-    @SuppressWarnings("unchecked")
+    @SuppressWarnings({"unchecked", "rawtypes"})
     static ClientPropertyApplicator<JRootPane, CPlatformWindow> CLIENT_PROPERTY_APPLICATOR = new ClientPropertyApplicator<JRootPane, CPlatformWindow>(new Property[] {
         new Property<CPlatformWindow>(WINDOW_DOCUMENT_MODIFIED) { public void applyProperty(final CPlatformWindow c, final Object value) {
             c.setStyleBits(DOCUMENT_MODIFIED, value == null ? false : Boolean.parseBoolean(value.toString()));
--- a/jdk/src/macosx/classes/sun/lwawt/macosx/LWCToolkit.java	Wed Jul 09 17:11:53 2014 +0400
+++ b/jdk/src/macosx/classes/sun/lwawt/macosx/LWCToolkit.java	Fri Jun 27 10:29:08 2014 -0700
@@ -32,6 +32,7 @@
 import java.awt.event.InputEvent;
 import java.awt.event.InvocationEvent;
 import java.awt.event.KeyEvent;
+import java.awt.font.TextAttribute;
 import java.awt.im.InputMethodHighlight;
 import java.awt.im.spi.InputMethodDescriptor;
 import java.awt.peer.*;
@@ -691,6 +692,7 @@
     }
 
     @Override
+    @SuppressWarnings("unchecked")
     public <T extends DragGestureRecognizer> T createDragGestureRecognizer(
             Class<T> abstractRecognizerClass, DragSource ds, Component c,
             int srcActions, DragGestureListener dgl) {
@@ -743,7 +745,7 @@
      * @since 1.3
      */
     @Override
-    public Map mapInputMethodHighlight(InputMethodHighlight highlight) {
+    public Map<TextAttribute, ?> mapInputMethodHighlight(InputMethodHighlight highlight) {
         return CInputMethod.mapInputMethodHighlight(highlight);
     }