<Swing Dev> [9] Fix for JDK-6567433 : JComponent.updateUI() may create StackOverflowError
Ajit Ghaisas
ajit.ghaisas at oracle.com
Thu Jul 7 09:44:10 UTC 2016
Hi,
Thanks Alex for pointing out there might be more components showing similar behavior.
Two more components are identified which may cause this recursion in UpdateUI() method - JTree and JTable.
Now, total 5 components ( JComboBox, JList, JTree, JTable and JTableHeader) are fixed.
Please review the updated webrev :
http://cr.openjdk.java.net/~aghaisas/6567433/webrev.01/
Regards,
Ajit
From: Alexandr Scherbatiy
Sent: Tuesday, July 05, 2016 5:55 PM
To: Ajit Ghaisas; Rajeev Chamyal; swing-dev at openjdk.java.net
Subject: Re: [9] Fix for JDK-6567433 : JComponent.updateUI() may create StackOverflowError
On 7/5/2016 2:51 PM, Ajit Ghaisas wrote:
Hi,
Bug :
https://bugs.openjdk.java.net/browse/JDK-6567433
Calling updateUI() on JList, JComboBox and JTableHeader can create StackOverflowErrors.
For example -
JList.updateUI() invokes updateUI() on its Cellrenderer via SwingUtilities.updateComponentTreeUI().
If the cellrenderer is a parent of this JList the method recurses endless causing StackOverflowError.
Fix :
Added a recursion guard to JComboBox, JList and JTableHeader classes.
With this fix, UpdateUI() method in these classes does not result in recursion.
Webrev :
HYPERLINK "http://cr.openjdk.java.net/%7Eaghaisas/6567433/webrev.00/"http://cr.openjdk.java.net/~aghaisas/6567433/webrev.00/
Could the same issue affect another Swing components which allow to set a cell renderer, like JTree?
Thanks,
Alexandr.
Request you to review.
Regards,
Ajit
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/swing-dev/attachments/20160707/be840798/attachment.html>
More information about the swing-dev
mailing list