<Swing Dev> RFR JDK-8245785: javax.swing.JTabbedPane cannot be deserialized

Prasanta Sadhukhan prasanta.sadhukhan at oracle.com
Sun Jul 12 06:05:46 UTC 2020


On 11-Jul-20 11:45 AM, Sergey Bylokhov wrote:
> On 09.07.2020 06:26, Prasanta Sadhukhan wrote:
>> Hi Sergey,
>>
>> It seems "pages" object is not instantiated as readObject() did not 
>> read the object. I have modified the code to read the "pages" object 
>> after deserialization and now
>
> Do not need to change the getTabCount() since the pages will be non-null?
> It looks like this is the regression of JDK-8038937, could you please 
> check
> other fields as well, probably something is missing as well.

It's just a null check so I guess we can keep getTabCount() check 
in-place. Also, there are no other fields is missing which is required.

Regards
Prasanta
>
>>
>> if JTabbedPane has few tabs/pages, all are deserialized. This is also 
>> tested in the testcase.
>>
>> http://cr.openjdk.java.net/~psadhukhan/8245785/webrev.1/
>>
>> Regards
>> Prasanta
>> On 09-Jul-20 3:28 PM, Sergey Bylokhov wrote:
>>> Hi, Prasanta.
>>>
>>> Why the "pages" object is not instantiated when deserialized? What 
>>> will happen if the JTabbedPane
>>> will have a few(more than zero) pages before deserialization, will 
>>> all pages be serialized/deserialized in this case?
>>>
>>> On 09.07.2020 01:14, Prasanta Sadhukhan wrote:
>>>> Hi All,
>>>>
>>>> Please review a fix for an issue where deserializing a serialized 
>>>> JTabbedPane-object results in NullPointerException.
>>>>
>>>> The NPE is result of tabbed "pages" object not being instantiated 
>>>> when deserialized.
>>>>
>>>> Proposed fix is to add a null check for "pages" object.
>>>>
>>>> Bug: https://bugs.openjdk.java.net/browse/JDK-8245785
>>>>
>>>> webrev: http://cr.openjdk.java.net/~psadhukhan/8245785/webrev.0/
>>>>
>>>> Regards
>>>> Prasanta
>>>
>>>
>
>


More information about the swing-dev mailing list