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
            Priority: Minor


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 is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to