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 254053

Summary: [newcodemodel] AssertionError: referenced macro is null. ref [278,281] file=KeyBasedUID on FileKey (/home/toddb/src/srcapp/omneon/tap/tap8/tap8.nb/N/, /home/toddb/src/srcapp/omneon/codecs/generic/mc-codec.cc);refKin
Product: cnd Reporter: tbrunhoff <tbrunhoff>
Component: Code CompletionAssignee: Alexander Simon <alexvsimon>
Status: RESOLVED FIXED    
Severity: normal CC: GenKabuki, soldatov, tbrunhoff
Priority: P1    
Version: 8.1   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter: 218909
Attachments: stacktrace
stacktrace
stacktrace
stacktrace
project
stacktrace

Description tbrunhoff 2015-08-01 15:45:29 UTC
Build: NetBeans IDE Dev (Build nbms-and-javadoc-180-on-20150731)
VM: Java HotSpot(TM) 64-Bit Server VM, 25.45-b02, Java(TM) SE Runtime Environment, 1.8.0_45-b14
OS: Linux

User Comments:
tbrunhoff: doing a build, I think.




Stacktrace: 
java.lang.AssertionError: referenced macro is null. ref [278,281] file=KeyBasedUID on FileKey (/home/toddb/src/srcapp/omneon/tap/tap8/tap8.nb/N/, /home/toddb/src/srcapp/omneon/codecs/generic/mc-codec.cc);refKind=DIRECT_USAGE;refObj=KeyBasedUID on MacroKey: MQX[M 0-0] {/home/toddb/src/srcapp/omneon/codecs/generic/mc-codec.cc; /home/toddb/src/srcapp/omneon/tap/tap8/tap8.nb/N/};topUID=KeyBasedUID on FileKey (/home/toddb/src/srcapp/omneon/tap/tap8/tap8.nb/N/, /home/toddb/src/srcapp/omneon/codecs/generic/mc-codec.cc);ownerUID=null}, file PARSED FileImpl @130462360:420779829 /home/toddb/src/srcapp/omneon/codecs/generic/mc-codec.cc prj:1521801426KeyBasedUID on ProjectKey /home/toddb/src/srcapp/omneon/tap/tap8/tap8.nb/N/ NOT_BEING_PARSED, name 
   at org.netbeans.modules.cnd.completion.impl.xref.ReferencesSupport.findMacro(ReferencesSupport.java:706)
   at org.netbeans.modules.cnd.completion.impl.xref.ReferencesSupport.findDeclaration(ReferencesSupport.java:295)
   at org.netbeans.modules.cnd.completion.impl.xref.ReferencesSupport.findReferencedObject(ReferencesSupport.java:227)
   at org.netbeans.modules.cnd.completion.impl.xref.ReferenceImpl.getReferencedObjectImpl(ReferenceImpl.java:134)
   at org.netbeans.modules.cnd.completion.impl.xref.ReferenceImpl.getReferencedObject(ReferenceImpl.java:96)
   at org.netbeans.modules.cnd.highlight.semantic.ModelUtils$FieldReferenceCollector.visit(ModelUtils.java:146)
Comment 1 tbrunhoff 2015-08-01 15:45:32 UTC
Created attachment 155108 [details]
stacktrace
Comment 2 tbrunhoff 2015-08-01 23:54:16 UTC
Created attachment 155115 [details]
stacktrace

clicking on an edit window
Comment 3 tbrunhoff 2015-08-01 23:57:12 UTC
Created attachment 155116 [details]
stacktrace

searching text
Comment 4 soldatov 2015-08-10 09:20:39 UTC
Created attachment 155243 [details]
stacktrace

open, edit, close and open C++ file again
Comment 5 soldatov 2015-08-10 09:28:18 UTC
==================================
#include "function.h"

int main() {
  func3(AAA);
  return(0);
}

int func3(int x) {
    return x * x;
}
==================================
#ifndef _function_H
#define	_function_H

int func3(int);

#endif
==================================
CXX=g++
CXXFLAGS=-g3 -gdwarf-2

function1: function.cc
	$(CXX) $(CXXFLAGS) -DAAA=5 -o function1 function.cc

clean:
	rm -f function1
==================================

Scenario:
- Open configured project
- Open function.cc
==> AAA is unresolved identifier
- Reparse project (Code Assistance|Reparse Project menu item)
==> exception
Comment 6 soldatov 2015-08-10 09:30:54 UTC
Created attachment 155244 [details]
project
Comment 7 soldatov 2015-08-12 13:18:28 UTC
Created attachment 155293 [details]
stacktrace

edit c++ file, jump to header file, close header file
Comment 8 Vladimir Voskresensky 2015-08-14 13:01:40 UTC
*** Bug 254135 has been marked as a duplicate of this bug. ***
Comment 9 Alexander Simon 2015-08-16 20:55:37 UTC
It is a regression after fixing bug #253964
Comment 10 Alexander Simon 2015-08-19 13:36:29 UTC
fixed, change set:
http://hg.netbeans.org/cnd-main/rev/73c7eb5ea7af
Comment 11 Quality Engineering 2015-08-20 01:27:54 UTC
Integrated into 'main-silver', will be available in build *201508200002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/73c7eb5ea7af
User: Alexander Simon <alexvsimon@netbeans.org>
Log: fixed Bug #254053 [newcodemodel] AssertionError: referenced macro is null.