Bug 402360

Summary: Register the resourceChangeListener to ResourceChangeDispatcher with a phase when registering the listener with the Eclipse platform
Product: [Automotive] Sphinx Reporter: Yue Ma <mayue.mail>
Component: CoreAssignee: Project Inbox <sphinx-inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: balazs.grill, idydieng
Version: 0.7.0   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:
Bug Depends on: 397949    
Bug Blocks:    

Description Yue Ma CLA 2013-03-04 12:34:14 EST
The resource change listeners should register to the ResourceChangeDispatcher (bug#397949) with a phase (PRE, MAIN or POST) when registering with the Eclipse platform, that allows the dispatching of the resource change event to the registered listeners are not out of sequence. They are always dispatched in the sequence of PRE, MAIN, POST.

Pay attention to the phase that should be assigned to the resource change listener. Make sure that the resource change listener will be dispatched in a correct order.
Comment 1 Stephan Eberle CLA 2013-12-10 05:07:43 EST
The following existing resource change listeners in Sphinx should be refactored to be dispatched by the resource change dispatcher so that the mentioned workarounds can be removed:

* MetaModelDescriptorCacheUpdater
** Perform move/removal of metamodel descriptors in PRE phase
** Perform clearing of old metamodel descriptors in POST phase

* ModelDescriptorSynchronizer
** Perform in MAIN phase
** Remove removal of cached metamodel descriptors in BasicModelDescriptorSynchronizerDelegate.handleFileChanged(int, IFile) and BasicModelDescriptorSynchronizerDelegate.handleFileRemoved(int, IFile)
** Remove move of cached metamodel descriptors in BasicModelDescriptorSynchronizerDelegate.handleFileMoved(int, IFile, IFile)

* ModelSynchronizer
** Perform in MAIN phase
** Remove move of cached metamodel descriptors in BasicModelSynchronizerDelegate.handleFileMoved(int, IFile, IFile)

* ContentTypeIdCachePurger
** Perform in PRE phase
** Remove removal of cached content type ids in MetaModelDescriptorRegistry.FileMetaModelDescriptorCache.moveDescriptor(IFile, IFile) and MetaModelDescriptorRegistry.FileMetaModelDescriptorCache.removeDescriptor(IFile)

In addition, a similar mechanism as the resource change dispatcher should be introduced for resource set change listeners. This would enable to get rid of the removal of cached metamodel descriptors in ModelDescriptorSynchronizerComplement.handleModelResourceUnloaded(Collection<Resource>).
Comment 2 Balazs Grill CLA 2024-05-07 00:55:49 EDT
Closed stale issue before migration