Many of Upload related classes are copied from commons-fileupload so I
cannot say for sure but this is what I think about this one:

UploadInfo is used for the ProgressBar and the variables below are not
needed actually after deserialization because at this point the ProgressBar
is no more visible.
I think the UploadInfo itself should not be serialized.

On Tue, Jan 18, 2011 at 4:02 PM, Attila Király <[email protected]>wrote:

> Hi!
>
> o.a.w.extensions.ajax.markup.html.form.upload.UploadInfo is a Serializable
> class but only has three fields (all with type long) and all 3 is
> transient.
> I am curious: why is that?
> The fields:
> private transient long timeStarted;
> private transient long totalBytes;
> private transient long bytesUploaded;
>
> From the code it seems timeStarted and totalBytes could be final because
> they are only set in the constructor, and all 3 are needed when the class
> is
> (de)serialized (which is possible in theory as instances are stored in
> session). So imho they shouldn't be transient.
>
>
> Király Attila
>

Reply via email to