You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Gary Gregory (JIRA)" <ji...@apache.org> on 2013/01/15 18:18:12 UTC
[jira] [Commented] (VFS-285) AbstractFileObject.getChildren():
internal structures will be left inconsistent if the excepion is thrown
[ https://issues.apache.org/jira/browse/VFS-285?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13554015#comment-13554015 ]
Gary Gregory commented on VFS-285:
----------------------------------
Thomas, feel free to commit. If you do, please update the changes.xml and this issue.
Thank you,
Gary
> AbstractFileObject.getChildren(): internal structures will be left inconsistent if the excepion is thrown
> ---------------------------------------------------------------------------------------------------------
>
> Key: VFS-285
> URL: https://issues.apache.org/jira/browse/VFS-285
> Project: Commons VFS
> Issue Type: Bug
> Affects Versions: Nightly Builds
> Reporter: Kirill Safonov
> Priority: Critical
> Attachments: VFS-285.patch
>
>
> AbstractFileObject.getChildren() creates *children* array and then fills it by resolving child names via FileSystemManager.resolveName(). If the latter method throws an exception (in my case it's "Invalid descendent file name "pci-0000:00:07.1-scsi-0:0:0:0""), children array is left as is with some of the entries = null, that inevitably results in NPE on the next getChildren() call:
> at org.apache.commons.vfs.provider.AbstractFileSystem.resolveFile(AbstractFileSystem.java:319)
> at org.apache.commons.vfs.provider.AbstractFileSystem.resolveFile(AbstractFileSystem.java:314)
> at org.apache.commons.vfs.provider.AbstractFileObject.resolveFile(AbstractFileObject.java:723)
> at org.apache.commons.vfs.provider.AbstractFileObject.resolveFiles(AbstractFileObject.java:715)
> at org.apache.commons.vfs.provider.AbstractFileObject.getChildren(AbstractFileObject.java:618)
> at org.apache.commons.vfs.provider.ftp.FtpFileObject.getChildren(FtpFileObject.java:412)
> since AbstractFileObject.getChildren() only checks that *children* instance is not null
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira