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

Bug 351599

Summary: ConcurrentModificationException on faceted project creation
Product: [WebTools] WTP Common Tools Reporter: Carl Anderson <ccc>
Component: wst.commonAssignee: Carl Anderson <ccc>
Status: NEW --- QA Contact: Carl Anderson <ccc>
Severity: normal    
Priority: P3 CC: kevintap
Version: 3.0.4   
Target Milestone: 3.0.5 P   
Hardware: PC   
OS: Linux   
Whiteboard:
Bug Depends on: 330874    
Bug Blocks:    
Attachments:
Description Flags
Backport the fix to R3_0_5_patches none

Description Carl Anderson CLA 2011-07-08 13:04:41 EDT
An adopter has encountered this problem in WTP 3.0.5, and desires this fix to be backported.

+++ This bug was initially created as a clone of Bug #330874 +++

Build Identifier: M20100211-1343

We have a custom project facet that we add on top of the wst web facet.  Our facet adds a considerable number of files to the project.  During the completion of our facet installation, the facet framework calls broadcastPostChange() which proceeds to process all of the resources added to the project.  We usually encounter a ConcurrentModificationException during this processing as another worker/job thread attempts to modify the ProjectResourceSetImpl$SynchronizedResourcesEList collection at the same time.  I am attaching a pair of stack traces from the debugger showing the offending threads.

Reproducible: Sometimes

Steps to Reproduce:
1. Create a new project facet that adds a considerable number of files to the project.
2. Write a wizard that creates a new project and adds the wst web facet and then this new facet to the new project.
3. Wait for the ConcurrentModificationException - we encounter this about 80-90% of the time.
Comment 1 Carl Anderson CLA 2011-07-08 13:06:37 EDT
Created attachment 199354 [details]
Backport the fix to R3_0_5_patches