RFR: 8044862: Fix raw and unchecked lint warnings in macosx specific code
Hi, Please review a webrev for fixing rawtypes and unchecked lint warning for macosx specific java code, this webrev is depending on JDK-8043548[1] where some of the override methods are defined, Also as the src/macosx/classes/apple/launcher/JavaAppLauncher.java to be removed from JDK-8048337, the webrev omits that file. The webrev can be found at, http://cr.openjdk.java.net/~henryjen/jdk9/8044862/0/webrev/ [1] https://bugs.openjdk.java.net/browse/JDK-8043548 Cheers, Henry
Hi Henry, Your changes look good to me (I assume there was an issue using wildcards in AquaComboBoxButton.java). Thanks, -Joe On 06/27/2014 02:45 PM, Henry Jen wrote:
Hi,
Please review a webrev for fixing rawtypes and unchecked lint warning for macosx specific java code, this webrev is depending on JDK-8043548[1] where some of the override methods are defined,
Also as the src/macosx/classes/apple/launcher/JavaAppLauncher.java to be removed from JDK-8048337, the webrev omits that file.
The webrev can be found at, http://cr.openjdk.java.net/~henryjen/jdk9/8044862/0/webrev/
[1] https://bugs.openjdk.java.net/browse/JDK-8043548
Cheers, Henry
On June 27, 2014 at 3:00:13 PM, Joe Darcy (joe.darcy@oracle.com(mailto:joe.darcy@oracle.com)) wrote:
Hi Henry,
Your changes look good to me (I assume there was an issue using wildcards in AquaComboBoxButton.java).
Cannot make it to work. The problematic code is in line 169, 169 final ListCellRenderer<Object> renderer = comboBox.getRenderer(); 170 171 // fake it out! not renderPressed 172 final Component c = renderer.getListCellRendererComponent(list, comboBox.getSelectedItem(), -1, false, false); The above code involve following two APIs, ListCellRenderer<? super E> JComboBox<E>::getRenderer(); Component ListCellRenderer<E>::getListCellRendererComponent(JList<? extends E> list, E value, int index, boolean isSelected, boolean cellHasFocus); Feels like ? extends Object should work, but javac still complains, /Users/henryjen/ws/9dev/jdk/src/macosx/classes/com/apple/laf/AquaComboBoxButton.java:169: error: incompatible types: ListCellRenderer<CAP#1> cannot be converted to ListCellRender<Object> final ListCellRenderer<Object> renderer = comboBox.getRenderer(); ^ where CAP#1,CAP#2 are fresh type-variables: CAP#1 extends Object super: CAP#2 from capture of ? super CAP#2 CAP#2 extends Object from capture of ? extends Object Cheers, Henry
Thanks,
-Joe
On 06/27/2014 02:45 PM, Henry Jen wrote:
Hi,
Please review a webrev for fixing rawtypes and unchecked lint warning for macosx specific java code, this webrev is depending on JDK-8043548[1] where some of the override methods are defined,
Also as the src/macosx/classes/apple/launcher/JavaAppLauncher.java to be removed from JDK-8048337, the webrev omits that file.
The webrev can be found at, http://cr.openjdk.java.net/~henryjen/jdk9/8044862/0/webrev/
[1] https://bugs.openjdk.java.net/browse/JDK-8043548
Cheers, Henry
Hi, Would someone from swing team care to take a look at this? The change of src/macosx/classes/sun/font/CFontConfiguration.java will be dropped as it had been fixed in JDK-8048980. Cheers, Henry On 06/27/2014 03:00 PM, Joe Darcy wrote:
Hi Henry,
Your changes look good to me (I assume there was an issue using wildcards in AquaComboBoxButton.java).
Thanks,
-Joe
On 06/27/2014 02:45 PM, Henry Jen wrote:
Hi,
Please review a webrev for fixing rawtypes and unchecked lint warning for macosx specific java code, this webrev is depending on JDK-8043548[1] where some of the override methods are defined,
Also as the src/macosx/classes/apple/launcher/JavaAppLauncher.java to be removed from JDK-8048337, the webrev omits that file.
The webrev can be found at, http://cr.openjdk.java.net/~henryjen/jdk9/8044862/0/webrev/
[1] https://bugs.openjdk.java.net/browse/JDK-8043548
Cheers, Henry
Hello, Henry. AquaComboBoxRendererInternal : why <? extends Object> and not just <?>? AquaComboBoxUI:427, 510, 530 - you can replace JComboBox<Object> with JComboBox<?> and avoid a @SupressWarning annotation. AquaFileChooserUI.createDirectoryComboBoxRenderer actually returns a ListCellRenderer<File>, DirectoryComboBoxModel is a <File> model, and a combobox contains only Files. I suggest to try to genereficate this correctly and look where it brings us. Also I didn't look at the KeychainStore.java as I know nothing about this code. With best regards. Petr. On 09 июля 2014 г., at 7:30, Henry Jen <henry.jen@oracle.com> wrote:
Hi,
Would someone from swing team care to take a look at this?
The change of src/macosx/classes/sun/font/CFontConfiguration.java will be dropped as it had been fixed in JDK-8048980.
Cheers, Henry
On 06/27/2014 03:00 PM, Joe Darcy wrote:
Hi Henry,
Your changes look good to me (I assume there was an issue using wildcards in AquaComboBoxButton.java).
Thanks,
-Joe
On 06/27/2014 02:45 PM, Henry Jen wrote:
Hi,
Please review a webrev for fixing rawtypes and unchecked lint warning for macosx specific java code, this webrev is depending on JDK-8043548[1] where some of the override methods are defined,
Also as the src/macosx/classes/apple/launcher/JavaAppLauncher.java to be removed from JDK-8048337, the webrev omits that file.
The webrev can be found at, http://cr.openjdk.java.net/~henryjen/jdk9/8044862/0/webrev/
[1] https://bugs.openjdk.java.net/browse/JDK-8043548
Cheers, Henry
Thanks, Petr. I worked out AquaFileChooserUI and updated the webrev to adapt comments from both you and Joe. The updated webrev is at, http://cr.openjdk.java.net/~henryjen/jdk9/8044862/1/webrev/ Cheers, Henry On 07/09/2014 01:07 AM, Petr Pchelko wrote:
Hello, Henry.
AquaComboBoxRendererInternal : why <? extends Object> and not just <?>?
AquaComboBoxUI:427, 510, 530 - you can replace JComboBox<Object> with JComboBox<?> and avoid a @SupressWarning annotation.
AquaFileChooserUI.createDirectoryComboBoxRenderer actually returns a ListCellRenderer<File>, DirectoryComboBoxModel is a <File> model, and a combobox contains only Files. I suggest to try to genereficate this correctly and look where it brings us.
Also I didn't look at the KeychainStore.java as I know nothing about this code.
With best regards. Petr.
On 09 июля 2014 г., at 7:30, Henry Jen <henry.jen@oracle.com> wrote:
Hi,
Would someone from swing team care to take a look at this?
The change of src/macosx/classes/sun/font/CFontConfiguration.java will be dropped as it had been fixed in JDK-8048980.
Cheers, Henry
On 06/27/2014 03:00 PM, Joe Darcy wrote:
Hi Henry,
Your changes look good to me (I assume there was an issue using wildcards in AquaComboBoxButton.java).
Thanks,
-Joe
On 06/27/2014 02:45 PM, Henry Jen wrote:
Hi,
Please review a webrev for fixing rawtypes and unchecked lint warning for macosx specific java code, this webrev is depending on JDK-8043548[1] where some of the override methods are defined,
Also as the src/macosx/classes/apple/launcher/JavaAppLauncher.java to be removed from JDK-8048337, the webrev omits that file.
The webrev can be found at, http://cr.openjdk.java.net/~henryjen/jdk9/8044862/0/webrev/
[1] https://bugs.openjdk.java.net/browse/JDK-8043548
Cheers, Henry
Hello, Henry. The new version of the fix looks good to me. With best regards. Petr.
On Jul 10, 2014, at 4:51 AM, Henry Jen <henry.jen@oracle.com> wrote:
Thanks, Petr.
I worked out AquaFileChooserUI and updated the webrev to adapt comments from both you and Joe.
The updated webrev is at, http://cr.openjdk.java.net/~henryjen/jdk9/8044862/1/webrev/
Cheers, Henry
On 07/09/2014 01:07 AM, Petr Pchelko wrote:
Hello, Henry.
AquaComboBoxRendererInternal : why <? extends Object> and not just <?>?
AquaComboBoxUI:427, 510, 530 - you can replace JComboBox<Object> with JComboBox<?> and avoid a @SupressWarning annotation.
AquaFileChooserUI.createDirectoryComboBoxRenderer actually returns a ListCellRenderer<File>, DirectoryComboBoxModel is a <File> model, and a combobox contains only Files. I suggest to try to genereficate this correctly and look where it brings us.
Also I didn't look at the KeychainStore.java as I know nothing about this code.
With best regards. Petr.
On 09 июля 2014 г., at 7:30, Henry Jen <henry.jen@oracle.com> wrote:
Hi,
Would someone from swing team care to take a look at this?
The change of src/macosx/classes/sun/font/CFontConfiguration.java will be dropped as it had been fixed in JDK-8048980.
Cheers, Henry
On 06/27/2014 03:00 PM, Joe Darcy wrote:
Hi Henry,
Your changes look good to me (I assume there was an issue using wildcards in AquaComboBoxButton.java).
Thanks,
-Joe
On 06/27/2014 02:45 PM, Henry Jen wrote:
Hi,
Please review a webrev for fixing rawtypes and unchecked lint warning for macosx specific java code, this webrev is depending on JDK-8043548[1] where some of the override methods are defined,
Also as the src/macosx/classes/apple/launcher/JavaAppLauncher.java to be removed from JDK-8048337, the webrev omits that file.
The webrev can be found at, http://cr.openjdk.java.net/~henryjen/jdk9/8044862/0/webrev/
[1] https://bugs.openjdk.java.net/browse/JDK-8043548
Cheers, Henry
Looks fine to me too; thanks, -Joe On 07/09/2014 09:13 PM, Petr Pchelko wrote:
Hello, Henry.
The new version of the fix looks good to me.
With best regards. Petr.
On Jul 10, 2014, at 4:51 AM, Henry Jen <henry.jen@oracle.com> wrote:
Thanks, Petr.
I worked out AquaFileChooserUI and updated the webrev to adapt comments from both you and Joe.
The updated webrev is at, http://cr.openjdk.java.net/~henryjen/jdk9/8044862/1/webrev/
Cheers, Henry
On 07/09/2014 01:07 AM, Petr Pchelko wrote:
Hello, Henry.
AquaComboBoxRendererInternal : why <? extends Object> and not just <?>?
AquaComboBoxUI:427, 510, 530 - you can replace JComboBox<Object> with JComboBox<?> and avoid a @SupressWarning annotation.
AquaFileChooserUI.createDirectoryComboBoxRenderer actually returns a ListCellRenderer<File>, DirectoryComboBoxModel is a <File> model, and a combobox contains only Files. I suggest to try to genereficate this correctly and look where it brings us.
Also I didn't look at the KeychainStore.java as I know nothing about this code.
With best regards. Petr.
On 09 июля 2014 г., at 7:30, Henry Jen <henry.jen@oracle.com> wrote:
Hi,
Would someone from swing team care to take a look at this?
The change of src/macosx/classes/sun/font/CFontConfiguration.java will be dropped as it had been fixed in JDK-8048980.
Cheers, Henry
On 06/27/2014 03:00 PM, Joe Darcy wrote:
Hi Henry,
Your changes look good to me (I assume there was an issue using wildcards in AquaComboBoxButton.java).
Thanks,
-Joe
On 06/27/2014 02:45 PM, Henry Jen wrote:
Hi,
Please review a webrev for fixing rawtypes and unchecked lint warning for macosx specific java code, this webrev is depending on JDK-8043548[1] where some of the override methods are defined,
Also as the src/macosx/classes/apple/launcher/JavaAppLauncher.java to be removed from JDK-8048337, the webrev omits that file.
The webrev can be found at, http://cr.openjdk.java.net/~henryjen/jdk9/8044862/0/webrev/
[1] https://bugs.openjdk.java.net/browse/JDK-8043548
Cheers, Henry
participants (3)
-
Henry Jen
-
Joe Darcy
-
Petr Pchelko