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.
Steps to reproduce: - create C/C++ sample project "Welcome" - open welcome.cc source file - put cursor inside main function - pop up menu Navigate->View Macro Expansion - put cursor inside macro expansion view - unselect top button of macro expansion view (sync caret) - move cursor inside macro expansion view Parsing API does not update file object in Source. To see bug set breakpoint in DataObject.find() method on statement: "throw new FileStateInvalidException(fo.toString());" As result all ParserResultTask cannot find document by: parserResult.getSnapshot().getSource().getDocument(false)
Task factory in module cnd.navigation, class org.netbeans.modules.cnd.navigation.macroview.MacroExpansionCaretAwareFactory
The Source is bound to FileObject. When the FileObject is deleted (becomes invalid) the Source is invalid as well. The Source.create() will return a new one. So the fact that the: org.openide.loaders.DataObject.find(DataObject.java:555) org.netbeans.modules.parsing.api.Source.getDocument(Source.java:259) org.netbeans.modules.parsing.impl.event.EventSupport$DocListener.propertyChange(EventSupport.java:286) org.openide.util.WeakListenerImpl$PropertyChange.propertyChange(WeakListenerImpl.java:197) java.beans.PropertyChangeSupport.fire(PropertyChangeSupport.java:335) java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:327) java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:263) org.openide.text.CloneableEditorSupport.firePropertyChange(CloneableEditorSupport.java:483) org.openide.text.CloneableEditorSupport.fireDocumentChange(CloneableEditorSupport.java:1741) org.openide.text.DocumentOpenClose$DocumentClose.run(DocumentOpenClose.java:1012) clears the Document from the Source is correct, as the Source is already invalid. The problem is that the invalid Source is used for ParserResultTasks.
The problems is caused by strange change of the FileObject (memory FO) in the Document. When I click the sync caret button, the parsing.api correctly gets an event DataObject.PROP_VALID (the FileObject in invalid) unfortunately it does not get DataObject.PROP_VALID when the DataObject becomes valid again. I've verified in debugger that the Document's FileObject has changed to valid one and also DataObject is valid.
Fixed jet-main f16048c0272a
Integrated into 'main-silver', will be available in build *201401280001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/f16048c0272a User: Tomas Zezula <tzezula@netbeans.org> Log: #240829:Parsing result has wrong file object