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 268318

Summary: NullPointerException at org.netbeans.modules.cnd.completion.cplusplus.ext.CsmCompletionQuery.getResolvedContext
Product: cnd Reporter: Exceptions Reporter <exceptions_reporter>
Component: Code CompletionAssignee: Vladimir Kvashin <vkvashin>
Status: VERIFIED FIXED    
Severity: normal CC: ashpynov
Priority: P3    
Version: 8.2   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter: 226544
Attachments: stacktrace

Description Exceptions Reporter 2016-10-03 10:25:30 UTC
Build: NetBeans IDE 8.2 RC (Build 201609140952)
VM: Java HotSpot(TM) 64-Bit Server VM, 25.102-b14, Java(TM) SE Runtime Environment, 1.8.0_102-b14
OS: Linux

User Comments:
GUEST: .




Stacktrace: 
java.lang.NullPointerException
   at org.netbeans.modules.cnd.completion.cplusplus.ext.CsmCompletionQuery.getResolvedContext(CsmCompletionQuery.java:859)
   at org.netbeans.modules.cnd.completion.cplusplus.ext.CsmCompletionQuery.performQueryTask(CsmCompletionQuery.java:411)
   at org.netbeans.modules.cnd.completion.cplusplus.ext.CsmCompletionQuery.queryObjects(CsmCompletionQuery.java:299)
   at org.netbeans.modules.cnd.completion.cplusplus.CsmExpressionResolverImpl.resolveObjects(CsmExpressionResolverImpl.java:64)
   at org.netbeans.modules.cnd.api.model.services.CsmExpressionResolver$Default.resolveObjects(CsmExpressionResolver.java:436)
   at org.netbeans.modules.cnd.api.model.services.CsmExpressionResolver.resolveObjects(CsmExpressionResolver.java:103)
Comment 1 Exceptions Reporter 2016-10-03 10:25:32 UTC
Created attachment 162315 [details]
stacktrace
Comment 2 Vladimir Kvashin 2016-10-11 08:52:38 UTC
Steps to reproduce: copy an LLVM34 project from perf-linux, open it, answer "no" on the proposal to consider .inc files as C++.

This should be already fixed in 28ab2964f78c at enum/release82
Although more investigation is needed to understand why this did not happen before.
Comment 3 Vladimir Kvashin 2016-10-11 11:06:20 UTC
In most places there were null checks for CompletionSupport.get() return; but in some places they were absent. I added null checks for all calls they were absent:
f650660afb55 (enum/release82).
Comment 4 Quality Engineering 2016-10-20 01:59:16 UTC
Integrated into 'main-silver', will be available in build *201610200002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/23a64f2af6b7
User: Vladimir Kvashin <vkvashin@netbeans.org>
Log: additional fix for #268318 - NullPointerException at org.netbeans.modules.cnd.completion.cplusplus.ext.CsmCompletionQuery.getResolvedContext
(transplanted from f650660afb55bf1d4be0115e908ec4dd9bca5b14)