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 102184 - NullPointerException appears on deleted file
Summary: NullPointerException appears on deleted file
Status: VERIFIED FIXED
Alias: None
Product: cnd
Classification: Unclassified
Component: -- Other -- (show other bugs)
Version: 5.x
Hardware: All All
: P1 blocker (vote)
Assignee: Alexander Simon
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-04-23 16:13 UTC by soldatov
Modified: 2007-05-08 15:43 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description soldatov 2007-04-23 16:13:01 UTC
Steps:
- Create project
- Add into project header file (newfile.h)
- Add into project source file (newmain.c)
- Add into newmain.c file such string: "#include "newfile.h""
- Save file
- Delete newfile.h from project
- Modify newmain.c file
==> NullPointerException
java.lang.NullPointerException
	at
org.netbeans.modules.cnd.modelimpl.csm.core.ProjectImpl.reparseCoherence(ProjectImpl.java:157)
	at
org.netbeans.modules.cnd.modelimpl.csm.core.ProjectImpl.onFileEditEnd(ProjectImpl.java:138)
	at
org.netbeans.modules.cnd.modelimpl.platform.ModelSupport$FileChangeListener.stateChanged(ModelSupport.java:633)
	at
org.openide.loaders.DataObject$ModifiedRegistry.fireChangeEvent(DataObject.java:1072)
	at org.openide.loaders.DataObject$ModifiedRegistry.remove(DataObject.java:1056)
	at java.util.Collections$SynchronizedCollection.remove(Collections.java:1584)
	at org.openide.loaders.DataObject.setModified(DataObject.java:415)
	at
org.openide.text.DataEditorSupport$Env.unmarkModified(DataEditorSupport.java:556)
	at
org.openide.text.CloneableEditorSupport.notifyUnmodified(CloneableEditorSupport.java:1555)
	at
org.netbeans.modules.cnd.loaders.CppEditorSupport.notifyUnmodified(CppEditorSupport.java:120)
	at
org.openide.text.CloneableEditorSupport.callNotifyUnmodified(CloneableEditorSupport.java:1595)
	at
org.openide.text.CloneableEditorSupport$1SaveAsReader.after(CloneableEditorSupport.java:854)
	at
org.openide.text.CloneableEditorSupport.saveDocument(CloneableEditorSupport.java:865)
	at org.openide.text.DataEditorSupport.saveDocument(DataEditorSupport.java:308)
	at
org.netbeans.modules.cnd.loaders.CppEditorSupport$2.save(CppEditorSupport.java:79)
	at org.netbeans.core.NbTopManager.saveAll(NbTopManager.java:267)
	at org.netbeans.core.NbTopManager.access$300(NbTopManager.java:69)
	at org.netbeans.core.NbTopManager$NbLifecycleManager.saveAll(NbTopManager.java:427)
	at org.openide.actions.SaveAllAction.performAction(SaveAllAction.java:84)
	at
org.openide.util.actions.CallableSystemAction$1.run(CallableSystemAction.java:100)
	at
org.netbeans.modules.openide.util.ActionsBridge$ActionRunnable.actionPerformed(ActionsBridge.java:87)
	at org.netbeans.core.ModuleActions.invokeAction(ModuleActions.java:80)
	at
org.netbeans.modules.openide.actions.ActionsBridgeImpl.invokeAction(ActionsBridgeImpl.java:30)
	at
org.netbeans.modules.openide.util.ActionsBridge$ActionRunnable.doRun(ActionsBridge.java:78)
	at org.netbeans.modules.openide.util.ActionsBridge$1.run(ActionsBridge.java:47)
	at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:499)
[catch] at
org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:932)
Comment 1 soldatov 2007-04-23 16:28:51 UTC
I forgot about last step.
- Modify newmain.c file
- Save newmain.c file
==> NullPointerException
Comment 2 Alexander Simon 2007-04-25 15:50:02 UTC
fixed:
- check preprocessor state on null in ProjectImpl. It should be done because
method getPreprocStateState() can return null.
- fix bug in removing method in class GraphContainer.

CVS log:

Checking in ProjectImpl.java;
/shared/data/ccvs/repository/cnd/modelimpl/src/org/netbeans/modules/cnd/modelimpl/csm/core/ProjectImpl.java,v
 <--  ProjectImpl.java
new revision: 1.2.2.11.4.28; previous revision: 1.2.2.11.4.27
done
Checking in GraphContainer.java;
/shared/data/ccvs/repository/cnd/modelimpl/src/org/netbeans/modules/cnd/modelimpl/csm/core/GraphContainer.java,v
 <--  GraphContainer.java
new revision: 1.1.2.9; previous revision: 1.1.2.8
done
Comment 3 soldatov 2007-05-08 15:43:15 UTC
works correctly in 20070428 build