Hi, I have raised a CSR for this bug. Please have a look. https://bugs.openjdk.java.net/browse/JDK-8196569
Regards, Pankaj Bansal -----Original Message----- From: Prasanta Sadhukhan Sent: Thursday, February 1, 2018 3:18 PM To: swing-dev@openjdk.java.net; PANKAJ_B_BANSAL Subject: Re: <Swing Dev> [11] Review Request: JDK-5076761 : JList.setSelectedValue(null, ...) doesn't do anything +1. Minor nit, there should be a "comma" after 2018 in test. Also, raise a CSR before you push. Regards Prasanta > From: Semyon Sadetsky > Sent: Friday, January 19, 2018 7:02 AM > To: Pankaj Bansal; swing-dev@openjdk.java.net > Subject: Re: <Swing Dev> [11] Review Request: JDK-5076761 : > JList.setSelectedValue(null, ...) doesn't do anything > > Hi Pankaj, > > This version I like more since it doesn't clear selection after an attempt to > set it to nonexistent item. You have my +1. > > There is still a nonzero risk of incompatibility with old applications you > need to mention in the CSR. > > --Semyon > > > On 01/18/2018 06:47 AM, Pankaj Bansal wrote: >> Hi Sergey/Semyon, >> >> I have updated the code to clear selection if the object passed is null. It >> makes sense to do that as GetSelectedValue returns null if nothing is >> selected. This makes these two functions compatible in JList. >> I think we can deal with clearing selection if the object passed is not >> present in the JList in some other bug. Present bug only talks about the >> case when the Object passed in null. >> >> Please share your thoughts on this. >> >> webrev: >> http://cr.openjdk.java.net/~pbansal/5076761/webrev.06/ >> >> Regards, >> Pankaj Bansal >> >> -----Original Message----- >> From: Sergey Bylokhov >> Sent: Wednesday, January 17, 2018 10:23 PM >> To: Semyon Sadetsky; Pankaj Bansal; swing-dev@openjdk.java.net >> Subject: Re: <Swing Dev> [11] Review Request: JDK-5076761 : >> JList.setSelectedValue(null, ...) doesn't do anything >> >> On 17/01/2018 08:41, Semyon Sadetsky wrote: >>>> I already listed a methods which use null as an absent of the value. >>>> And current methods were implemented with this intention. >>> But JList is fully usable without them. >> No because getSelectedValue() will return null if no elements is selected. >> >>>>> as well as any pointer that JList couldn't contain null. >>>> There are no references to null in the javadoc which means that null >>>> is unsupported. By default the null value is unsupported, and it can >>>> be considered as supported only if spec accept that. >>> That is a good argument that proves that null is not considered as a >>> special value. >> What argument? There are no description that null is supported, but there >> are a description that null is used in somecases like getSelectedValue(). >> >> >> -- >> Best regards, Sergey.