JDK 8 code review request for 6226715: (ann) java.lang.annotation.AnnotationTypeMismatchException could not be serialized
joe.darcy at oracle.com
Thu Jun 16 15:17:13 UTC 2011
Rémi Forax wrote:
> Le 16/06/2011 02:35, Joe Darcy a écrit :
>> Please review my JDK 8 fix for
>> 6226715: (ann)
>> java.lang.annotation.AnnotationTypeMismatchException could not be
>> This fix includes the unusual step of marking a non-transient field
>> transient in a serialiable class, but the class can't meaningfully be
>> serialized today anyway so this change should have no adverse effect
>> in practice.
>> For good code hygiene, the new readObject method explicitly sets the
>> now transient field in question.
> Not sure it's good to drop 'final' just for code hygiene.
> A code that relies on the fact that this exception is non-mutable can
> now fail.
There is no setter for the field other than through the constructor (and
I don't really want to dip into sun.misc.Unsafe to set a final transient
field in the readObject method.
More information about the core-libs-dev