<Swing Dev> [9] Fix for JDK-6567433 : JComponent.updateUI() may create StackOverflowError

Alexandr Scherbatiy alexandr.scherbatiy at oracle.com
Tue Jul 5 12:25:26 UTC 2016


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 :
>
> http://cr.openjdk.java.net/~aghaisas/6567433/webrev.00/ 
> <http://cr.openjdk.java.net/%7Eaghaisas/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/20160705/adca537d/attachment.html>


More information about the swing-dev mailing list