commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gary D. Gregory (Commented) (JIRA)" <>
Subject [jira] [Commented] (VFS-399) Custom VFSes over ZIP crashes with Null pointer Exception
Date Mon, 16 Jan 2012 20:59:41 GMT


Gary D. Gregory commented on VFS-399:

The test {{}} works in trunk. I
am guessing it worked when 2.0 was released. 

Can you provide a test case patch that shows the problem? Perhaps using other VFS file providers?

Thank you.
> Custom VFSes over ZIP crashes with Null pointer Exception
> ---------------------------------------------------------
>                 Key: VFS-399
>                 URL:
>             Project: Commons VFS
>          Issue Type: Bug
>    Affects Versions: 2.0
>         Environment: Windows XP x64
> Oracle JDK
>            Reporter: Konstantin Kasatkin
>            Priority: Blocker
>   Original Estimate: 5m
>  Remaining Estimate: 5m
> When I implement any intermediate VFS provider and try to connect it to ZIP VFS provider
like jar:myprovider:///myurl/myclasses.jar I get Null Pointer Exception due to wrong implementation
of ZIP provider. Because it initializes NULL zip entry and tries to get last modification
time of this entry without checking for null value.
> I suggest the solution for this issue in two steps.
> 1. For elimination of issue in class
in method doGetLastModifiedTime() {color:red}line 149{color} 
> change code: [{color:red} return entry.getTime();{color}]
> to code [{color:red}return entry==null ? 0 : entry.getTime();{color}]
> 2. For correct passing of last modification tate from parent VFS to ZIP VFS in class method init() {color:red}line 115{color}
> change code [{color:red}parent = createZipFileObject(parentName, null);{color}]
> to code [{color:red}
> ZipEntry parentEntry = new ZipEntry(getParentLayer().getFileSystem().getRoot().getName().getPath());
> parentEntry.setSize(0);
> try {
>      parentEntry.setTime(getParentLayer().getFileSystem().getRoot().getContent().getLastModifiedTime());
> } catch (Exception e) { }
> parent = createZipFileObject(parentName, entry);{color}
> ]

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:!default.jspa
For more information on JIRA, see:


View raw message