On June 27, 2014 at 3:00:13 PM, Joe Darcy 
(joe.da...@oracle.com(mailto:joe.da...@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
>  

Reply via email to