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 225150 - NullPointerException at org.netbeans.modules.cnd.modelimpl.content.project.IncludedFileContainer.prepareIncludeStorage
Summary: NullPointerException at org.netbeans.modules.cnd.modelimpl.content.project.In...
Status: RESOLVED FIXED
Alias: None
Product: cnd
Classification: Unclassified
Component: Code Model (show other bugs)
Version: 7.3
Hardware: All All
: P3 normal (vote)
Assignee: Alexander Simon
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-01-21 16:50 UTC by Alexander Simon
Modified: 2013-07-02 02:14 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 197828


Attachments
stacktrace (12.13 KB, text/plain)
2013-01-21 16:50 UTC, Alexander Simon
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Simon 2013-01-21 16:50:15 UTC
Build: NetBeans IDE Dev (Build 20130121-c0b2c8645d93)
VM: Java HotSpot(TM) Client VM, 23.6-b04, Java(TM) SE Runtime Environment, 1.7.0_11-b21
OS: SunOS

Stacktrace: 
java.lang.NullPointerException
   at org.netbeans.modules.cnd.modelimpl.content.project.IncludedFileContainer.prepareIncludeStorage(IncludedFileContainer.java:131)
   at org.netbeans.modules.cnd.modelimpl.csm.core.ProjectBase.prepareIncludeStorage(ProjectBase.java:1902)
   at org.netbeans.modules.cnd.modelimpl.csm.core.LibraryManager.resolveFileProjectOnInclude(LibraryManager.java:257)
   at org.netbeans.modules.cnd.modelimpl.parser.apt.APTProjectFileBasedWalker.include(APTProjectFileBasedWalker.java:99)
   at org.netbeans.modules.cnd.apt.support.APTAbstractWalker.serialIncludeImpl(APTAbstractWalker.java:286)
   at org.netbeans.modules.cnd.apt.support.APTAbstractWalker.includeImpl(APTAbstractWalker.java:147)
Comment 1 Alexander Simon 2013-01-21 16:50:19 UTC
Created attachment 130458 [details]
stacktrace
Comment 2 Alexander Simon 2013-01-21 16:57:43 UTC
It seems a lot of exceptions started from:
INFO [org.netbeans.modules.cnd.repository.disk.DiskRepositoryManager]: UNSAVED ENTRIES FOR /usr/include/L/
	FileInstantiationReferencesKey (/usr/include/L/, /usr/include/X11/XF86keysym.h)
	org.netbeans.modules.cnd.modelimpl.content.file.FileComponentInstantiations@3dc0cf
	FileInstantiationReferencesKey (/usr/include/L/, /usr/include/X11/extensions/XShm.h)
	org.netbeans.modules.cnd.modelimpl.content.file.FileComponentInstantiations@3d658b
	FileReferencesKey (/usr/include/L/, /usr/include/X11/extensions/XShm.h)
	org.netbeans.modules.cnd.modelimpl.content.file.FileComponentReferences@d5be24
	FileReferencesKey (/usr/include/L/, /usr/include/X11/XF86keysym.h)
	org.netbeans.modules.cnd.modelimpl.content.file.FileComponentReferences@b63932
	FileMacrosKey (/usr/include/L/, /usr/include/X11/XF86keysym.h)
	org.netbeans.modules.cnd.modelimpl.content.file.FileComponentMacros@1651786
	FileMacrosKey (/usr/include/L/, /usr/include/X11/extensions/XShm.h)
	org.netbeans.modules.cnd.modelimpl.content.file.FileComponentMacros@1eb6f8a
	FileIncludesKey (/usr/include/L/, /usr/include/X11/XF86keysym.h)
	org.netbeans.modules.cnd.modelimpl.content.file.FileComponentIncludes@1e8087a
	FileIncludesKey (/usr/include/L/, /usr/include/X11/extensions/XShm.h)
	org.netbeans.modules.cnd.modelimpl.content.file.FileComponentIncludes@84b5da
	FileKey (/usr/include/L/, /usr/include/X11/XF86keysym.h)
	INITIAL FileImpl @359251840:26700062 /usr/include/X11/XF86keysym.h prj:24535974KeyBasedUID on ProjectKey /usr/include/L/ NOT_BEING_PARSED
	FileKey (/usr/include/L/, /usr/include/X11/extensions/XShm.h)
	INITIAL FileImpl @-1593498685:27966009 /usr/include/X11/extensions/XShm.h prj:24535974KeyBasedUID on ProjectKey /usr/include/L/ NOT_BEING_PARSED
	FileDeclarationsKey (/usr/include/L/, /usr/include/X11/XF86keysym.h)
	org.netbeans.modules.cnd.modelimpl.content.file.FileComponentDeclarations@1a8201f
	FileDeclarationsKey (/usr/include/L/, /usr/include/X11/extensions/XShm.h)
	org.netbeans.modules.cnd.modelimpl.content.file.FileComponentDeclarations@d4f1d2
	FileContainerKey /usr/include/L/
	org.netbeans.modules.cnd.modelimpl.content.project.FileContainer@501fc1
FINE [org.netbeans.modules.cnd.makeproject.MakeBasedProjectFactorySingleton]: not concrete data file /usr/include/gtk-2.0/gtk@349edef2:2c14bd/nbproject/project.xml
 === Stopping parser queue stopwatch /usr/include/gtk-2.0 (198 files): 	 119135 ms
=== Starting parser queue stopwatch mozilla-2.0 (7874 files)
org.netbeans.modules.cnd.modelimpl.debug.IllegalRepositoryStateException: Failed to get container sorage by key  TWICE FileDeclarationsKey (/usr/include/L/, /usr/include/X11/XF86keysym.h)
	at org.netbeans.modules.cnd.modelimpl.debug.DiagnosticExceptoins.registerIllegalRepositoryStateException(DiagnosticExceptoins.java:96)
	at org.netbeans.modules.cnd.modelimpl.cache.impl.WeakContainer.getContainer(WeakContainer.java:99)
	at org.netbeans.modules.cnd.modelimpl.content.file.FileContent.getFileComponent(FileContent.java:385)
	at org.netbeans.modules.cnd.modelimpl.content.file.FileContent.getFileDeclarations(FileContent.java:346)
	at org.netbeans.modules.cnd.modelimpl.content.file.FileContent.getHardReferenceBasedCopy(FileContent.java:170)
	at org.netbeans.modules.cnd.modelimpl.csm.core.FileImpl$ParseDescriptor.<init>(FileImpl.java:993)
	at org.netbeans.modules.cnd.modelimpl.csm.core.FileImpl$ParseDescriptor.<init>(FileImpl.java:984)
	at org.netbeans.modules.cnd.modelimpl.csm.core.FileImpl.ensureParsed(FileImpl.java:555)
	at org.netbeans.modules.cnd.modelimpl.csm.core.ParserThread._run(ParserThread.java:149)
	at org.netbeans.modules.cnd.modelimpl.csm.core.ParserThread.run(ParserThread.java:75)
	at org.netbeans.modules.cnd.modelimpl.csm.core.ParserThreadManager$Wrapper.run(ParserThreadManager.java:92)
	at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1454)
	at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2048)

== Unit debug dump for key FileDeclarationsKey (/usr/include/L/, /usr/include/X11/XF86keysym.h). Unit name: "/usr/include/L/" unit id: 100003  
org.netbeans.modules.cnd.modelimpl.debug.IllegalRepositoryStateException: Failed to get container sorage by key  TWICE FileIncludesKey (/usr/include/L/, /usr/include/X11/XF86keysym.h)
	at org.netbeans.modules.cnd.modelimpl.debug.DiagnosticExceptoins.registerIllegalRepositoryStateException(DiagnosticExceptoins.java:96)
	at org.netbeans.modules.cnd.modelimpl.cache.impl.WeakContainer.getContainer(WeakContainer.java:99)
	at org.netbeans.modules.cnd.modelimpl.content.file.FileContent.getFileComponent(FileContent.java:385)
	at org.netbeans.modules.cnd.modelimpl.content.file.FileContent.getFileIncludes(FileContent.java:361)
	at org.netbeans.modules.cnd.modelimpl.csm.core.FileImpl.getFileIncludes(FileImpl.java:2078)
	at org.netbeans.modules.cnd.modelimpl.csm.core.FileImpl.getIncludes(FileImpl.java:1555)
	at org.netbeans.modules.cnd.modelimpl.content.project.GraphContainer.putFile(GraphContainer.java:138)
	at org.netbeans.modules.cnd.modelimpl.csm.core.FileImpl.postParse(FileImpl.java:750)
	at org.netbeans.modules.cnd.modelimpl.csm.core.FileImpl.ensureParsed(FileImpl.java:565)
	at org.netbeans.modules.cnd.modelimpl.csm.core.ParserThread._run(ParserThread.java:149)
	at org.netbeans.modules.cnd.modelimpl.csm.core.ParserThread.run(ParserThread.java:75)
	at org.netbeans.modules.cnd.modelimpl.csm.core.ParserThreadManager$Wrapper.run(ParserThreadManager.java:92)
	at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1454)
	at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2048)

== Unit debug dump for key FileIncludesKey (/usr/include/L/, /usr/include/X11/XF86keysym.h). Unit name: "/usr/include/L/" unit id: 100003  
java.lang.NullPointerException
	at org.netbeans.modules.cnd.modelimpl.content.file.FileComponent.<init>(FileComponent.java:69)
	at org.netbeans.modules.cnd.modelimpl.content.file.FileComponentDeclarations.<init>(FileComponentDeclarations.java:112)
	at org.netbeans.modules.cnd.modelimpl.content.file.FileContent.getHardReferenceBasedCopy(FileContent.java:170)
	at org.netbeans.modules.cnd.modelimpl.csm.core.FileImpl$ParseDescriptor.<init>(FileImpl.java:993)
	at org.netbeans.modules.cnd.modelimpl.csm.core.FileImpl$ParseDescriptor.<init>(FileImpl.java:984)
	at org.netbeans.modules.cnd.modelimpl.csm.core.FileImpl.ensureParsed(FileImpl.java:555)
	at org.netbeans.modules.cnd.modelimpl.csm.core.ParserThread._run(ParserThread.java:149)
	at org.netbeans.modules.cnd.modelimpl.csm.core.ParserThread.run(ParserThread.java:75)
	at org.netbeans.modules.cnd.modelimpl.csm.core.ParserThreadManager$Wrapper.run(ParserThreadManager.java:92)
	at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1454)
	at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2048)
org.netbeans.modules.cnd.modelimpl.debug.IllegalRepositoryStateException: Failed to get container sorage by key  TWICE FileDeclarationsKey (/usr/include/L/, /usr/include/X11/extensions/XShm.h)
	at org.netbeans.modules.cnd.modelimpl.debug.DiagnosticExceptoins.registerIllegalRepositoryStateException(DiagnosticExceptoins.java:96)
	at org.netbeans.modules.cnd.modelimpl.cache.impl.WeakContainer.getContainer(WeakContainer.java:99)
	at org.netbeans.modules.cnd.modelimpl.content.file.FileContent.getFileComponent(FileContent.java:385)
	at org.netbeans.modules.cnd.modelimpl.content.file.FileContent.getFileDeclarations(FileContent.java:346)
	at org.netbeans.modules.cnd.modelimpl.content.file.FileContent.getHardReferenceBasedCopy(FileContent.java:170)
	at org.netbeans.modules.cnd.modelimpl.csm.core.FileImpl$ParseDescriptor.<init>(FileImpl.java:993)
	at org.netbeans.modules.cnd.modelimpl.csm.core.FileImpl$ParseDescriptor.<init>(FileImpl.java:984)
	at org.netbeans.modules.cnd.modelimpl.csm.core.FileImpl.ensureParsed(FileImpl.java:555)
	at org.netbeans.modules.cnd.modelimpl.csm.core.ParserThread._run(ParserThread.java:149)
	at org.netbeans.modules.cnd.modelimpl.csm.core.ParserThread.run(ParserThread.java:75)
	at org.netbeans.modules.cnd.modelimpl.csm.core.ParserThreadManager$Wrapper.run(ParserThreadManager.java:92)
	at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1454)
	at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2048)
Comment 3 Alexander Simon 2013-07-01 06:42:18 UTC
NPE is a consequence of the fixing bug #220045.
Method LibraryManager.resolveFileProjectOnInclude() does not guarantee non null result.
Hence last lines of the method:
baseProject.prepareIncludeStorage(res);
should check result.

fixed, change set:
http://hg.netbeans.org/cnd-main/rev/9cf022082fd6
Comment 4 Quality Engineering 2013-07-02 02:14:23 UTC
Integrated into 'main-silver', will be available in build *201307012300* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/9cf022082fd6
User: Alexander Simon <alexvsimon@netbeans.org>
Log: fixed Bug #225150 NullPointerException at org.netbeans.modules.cnd.modelimpl.content.project.IncludedFileContainer.prepareIncludeStorage