You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Rob Tompkins (JIRA)" <ji...@apache.org> on 2017/06/06 04:48:18 UTC
[jira] [Closed] (FILEUPLOAD-162) NullPtr after object unserialized
because file cleaned meanwhile
[ https://issues.apache.org/jira/browse/FILEUPLOAD-162?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Rob Tompkins closed FILEUPLOAD-162.
-----------------------------------
won't fix.
> NullPtr after object unserialized because file cleaned meanwhile
> ----------------------------------------------------------------
>
> Key: FILEUPLOAD-162
> URL: https://issues.apache.org/jira/browse/FILEUPLOAD-162
> Project: Commons FileUpload
> Issue Type: Bug
> Affects Versions: 1.2, 1.2.1
> Environment: all
> Reporter: Alain Coetmeur
> Assignee: Jochen Wiedmann
> Priority: Minor
> Original Estimate: 1h
> Remaining Estimate: 1h
>
> When I serialize DiskFileItem which are not 'inmemory' and unserialize them back,
> I get a crash in isInMemory, because the file cited in the serialized content have been deleted meanwhile.
> here is a patch I propose
> private void writeObject(ObjectOutputStream out) throws IOException {
> // Read the data
> cachedContent=get();// get in mem before serialize en mémoire
> // write out values
> out.defaultWriteObject();
> cachedContent=null;//clean mem... not so usefull since object will probably die soon, but...
> }
>
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)