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 243650 - Massive reparse if clean&build removes then regenerates headers
Summary: Massive reparse if clean&build removes then regenerates headers
Status: RESOLVED FIXED
Alias: None
Product: cnd
Classification: Unclassified
Component: Code Model (show other bugs)
Version: 8.0
Hardware: All All
: P3 normal (vote)
Assignee: Vladimir Kvashin
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-04-08 10:46 UTC by Vladimir Kvashin
Modified: 2014-06-07 09:54 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
test project (21.74 KB, application/zip)
2014-04-08 10:46 UTC, Vladimir Kvashin
Details
proposed patch (should be reviewed and polished) (169.76 KB, patch)
2014-04-12 20:33 UTC, Vladimir Kvashin
Details | Diff
proposed patch (should be reviewed and polished) - the previous one erroneously included hs_err file (102.09 KB, patch)
2014-04-12 20:36 UTC, Vladimir Kvashin
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Vladimir Kvashin 2014-04-08 10:46:15 UTC
Created attachment 146621 [details]
test project

In the attachecd project, "generated.h" file is regenerated during build (removed on clean, then generated again before build).

This causes parsing of most files in the project - although regenerated header content is the same. This is incorrect.
Comment 1 Vladimir Kvashin 2014-04-09 09:14:34 UTC
Investigation shows that events processing is rather complicated.
For now it is as follows:

*** Event sources (classes that fire events) are four:
- CndIndexer (1 instance)
- NativeProjectListener (an instance per project)
- FileChangeListener (1 instance)
- NativeProjectRegistry (1 instance)

*** Events, threads and Request Processors (RPs)

Code model owns a single static 1-thread RP called Model RP

** NativeProjectRegistry (1 global instance)
  - closes projects in the same thread it's caled (MakeProject.RP - 1-thread RP per project)
  - opens projects in its own static 1-thread RP

** CndIndexer (1 global instance)	
Calls
  ProjectBase.checkForRemoved in Model RP
  ProjectBase.onFileImplExternalChange in Model RP
  ProjectBase.onFileObjectExternalCreate in Model RP

** SuspendableFileChangeListener (1 global instance) 

Wraps ExternalUpdateListener,
folds remove-create events,
calls ExternalUpdateListener
in its own 1-thread RP

** ExternalUpdateListener (1 global instance)

Also folds remove-create events 
Calls
  ProjectBase.checkForRemoved in Model RP
  ProjectBase.onFileImplExternalChange in Model RP	
  ProjectBase.onFileObjectExternalCreate in Model RP	


** NativeProjectListenerImpl (instance per project)
Calls
  RepositoryUtils.onProjectDeleted in RequestProcessor.getDefault()
  ProjectBase.onFileItemsAdded in Model RP	
  ProjectBase.onFileItemsRemoved in Model RP	
  ProjectBase.onFileItemRenamed in Model RP	
  ProjectBase.onFileItemsPropertyChanged in Model RP
Comment 2 Vladimir Kvashin 2014-04-12 20:33:22 UTC
Created attachment 146714 [details]
proposed patch (should be reviewed and polished)
Comment 3 Vladimir Kvashin 2014-04-12 20:36:52 UTC
Created attachment 146715 [details]
proposed patch (should be reviewed and polished) - the previous one erroneously included hs_err file
Comment 4 Vladimir Kvashin 2014-04-14 07:14:33 UTC
Pushed changes into cnd-main; to restore old behaviour use -J-Dcnd.model.merge.events=false (TraceFlags.MERGE_EVENTS)
http://hg.netbeans.org/cnd-main/rev/b45362ca9870
Comment 5 Vladimir Kvashin 2014-04-14 10:09:19 UTC
http://hg.netbeans.org/cnd-main/rev/f16d3dc96362
Comment 7 Vladimir Kvashin 2014-04-16 16:38:02 UTC
One more fix after review with AS
http://hg.netbeans.org/cnd-main/rev/b3cc9c184ae5
Comment 8 Quality Engineering 2014-04-18 02:40:58 UTC
Integrated into 'main-silver', will be available in build *201404180001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/b45362ca9870
User: Vladimir Kvashin <vkvashin@netbeans.org>
Log: fixing #243650 - Massive reparse if clean&build removes then regenerates headers
Comment 9 Quality Engineering 2014-04-24 02:03:37 UTC
Integrated into 'releases/release80', will be available in build *201404240045* or newer. Wait for official and publicly available build.

Changeset: http://hg.netbeans.org/releases/rev/4afc0de46f6a
User: Vladimir Kvashin <vkvashin@netbeans.org>
Log: fixing #243650 - Massive reparse if clean&build removes then regenerates headers
(transplanted from b45362ca987064bed7b29c591f09645b1fc9147c)