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.
If the XMLFileSystem is part of MultiFileSystem and it is asked to get attribute value calling the method which accepts FileObject as a parameter it tries to pass the MultiFileObject to that method. I know the implementation of this behavior is kind of hack but it works and projects realy need it (and if I can remember the Looks too). The problem is that BinaryFS brakes this behavior. I will attach patch fixing this problem. It's not nice, but at least makes things work again. Please, either apply the patch or fix this in some other way. Thanks.
Created attachment 8193 [details] patch for BinaryFS class
This will require a unit test too - whoever put in the original hack did not bother to write a test for it.
Hey, you caught me :-). Well, I'll write these tests. IMO two tests are needed; first testing XMLFileSystem pluged into the MultiFileSystem which will test that MFO is passed to method invoked from methodvalue attribute implementation. Second test should be written to ensure that this still works for module layer and DefaultFileSystem. The first one should be quite easy, however I am unclear how to write the second one. Could you advice me how to create module just for test or how to plug layer into DFS from test?
Don't worry, I managed to write such a test, and confirmed that it passes for the binary cache manager if and only if your patch is applied. I opened issue #29382 to try to get rid of this kind of reflection stuff ASAP. I patched CacheManagerTestBaseHid, meaning all cache manager impls are tested, so this automatically tests XMLFileSystem (via XMLLayerCacheManagerImpl and NonCacheManager) as well as BinaryFS.
committed * Up-To-Date 1.12 core/src/org/netbeans/core/projects/FixedFileSystem.java committed * Up-To-Date 1.3 core/src/org/netbeans/core/projects/cache/BinaryFS.java committed * Up-To-Date 1.2 core/test/unit/src/org/netbeans/core/projects/cache/CacheManagerTestBaseHid.java committed * Up-To-Date 1.2 core/test/unit/src/org/netbeans/core/projects/cache/data/layer1.xml