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.
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.
Created attachment 129617 [details] Recent project used in tests (the first one was spoiled)
I was finally able to reproduce this with the project I've just attached
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
Created attachment 129727 [details] proposed fix
fixed in cnd-main http://hg.netbeans.org/cnd-main/rev/711ab6ca9f12
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
verified in build *201212290001*, the automatic test passed.