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.
When there are some layers merged in the MultiFileSystem and a FileObject on a layer has the "methodvalue" attribute, the method referenced by that attribute gets passed the FileObject instance from the layer, rather than the one from the MultiFileSystem.
Any clues when this issue may be fixed ? It does not allow to register a context-aware service (context == the filesystem/fileobject used to create the InstanceCookie) through a layer or a XMLFS/MultiFS. One must use .settings XML files instead (note the inconsistency b/w .settings file and instanceCreate attribute), but the handler attempts to autosave modified instances.
Fixed, using package private static ThreadLocal variable to remeber MultiFileObject which is asked for attribute's value, this MFO is then passed to the method specified in methodvalue attribute. This fix is crutial for Looks and Projects. MultiFileObject.java, 1.105 XMLFileSystem.java, 1.65
What is the use case for this please?
Use case for the method referenced by the methodValue attribute, that gets passed FileObject ? FileObject can have more attributes than this one methodValue. If method referenced by the methodValue gets passed FileObject it gets also its attributes, which may be convenient for parametrization of instantiation.
The original usecase as far as I can remember is that the method which gets FO as parameter sometimes need to obtain the Project for it. E.g. when method creates instance of some service in the project, this service has to know what is the project. Projects infrastructure allows to find the project for FileObjects laying on the ProjectFileSystem, however, this is the layered MFS and the FO usually comes from one of its layers. If the method gets FO from the layer and not the appropriate MultiFileObject which getFileSystem() is instanceof ProjectFileSystem then the method can't find the project.
closed