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 219272 - The project is re-parsed despite the existing "relocatable" code model
Summary: The project is re-parsed despite the existing "relocatable" code model
Status: VERIFIED FIXED
Alias: None
Product: cnd
Classification: Unclassified
Component: Code Model (show other bugs)
Version: 7.3
Hardware: PC All
: P2 normal (vote)
Assignee: Vladimir Kvashin
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-10-01 14:21 UTC by Alexander Pepin
Modified: 2012-12-29 12:33 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
test project (60.00 KB, application/octet-stream)
2012-10-01 14:21 UTC, Alexander Pepin
Details
Recent project used in tests (the first one was spoiled) (60.00 KB, application/octet-stream)
2012-12-21 11:54 UTC, Vladimir Kvashin
Details
proposed fix (13.01 KB, patch)
2012-12-27 19:18 UTC, Vladimir Kvashin
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Pepin 2012-10-01 14:21:13 UTC
Created attachment 125157 [details]
test project

The newly created relocatable code model test fails.

Steps performed by test:
Steps to reproduce:
- untar the attached project
- set code model cache by defining cache.location=nbproject/cache in
project.properties file
- open RelocatableProject_application (resolve reference problems if it's
needed)
- close the project
- untar the attached project to a new location
- copy project.properties and cache directory to nbproject directory of the
newly created project
- open newly created project
Results: Test fails as the project was re-parsed. 129 fileParsingStarted events were received between projectParsingStarted and projectParsingFinished. The projectLoaded event never comes.
Comment 1 Vladimir Kvashin 2012-12-21 11:54:37 UTC
Created attachment 129617 [details]
Recent project used in tests (the first one was spoiled)
Comment 2 Vladimir Kvashin 2012-12-21 11:55:05 UTC
I was finally able to reproduce this with the project I've just attached
Comment 3 Vladimir Kvashin 2012-12-27 19:10:05 UTC
The root cause is: global units index is not stored until IDE is not closed.So the workaround is: copy cache only after you close the IDE.The fix might be as simple as storing units index upon each unit (project) closure. But this requires additional synchronization, otherwise we can get a ConcurrentModificationException. I need code review for this. The attached patch tries to minimize locking. Alternative could be to use a single lock for units opens/closures
Comment 4 Vladimir Kvashin 2012-12-27 19:18:23 UTC
Created attachment 129727 [details]
proposed fix
Comment 5 Vladimir Kvashin 2012-12-28 17:24:00 UTC
fixed in cnd-main
http://hg.netbeans.org/cnd-main/rev/711ab6ca9f12
Comment 6 Quality Engineering 2012-12-29 02:26:33 UTC
Integrated into 'main-golden', will be available in build *201212290001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/711ab6ca9f12
User: Vladimir Kvashin <vkvashin@netbeans.org>
Log: fixed #219272 - The project is re-parsed despite the existing "relocatable" code model
Comment 7 Alexander Pepin 2012-12-29 12:33:37 UTC
verified in build *201212290001*, the automatic test passed.