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

Pankaj Bansal pankaj.b.bansal at oracle.com
Wed Jan 3 07:26:51 UTC 2018


Hi Sergey,

Thanks for the review.

I have made the suggested changes. Please have a look.
webrev: http://cr.openjdk.java.net/~pbansal/5076761/webrev.01/

Regards,
Pankaj Bansal


-----Original Message-----
From: Sergey Bylokhov 
Sent: Wednesday, January 3, 2018 3:31 AM
To: Pankaj Bansal; swing-dev at openjdk.java.net; Prasanta Sadhukhan
Subject: Re: [11] Review Request: JDK-5076761 : JList.setSelectedValue(null, ...) doesn't do anything

Hi, Pankaj.
The fix looks fine, but I suggest to update the spec as well and describe the behavior if "null" value is passed.

On 02/01/2018 02:07, Pankaj Bansal wrote:
> Hi All,
> 
> Please review the fix for JDK 11.
> 
> Bug:
> 
> https://bugs.openjdk.java.net/browse/JDK-5076761
> 
> Webrev:
> 
> http://cr.openjdk.java.net/~pbansal/5076761/webrev.00/
> 
> Issue:
> 
> When setSelectedValue is called on JList with null object, it should 
> clear all selection. But it is not doing anything.
> 
> Fix:
> 
> In setSelectedValue if the object is null, the setSelectedIndex is 
> called with -1. but this does not clear the selection. We should be 
> calling clearSelection instead of SetSelectedIndex.
> 
> Regards,
> 
> Pankaj Bansal
> 


--
Best regards, Sergey.



More information about the swing-dev mailing list