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 - Assertion when #included namespace definition is removed
Summary: Assertion when #included namespace definition is removed
Status: NEW
Alias: None
Product: cnd
Classification: Unclassified
Component: Code Model (show other bugs)
Version: 8.1
Hardware: All All
: P3 normal (vote)
Assignee: Vladimir Voskresensky
URL:
Keywords:
Depends on: 257559
Blocks:
  Show dependency tree
 
Reported: 2016-01-22 10:44 UTC by Vladimir Voskresensky
Modified: 2016-10-31 11:30 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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