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 BinaryFS.getAttributes ends up in a methodvalue call, which again asks for BinaryFS.getAttribute on different FileObject, which again calls some methodvalue, then the FileObject argument to such method is the first FileObject and not the second one.
Created attachment 75359 [details] Few tests to demonstrate the problem and two line fix
Jirka just found out that the tests are not really reproducing the right problem. But the problem is there, it is just necessary to simulate following stacktrace: org.netbeans.modules.settings.convertors.XMLPropertiesConvertor.<init>(XMLPropertiesConvertor.java:91) org.netbeans.modules.settings.convertors.XMLPropertiesConvertor.create(XMLPropertiesConvertor.java:87) org.netbeans.api.settings.Factory.properties(Factory.java:58) sun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethodAccessorImpl.java) sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) java.lang.reflect.Method.invoke(Method.java:597) org.netbeans.core.startup.layers.BinaryFS$AttrImpl$MethodAndParams.invoke(BinaryFS.java:558) org.netbeans.core.startup.layers.BinaryFS$AttrImpl.getValue(BinaryFS.java:490) org.netbeans.core.startup.layers.BinaryFS$BFSBase.getAttribute(BinaryFS.java:375) org.openide.filesystems.MultiFileObject.getAttribute(MultiFileObject.java:829) org.openide.filesystems.MultiFileObject.getAttribute(MultiFileObject.java:789) org.openide.filesystems.MultiFileObject.getAttribute(MultiFileObject.java:825) org.openide.filesystems.MultiFileObject.getAttribute(MultiFileObject.java:789) org.openide.filesystems.MultiFileObject.getAttribute(MultiFileObject.java:722) org.netbeans.modules.settings.convertors.SerialDataConvertor$SaveSupport.initConvertor(SerialDataConvertor.java:611) org.netbeans.modules.settings.convertors.SerialDataConvertor$SaveSupport.addPropertyChangeListener(SerialDataConvertor.java:638) org.netbeans.modules.settings.convertors.SerialDataConvertor.attachToInstance(SerialDataConvertor.java:187) org.netbeans.modules.settings.convertors.SerialDataConvertor.access$300(SerialDataConvertor.java:89) org.netbeans.modules.settings.convertors.SerialDataConvertor$SettingsInstance.instanceCreate(SerialDataConvertor.java:432) org.netbeans.core.windows.persistence.PersistenceManager.getTopComponentPersistentForID(PersistenceManager.java:531) org.netbeans.core.windows.persistence.PersistenceManager.getTopComponentForID(PersistenceManager.java:641) org.netbeans.core.windows.PersistenceHandler.getTopComponentForID(PersistenceHandler.java:422) org.netbeans.core.windows.WindowManagerImpl.getTopComponentForID(WindowManagerImpl.java:803) org.netbeans.core.windows.WindowManagerImpl.findTopComponent(WindowManagerImpl.java:252) x.y.z.dul.APIDesignTopComponent.findInstance(APIDesignTopComponent.java:96) sun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethodAccessorImpl.java) sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) java.lang.reflect.Method.invoke(Method.java:597) org.netbeans.core.startup.layers.BinaryFS$AttrImpl$MethodAndParams.invoke(BinaryFS.java:558) org.netbeans.core.startup.layers.BinaryFS$AttrImpl.getValue(BinaryFS.java:490) org.netbeans.core.startup.layers.BinaryFS$BFSBase.getAttribute(BinaryFS.java:375) org.openide.filesystems.MultiFileObject.getAttribute(MultiFileObject.java:829) org.openide.filesystems.MultiFileObject.getAttribute(MultiFileObject.java:789) org.openide.filesystems.MultiFileObject.getAttribute(MultiFileObject.java:825) org.openide.filesystems.MultiFileObject.getAttribute(MultiFileObject.java:789) org.openide.filesystems.MultiFileObject.getAttribute(MultiFileObject.java:722) org.netbeans.core.startup.layers.BinaryFS$FOEntry.getValue(BinaryFS.java:979) java.util.AbstractMap.get(AbstractMap.java:165) org.openide.windows.OpenComponentAction.getTopComponent(OpenComponentAction.java:70) org.openide.windows.OpenComponentAction.actionPerformed(OpenComponentAction.java:74) org.openide.awt.AlwaysEnabledAction.actionPerformed(AlwaysEnabledAction.java:89) Then the final fo passed to the topmost method is "Actions/Windows/name-of-Action.instance" which is the original one.
Created attachment 75512 [details] Finally the correct test that fails in the old setup and passes with new code
Is then needed to comment out attrAskedFileObject.set(null); in BinaryFS?
There is no need to comment it out. I just find the call unsound and illogical. Probably it was just a not fully correct workaround for this bug.
core-main#f1ff99c04e61