Bug 348396 - JEM needs to handle a flush better (redux)
Summary: JEM needs to handle a flush better (redux)
Status: RESOLVED FIXED
Alias: None
Product: WTP Java EE Tools
Classification: WebTools
Component: jst.jem (show other bugs)
Version: 1.5.5   Edit
Hardware: PC Windows XP
: P3 major (vote)
Target Milestone: 3.2.5   Edit
Assignee: Carl Anderson CLA
QA Contact: Chuck Bridgham CLA
URL:
Whiteboard:
Keywords:
Depends on: 343559 343562 348221
Blocks:
  Show dependency tree
 
Reported: 2011-06-06 10:07 EDT by Carl Anderson CLA
Modified: 2011-10-20 00:34 EDT (History)
0 users

See Also:
cbridgha: review+


Attachments
Protect JavaClass and MethodImpl after a flush occurs (2.30 KB, patch)
2011-06-06 15:16 EDT, Carl Anderson CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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