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

Bug 348396

Summary: JEM needs to handle a flush better (redux)
Product: [WebTools] WTP Java EE Tools Reporter: Carl Anderson <ccc>
Component: jst.jemAssignee: Carl Anderson <ccc>
Status: RESOLVED FIXED QA Contact: Chuck Bridgham <cbridgha>
Severity: major    
Priority: P3 Flags: cbridgha: review+
Version: 1.5.5   
Target Milestone: 3.2.5   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Bug Depends on: 343559, 343562, 348221    
Bug Blocks:    
Attachments:
Description Flags
Protect JavaClass and MethodImpl after a flush occurs none

Description Carl Anderson CLA 2011-06-06 10:07:59 EDT
The same fixes that were rolled into 3.0.5 P need to be rolled into 3.2.5, 3.3.1, and 3.4.

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

Continued work on bug 343558 yielded one other set of fixes - the iteration at the beginning of JavaClassImpl.collectMethodsExtended() needs to be moved to a copy of the array to avoid a ConcurrentModificationException, and MethodImpl.getReturnType() needs to have the same sort of guard as was added for its parent.

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

We need to get this fix into WTP 3.0.5 P, too.

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

Currently, if JEM is gathering (or has gathered) the Methods from a (JEM) JavaClass, and a flush() occurs, the Methods are removed from their parents and are invalid, resulting in NPEs and other errors without any warning.

There are things we can do, such as replacing the parent JavaClass with a JavaClassRef, that will at least keep the current Methods useful, while still allowing the flush to proceed.
Comment 1 Carl Anderson CLA 2011-06-06 15:16:53 EDT
Created attachment 197448 [details]
Protect JavaClass and MethodImpl after a flush occurs
Comment 2 Chuck Bridgham CLA 2011-06-10 10:54:13 EDT
approved
Comment 3 Carl Anderson CLA 2011-09-14 23:40:54 EDT
This was committed to R3_2_maintenance on June 13 for WTP 3.2.5
Comment 4 Carl Anderson CLA 2011-10-20 00:34:01 EDT
Committed to R3_3_maintenance and HEAD for WTP 3.3.2 and WTP 3.4.0 M3