Re: [11] RFR JDK-8191106: Nimbus LookAndFeel does not apply keys FileChooser.directoryOpenButtonText/ToolTipText to JFileChooser

2018-01-05 Thread Sergey Bylokhov
On 04/01/2018 22:05, Prasanta Sadhukhan wrote: Hi Semyon, It's not exactly the same. For Metal, we do not set mnemonic, not sure if that is intentional, so did not push it down to basic class. They were intentionally dropped: https://bugs.openjdk.java.net/browse/JDK-8080628 Regards

Re: [11] Review Request: JDK-5076761 : JList.setSelectedValue(null, ...) doesn't do anything

2018-01-05 Thread Sergey Bylokhov
On 05/01/2018 18:01, Semyon Sadetsky wrote: Can you explain what is wrong with the suggested  approach?  It is flexible to handle both null and non-null containing JList. Because it is wrong direction try to support some approach which is undefined behavior. The null has a special meaning in

Re: [11] Review Request: JDK-5076761 : JList.setSelectedValue(null, ...) doesn't do anything

2018-01-05 Thread Semyon Sadetsky
Can you explain what is wrong with the suggested  approach?  It is flexible to handle both null and non-null containing JList. On 01/05/2018 04:25 PM, Sergey Bylokhov wrote: I doubt that support of null values in the data model is intentional because JList is "A component that displays a list

Re: [11] Review Request: JDK-5076761 : JList.setSelectedValue(null, ...) doesn't do anything

2018-01-05 Thread Sergey Bylokhov
I doubt that support of null values in the data model is intentional because JList is "A component that displays a list of *objects* and allows the user to select one or more items." The null behavior was not specified and work in most cases because some of the getXXX methods in ListModel

Re: [11] Review Request: JDK-5076761 : JList.setSelectedValue(null, ...) doesn't do anything

2018-01-05 Thread Semyon Sadetsky
Hi Pankaj, Note that before the selection was never cleared if the object is not found and the DefaultListSelecetionModel is used. This may cause compatibility issue in old applications. Since the clearing selection behavior is now mentioned in setSelectedValue() javadoc it should be also

Re: [11] Review Request: JDK-5076761 : JList.setSelectedValue(null, ...) doesn't do anything

2018-01-05 Thread Pankaj Bansal
Hi Andrej, Sorry I missed this small thing. Following is the new webrev webrev: http://cr.openjdk.java.net/~pbansal/5076761/webrev.04/ Regards, Pankaj Bansal -Original Message- From: Andrej Golovnin [mailto:andrej.golov...@gmail.com] Sent: Friday, January 5, 2018 6:52 PM To: Pankaj

Re: [11] Review Request: JDK-5076761 : JList.setSelectedValue(null, ...) doesn't do anything

2018-01-05 Thread Andrej Golovnin
Hi Pankaj, > Webrev: http://cr.openjdk.java.net/~pbansal/5076761/webrev.03/ src/java.desktop/share/classes/javax/swing/JList.java 2379 for(i = 0, c = dm.getSize(); i < c; i++) { There should be a space after "for". Otherwise looks good. Thanks! Best regards, Andrej Golovnin

Re: [11] Review Request: JDK-6257207 : JTable.getDefaultEditor throws undocumented NullPointerException

2018-01-05 Thread Andrej Golovnin
Hi Pankaj, your change may break existing applications. Suppose that someone has created a sub-class of JTable and has overridden the #initializeLocalVars()-method and tries to access the table model in this model. Before your change the application works and after your change the application

[11] Review Request: JDK-6257207 : JTable.getDefaultEditor throws undocumented NullPointerException

2018-01-05 Thread Pankaj Bansal
Hi All, Please review the fix for JDK 11. Bug: https://bugs.openjdk.java.net/browse/JDK-6257207 Webrev: http://cr.openjdk.java.net/~pbansal/6257207/webrev.00/ Issue: JTable.getDefaultEditor can throw a NullPointerException. Fix: While creating JTable, when data model is set

Re: [11] Review Request: JDK-5076761 : JList.setSelectedValue(null, ...) doesn't do anything

2018-01-05 Thread Pankaj Bansal
Hi Andrej, Thanks for the review. I have made changes according to your suggestions. Please have a look. Webrev: http://cr.openjdk.java.net/~pbansal/5076761/webrev.03/ Regards, Pankaj Bansal -Original Message- From: Andrej Golovnin [mailto:andrej.golov...@gmail.com] Sent: Friday,

Re: [11] Review Request: JDK-5076761 : JList.setSelectedValue(null, ...) doesn't do anything

2018-01-05 Thread Andrej Golovnin
Hi Pankaj, > Webrev: http://cr.openjdk.java.net/~pbansal/5076761/webrev.02/ src/java.desktop/share/classes/javax/swing/JList.java You can simplify the code in lines 2373 if((anObject == selectedValue) || 2374 (anObject != null && anObject.equals(selectedValue))) { and

Re: [11] Review Request: JDK-5076761 : JList.setSelectedValue(null, ...) doesn't do anything

2018-01-05 Thread Pankaj Bansal
Hi Semyon/Sergey, Yes, JList can contain null elements as it can be added to data model. I think this changes a lot in this bug. I think the selection needs to be cleared when the object passed is not present in the list, irrespective of it being null or not. I have made code changes. Please