<AWT Dev> [10] Review request for 8189201: [macosx] NotSerializableException during JFrame with MenuBar serialization

Semyon Sadetsky semyon.sadetsky at oracle.com
Tue Nov 7 16:48:57 UTC 2017

Hi Sergey,

On 11/02/2017 04:57 PM, Sergey Bylokhov wrote:

> Some small question while I do a review of other parts.
> After the fix the classes which store the listeners like 
> AccessibleAWTFocusHandler supports serialisation, but most of them are 
> used in pair with propertyListenersCount which is transient. Should we 
> serialize the count of listeners?
> But from the other point of view all our listeners like 
> "componentListener", "keyListener" etc are transient and have some 
> special steps in Component.writeObject().
Yes, it may be necessary to to do something with propertyListenersCount 
in writeObject() as well. But this may change the format compatibility. 
I have created a separate bug to investigate this: 

> On 31/10/2017 09:05, Semyon Sadetsky wrote:
>> The updated webrev: 
>> http://cr.openjdk.java.net/~ssadetsky/8189201/webrev.02/
>> On 10/23/2017 01:54 PM, Semyon Sadetsky wrote:
>>> Actually ScreenMenu is fully removed in uninstallUI() (line 54 of 
>>> AquaMenuBarUI), so there is no need to make its property listener 
>>> Serializable, please, ignore the change in ScreenMenuPropertyListener.
>>> --Semyon
>>> On 10/23/2017 01:25 PM, Semyon Sadetsky wrote:
>>>> On 10/23/2017 12:58 PM, Sergey Bylokhov wrote:
>>>>> On 23/10/2017 12:41, Semyon Sadetsky wrote:
>>>>>>> The AquaMenuBarBorder class is L&F specific, and it should not 
>>>>>>> be serialized/deserialized. Such information(plus l&f client 
>>>>>>> properties/listeners/etc) should be removed from the component 
>>>>>>> before serialization. And during deserialization the L&F of the 
>>>>>>> target system should be applied.
>>>>>> That is valid concern. The webrev is updated 
>>>>>> http://cr.openjdk.java.net/~ssadetsky/8189201/webrev.01/
>>>>> The same is applicable to ScreenMenuPropertyListener as well 
>>>>> because it is also L&F specific.
>>>>> I assume that the changes in AccessibleAWTComponentHandler/etc are 
>>>>> necessary because somecode installs the listeners on the 
>>>>> components, since the bug is not reproduced in Metal I assume that 
>>>>> this listeners are installed by Aqua, in this case these listeners 
>>>>> also should be removed from the component before serialization.
>>>> ScreenMenu is not a Swing component.
>>>> --Semyon

More information about the awt-dev mailing list