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.

Bug 156158 - Nesting BinaryFS.getAttribute yields false results
Summary: Nesting BinaryFS.getAttribute yields false results
Status: RESOLVED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Filesystems (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: Jaroslav Tulach
URL:
Keywords:
Depends on:
Blocks: 155962
  Show dependency tree
 
Reported: 2008-12-30 12:13 UTC by Jaroslav Tulach
Modified: 2009-02-19 22:53 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Few tests to demonstrate the problem and two line fix (13.65 KB, patch)
2008-12-30 12:18 UTC, Jaroslav Tulach
Details | Diff
Finally the correct test that fails in the old setup and passes with new code (14.03 KB, patch)
2009-01-06 21:11 UTC, Jaroslav Tulach
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jaroslav Tulach 2008-12-30 12:13:25 UTC
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.
Comment 1 Jaroslav Tulach 2008-12-30 12:18:41 UTC
Created attachment 75359 [details]
Few tests to demonstrate the problem and two line fix
Comment 2 Jaroslav Tulach 2009-01-06 10:59:46 UTC
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.
Comment 3 Jaroslav Tulach 2009-01-06 21:11:39 UTC
Created attachment 75512 [details]
Finally the correct test that fails in the old setup and passes with new code
Comment 4 Jiri Skrivanek 2009-01-07 09:56:18 UTC
Is then needed to comment out attrAskedFileObject.set(null); in BinaryFS?
Comment 5 Jaroslav Tulach 2009-01-07 15:20:36 UTC
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.
Comment 6 Jaroslav Tulach 2009-01-10 06:16:26 UTC
core-main#f1ff99c04e61