Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 347546 - [model] role creation wizard leaks working copies
Summary: [model] role creation wizard leaks working copies
Status: VERIFIED FIXED
Alias: None
Product: Objectteams
Classification: Tools
Component: OTDT (show other bugs)
Version: 0.8   Edit
Hardware: PC Linux
: P2 major (vote)
Target Milestone: 2.0 RC3   Edit
Assignee: Stephan Herrmann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-28 11:47 EDT by Stephan Herrmann CLA
Modified: 2011-06-02 11:41 EDT (History)
0 users

See Also:


Attachments
Test harness and fix (4.90 KB, patch)
2011-05-28 11:57 EDT, Stephan Herrmann CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Stephan Herrmann CLA 2011-05-28 11:47:58 EDT
This issue manifested itself as regressions in otdt.ui.tests:
When running the full suite three tests in OTSubHierarchyContentProviderTests
failed. The failure could not be reproduced when running only the affected test.

First analysis showed the immediate cause of failure:
The hierarchy builder bailed out due to a single JavaModelException
(see bug 347408).

That JavaModelException was caused by a stale working copy returned by
JavaModelManager.getWorkingCopies(..) (the copy's project had already
been deleted).

It turned out that the stale working copy is a regression introduced by the
fix for bug 346163: Inside TypeCreator.createType(..) we now have one
path where two working copies are allocated but only one is discarded.
Comment 1 Stephan Herrmann CLA 2011-05-28 11:57:03 EDT
Created attachment 196830 [details]
Test harness and fix

The added test harness captures which test exactly was leaking the 
working copy.

The fix simply collects all created working copies in a list so all get discarded.
Comment 2 Stephan Herrmann CLA 2011-05-28 12:00:18 EDT
A leak is a bad thing to have, which could cause all different kinds of trouble 
and since this is a regression I'm releasing this patch for RC3.
Comment 3 Stephan Herrmann CLA 2011-06-02 11:41:38 EDT
Verified using build 201105311237:

- build failures never again happened.
- all fixes for bug 346163 and friends are still good.