Community
Participate
Working Groups
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.
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.
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.
Verified using build 201105311237: - build failures never again happened. - all fixes for bug 346163 and friends are still good.