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

Ajit Ghaisas ajit.ghaisas at oracle.com
Tue Jul 12 08:30:12 UTC 2016


Hi Andrej,

    Can you please review this?

Regards,
Ajit

-----Original Message-----
From: Ajit Ghaisas 
Sent: Friday, July 08, 2016 10:32 AM
To: Andrej Golovnin
Cc: Rajeev Chamyal; Alexander Scherbatiy; swing-dev at openjdk.java.net
Subject: RE: [9] Fix for JDK-6567433 : JComponent.updateUI() may create StackOverflowError

Hi Andrej,

     Thanks for your suggestion.

      I have made the 'updateInProgress' member of these classes transient. 
      This is out of the fact that - 'updateInProgress' member is just an internal field of the class that need not be preserved during serialization.

       Here is the updated webrev. Request you to review.
       http://cr.openjdk.java.net/~aghaisas/6567433/webrev.03/
      
Regards,
Ajit
      
 

-----Original Message-----
From: Andrej Golovnin [mailto:andrej.golovnin at gmail.com] 
Sent: Thursday, July 07, 2016 4:44 PM
To: Ajit Ghaisas
Cc: Rajeev Chamyal; Alexander Scherbatiy; swing-dev at openjdk.java.net
Subject: Re: [9] Fix for JDK-6567433 : JComponent.updateUI() may create StackOverflowError

Hi Ajit,

one more thing that I have just noticed:

 /**
  * Flag to indicate UI update is in progress
  */
 private boolean updateInProgress;

I think the field must be transient. In Swing every component is serializable. When updateInProgress is set to true and you serialize/deserialize the component, then the call of the #updateUI()-method on the deserialized instance would never update the UI of the deserialized component because the flag updateInProgress will never change from true to false.

Best regards,
Andrej Golovnin



More information about the swing-dev mailing list