This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
I think FileObject method which are only supported by FolderObj, should throw UnsupportedOperationException. For examples: FileObject createFolder(final String name) FileObject createData(final String name, final String ext) FileObject getFileObject(final String name, final String ext) getFileObject does not throw any exception just return null. The FileObject api would be more user friendly with this improvement.
I see, implementation FileObj.getFileObject(String, String) in module masterfs returns null, although it should throw IllegalArgumentException - JavaDoc says so. But some modules may depend on this incorrect behavior, so fixing this may break them. I'll need to evaluate possible impact of the fix. Thank you for reporting.
(In reply to Jaroslav Havlin from comment #1) > I see, implementation FileObj.getFileObject(String, String) in module > masterfs returns null, although it should throw IllegalArgumentException - > JavaDoc says so. > > But some modules may depend on this incorrect behavior, so fixing this may > break them. I'll need to evaluate possible impact of the fix. > > Thank you for reporting. Thanks for your response.
> some modules may depend on this incorrect behavior Some implementations of FileObject support relative paths, so getFileObject() on regular file becomes valid. For example (copied from one of our test cases): fo1.getFileObject("../../x/y.java") Throwing exception from FileObj.getFileObject() would break some modules, so we should stay with the current behavior. Thank you very much for reporting. Your point is correct, but the fix would break backward compatibility.