RFR [9] 8071472: Add field setter API for setting final fields in readObject

Peter Levart peter.levart at gmail.com
Wed Mar 25 16:55:23 UTC 2015


On 03/25/2015 04:49 PM, Chris Hegarty wrote:
>> I have been thinking about this and I see several solutions:
>>
>> 1. provide protected final methods
>> ObjectInputStream.checkPersistentFinalsNotSet() and
>> markPersistentFinalsSet() that just delegate to FieldSetterContext for
>> ObjectInputStream classes to call as part of their own overriden
>> defaultReadObject() method. We should make sure those methods are called
>> in JDK's corba InputStreamHook and document they should be called in 3rd
>> party subclasses.
>
> Yes, I think I agree with this, but since the FieldSetterContext is 
> constructed in OIS private readSerialData, there is nothing to 
> delegate to, unless InputStreamHook/IIOPInputStream creates the context. 

Ah, I see. Let me look at this in some more detail...

Regards, Peter




More information about the core-libs-dev mailing list