Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.2
-
None
Description
When upgrading the Turbine code to commons-fileupload 1.2, I got NPEs in Unit tests dealing with DiskFileItems. In that special case, a FileItem was created like this:
ParameterParser pp = new DefaultParameterParser();
DiskFileItemFactory factory = new DiskFileItemFactory(10240, new File("."));
FileItem test = factory.createItem("upload-field", "application/octet-stream", false, null);
pp.add("upload-field", test);
assertTrue(pp.toString().startsWith("{upload-field=[name=null"));
pp.toString() causes a call to test.toString() which (among other things) calls dfos.getFile(). This fails because dfos is not initialized before getOutputStream() is called.
Attachments
Issue Links
- is duplicated by
-
FILEUPLOAD-190 NPE in DiskFileItem#getStoreLocation()
- Closed