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 257674

Summary: Assertion when #included namespace definition is removed
Product: cnd Reporter: Vladimir Voskresensky <vv159170>
Component: Code ModelAssignee: Vladimir Voskresensky <vv159170>
Status: NEW ---    
Severity: normal    
Priority: P3    
Version: 8.1   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:
Bug Depends on: 257559    
Bug Blocks:    

Description Vladimir Voskresensky 2016-01-22 10:44:16 UTC
see the bug https://netbeans.org/bugzilla/show_bug.cgi?id=257559
Comment 1 Vladimir Voskresensky 2016-01-22 11:01:30 UTC
See the project attached to the https://netbeans.org/bugzilla/show_bug.cgi?id=257559
run with one thread. Probably sorted is needed as well (-J-Dcnd.model.parse.sorted=true)

The problem is with the UID returned by NamespaceDefinitionImpl - now it doesn't contain FQN of associated NamespaceImpl, only own name and own location in file, i.e.
shared.h:
namespace name {
}


So, when the same file is included from two other files like
file1:

namespace A {
#include "shared.h"
}

file2:
#include "shared.h"

NamespaceDefinitionImpl "name" exists in two instances each belongs to own NamespaceImpl:
<Global>::name and A::name
but UID is the same (doesn't contain FQN of it's NS)
so during Repository.put
both NamespaceDefinitionImpl are merged into one, so their internal fields like
declarations, namespaceRef and namespaceUID are lost at least for one of them