Bug 480397 - Working copy enhancements
Summary: Working copy enhancements
Status: RESOLVED FIXED
Alias: None
Product: Handly
Classification: Technology
Component: Core (show other bugs)
Version: 0.4   Edit
Hardware: All All
: P3 normal
Target Milestone: 0.4   Edit
Assignee: Vladimir Piskarev CLA
QA Contact:
URL:
Whiteboard: breakingchange
Keywords: api
Depends on:
Blocks:
 
Reported: 2015-10-22 05:39 EDT by Vladimir Piskarev CLA
Modified: 2015-10-23 03:42 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Vladimir Piskarev CLA 2015-10-22 05:39:16 EDT
We need to support the following cases regarding working copies:

* A working copy can be opened for a non-existing source file. Hence, we should not attempt to open ancestor elements when a working copy is being opened (see #generateBodies) as some of its ancestors might not exist. See also bug 89411.

* A working copy may never be removed from the body cache. This needs to be properly enforced. Currently, we try to do that in SourceFile's override of Handle#close(), but HandleManager#removeBodyAndChildren recursively removes children without calling their close() method, so a working copy can still be (erroneously) removed from the cache if its ancestor is closed.

* JDT PackageFragment explicitly adds child working copies in its #buildStructure implementation. We should provide a new method HandleManager#getWorkingCopies() to allow for that.
Comment 1 Vladimir Piskarev CLA 2015-10-23 03:42:06 EDT
Pushed to master:
http://git.eclipse.org/c/handly/org.eclipse.handly.git/commit/?id=ffb5aa1b2da9aff3cb11fa808b100f936b0e0f6e


Note that a few breaking changes have been introduced:

* Handle#close() is final now. It delegates to the newly introduced #close(boolean) which is not final.

* Handle#getOpenableParent() is final now. It is a template method that calls the newly introduced #isOpenable() which is not final.

* SourceFile#shouldRebuildStructureIfForced() has moved into the inner class ReconcileOperation.