Hi Krishna, I am trying to understand the class JTabbedPane with this review. I have got some questions while doing, so please clarify it.
1. There is another variation of remove, remove(Component comp) line: 1034, where they remove the requested component from the container tree(if out of bound) and may be you need to set the accessible parent to null there as well. Probably you can add a test case to the test as well for this case(out of bound). 2. Another place where they need to remove is the setComponentAt() line: 1542 where they swap the existing component with the requested component. Since the existing component is removed from it's container tree, you might need to set the accessible parent to null there as well I think. Thanks and regards, Shashi -----Original Message----- From: Sergey Bylokhov Sent: Thursday, December 13, 2018 2:22 AM To: Krishna Addepalli <[email protected]>; [email protected] Subject: Re: <Swing Dev> [12]RFR: JDK-6714324: Removing a component from a JTabbedPane does not clear its accessibleParent Thank you for clarification, the fix looks fine then. On 05/12/2018 06:49, Krishna Addepalli wrote: > Hi Sergey, > > Thanks for your suggestions. > I looked at those classes, and all of them are created when the functions > "getAccessibleChild" or "getAccessibleChildAt" are called. Everytime these > functions are called, a new instance of the class is created and returned. > Also, these classes look like to be short-lived. I saw that for example > AccessibleJListChild object is created inside a property change function in > JList. > > Thanks, > Krishna > > -----Original Message----- > From: Sergey Bylokhov > Sent: Saturday, December 1, 2018 6:58 AM > To: Krishna Addepalli <[email protected]>; > [email protected] > Subject: Re: <Swing Dev> [12]RFR: JDK-6714324: Removing a component from a > JTabbedPane does not clear its accessibleParent > > Hi, Krishna. > > As far as I understand the bug is reproduced because the "Page" > class sets its accessibility parent in the constructor and never reset it to > "null". > > The same code exists in the other classes as well: > AccessibleJTableHeaderEntry, AccessibleJTableHeaderCell, > AccessibleJTableCell, AccessibleJListChild, AccessibleAWTListChild. > > Can you please check them as well. > > On 29/11/2018 21:04, Krishna Addepalli wrote: >> Hello, >> >> Can someone review this simple fix? >> >> Thanks, >> Krishna >> >>> On 23-Nov-2018, at 12:42 PM, Krishna Addepalli >>> <[email protected] <mailto:[email protected]>> wrote: >>> >>> Hi All, >>> Please review a simple fix for >>> JDK-6714324:https://bugs.openjdk.java.net/browse/JDK-6714324 >>> Webrev:http://cr.openjdk.java.net/~kaddepalli/6714324/webrev00 >>> The problem is when a tab component is added, and if there is an >>> AccessibleContext defined for JTabbedPane, then that is added as a parent >>> to the tab component being added, but while removing the same, the >>> reference is still not cleared. >>> This fix removes the reference to the accessibleParent in the child tab >>> component. >>> Thanks, >>> Krishna >> > > > -- > Best regards, Sergey. > -- Best regards, Sergey.
