Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 498045

Summary: Disposing a ContentBehavior results in java.util.ConcurrentModificationException
Product: [Tools] GEF Reporter: Tamas Miklossy <miklossy>
Component: GEF MVCAssignee: Alexander Nyßen <nyssen>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: nyssen
Version: 1.0.0   
Target Milestone: 4.1.0 (Neon.1) M1   
Hardware: All   
OS: All   
Whiteboard:
Bug Depends on: 496227    
Bug Blocks:    

Description Tamas Miklossy CLA 2016-07-18 05:29:10 EDT
While disposing a ContentBehavior the contentPartPool.getPooled() collection is iterated and modified at the same time, resulting in a java.util.ConcurrentModificationException.
Comment 1 Alexander Nyßen CLA 2016-07-18 06:01:15 EDT
This is related to the fix for bug #496227. As the ContentPartPool is centralized (a single instance is shared), no ContentBehavior may clear it (or dispose the contained parts). Instead, this needs to be done when disposing the viewer (to which it is scoped).
Comment 2 Alexander Nyßen CLA 2016-07-18 07:00:39 EDT
I pushed the following changes to origin/master and origin/R4_0_maintenance:

- Ensured the shared single ContentPartPool instance is disposed by AbstractViewer and not ContentBehavior.
- Made ContentModel, FocusModel, HoverModel, and SelectionModel disposable, so all visual parts are properly removed when the viewer is disposed.
- Ensured viewer disposes all its fields and detects whether the content part and visual part maps are not properly cleared.
- Fix AbstractLogoHoverHandlePart did not properly unregister.

Resolving as fixed in 4.1.0 M1.