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.
Such exception rarely occurs during using cnd Exception in thread "Code Model Parser 0" java.lang.AssertionError: empty project for UID KeyBasedUID on ProjectKey DummyProject at org.netbeans.modules.cnd.modelimpl.csm.core.FileImpl._getProject(FileImpl.java:133) at org.netbeans.modules.cnd.modelimpl.csm.core.FileImpl.getProjectImpl(FileImpl.java:620) at org.netbeans.modules.cnd.modelimpl.csm.core.ParserQueue.onFileParsingFinished(ParserQueue.java:578) at org.netbeans.modules.cnd.modelimpl.csm.core.ParserThread.run(ParserThread.java:68) at org.netbeans.modules.cnd.modelimpl.csm.core.ParserThreadManager$Wrapper.run(ParserThreadManager.java:60) at java.lang.Thread.run(Thread.java:595)
not reproducible for a long time already.
In the last 2 days I've gotten several dozen of these. Here's a partial stack trace. I can attach a complete one if you want. I got these on Solaris yesterday and Windows today. In both cases, I was debugging the same project (copied from Solaris to Windows and recompiled). The source file is ~gordonp/NetBeansProjects/PThead_1/pthread_1.c, although I think I copied it to /net/pucci.sfbay/export/pucci1/pthread_1.c.
Created attachment 55526 [details] Log file showing exceptions
The stacks in this issue differ. But since it seems the original stack does not repeat, let's consider it's about the attached one http://www.netbeans.org/nonav/issues/showattachment.cgi/55526/messages.log
I guess I know the reason - at least one possible reason. The HybridRepository.put() checks canWrite() for object; and if false is returned, does nothing. The only model object, for which canWrite can return false is CsmFile; false is returned in the case file is changed in buffer. If file bacame changed prior than FileImpl was created (which is possible), we can experinece such exceptions: file has itd key-based UID, it is stored in project maps, but won't be stored in persistence. As soon as it sissapears from the in-memory cache, exceptions start to occur.
I believe it is fixed now. (It's difficult to refer to the particular changesets) I'm able to reproduce it with the NB/CND built a week ago: close the IDE with a project and a file in editor open. Upon IDE restart, try to modify this file as soon as possible. You'll get a bunch of exceptions a bit later. The reason is exactly the same I described in my previous comment. The reason is fixed by recent commits. Now I can not reproduce the exception.