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

Bug 345715

Summary: [implementation] AnnotationModel.fModificationStamp leaks annotations
Product: [Eclipse Project] Platform Reporter: Anton Leherbauer <aleherb+eclipse>
Component: TextAssignee: Dani Megert <daniel_megert>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: daniel_megert, markus.kell.r
Version: 3.7Flags: markus.kell.r: review+
Target Milestone: 3.7.1   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
Suggested fix daniel_megert: iplog+, daniel_megert: review+

Description Anton Leherbauer CLA 2011-05-13 07:02:01 EDT
AnnotationModel.fModificationStamp is assigned to the last AnnotationModelEvent instance and thus holds back references to annotations contained in the change (until the next event is created).  This is bad if an annotation itself contains references to "expensive" resources which would otherwise be garbage collected.
See also bug 331232 for such a case.

The fix should be simple and safe: Just assign a new Object() instead of the model event.
Comment 1 Anton Leherbauer CLA 2011-05-13 07:05:54 EDT
Created attachment 195579 [details]
Suggested fix
Comment 2 Markus Keller CLA 2011-05-13 11:23:09 EDT
Looks good, but we're already in RC2. Do you need this for 3.7 or is 3.8 good enough?
Comment 3 Anton Leherbauer CLA 2011-05-16 02:36:06 EDT
I guess 3.8 is sufficient.
Comment 4 Dani Megert CLA 2011-05-16 04:26:27 EDT
We could also put it in 3.7.1 if that helps.
Comment 5 Anton Leherbauer CLA 2011-05-16 04:30:17 EDT
(In reply to comment #4)
> We could also put it in 3.7.1 if that helps.

Yes, thanks, that would be even better.
Comment 6 Dani Megert CLA 2011-08-05 03:21:32 EDT
Comment on attachment 195579 [details]
Suggested fix

Committed to HEAD with the following update to the copyright header:

Anton Leherbauer <anton.leherbauer@windriver.com> - [implementation] AnnotationModel.fModificationStamp leaks annotations - http://bugs.eclipse.org/345715
Comment 7 Dani Megert CLA 2011-08-05 03:30:47 EDT
Fixed in R3_7_maintenance.
Comment 8 Dani Megert CLA 2011-08-11 03:05:51 EDT
Verified in M20110810-0800.