Bug 40028 - Deltas and deleted working copies
Summary: Deltas and deleted working copies
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows XP
: P3 critical (vote)
Target Milestone: 3.0 M2   Edit
Assignee: Jerome Lanneluc CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-07-14 11:08 EDT by Dirk Baeumer CLA
Modified: 2003-07-16 04:12 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 Dirk Baeumer CLA 2003-07-14 11:08:51 EDT
I20030710

The Java element delta still informs clients about deleted working copies. Due 
to the handle stability the destroyed working copy unit passed around in the 
delta answer false for unit.isWorkingCopy(). Hence the listener things a 
original was destroyed and in the affected case flushes the undo stack.

The question is: how do I now find out if a working copy got destroyed. Do I 
have to check the owner ? Do we need some additional delta describing the 
state change to and from a working copy ?
Comment 1 Philipe Mulet CLA 2003-07-14 11:31:13 EDT
Good find. Indeed, this is a problem. Adding/deleting primary working copies 
shouldn't be notified as added/remove deltas, but rather changed with some flag.
Or something in the same spirit.

However, this would be somewhat inconsistent with other working copies, which 
isn't very nice.
Comment 2 Jerome Lanneluc CLA 2003-07-15 05:01:45 EDT
Added flag IJavaElementDelta.F_PRIMARY_WORKING_COPY. When a primary compilation 
unit becomes a working copy, the delta is no longer an added delta but a change 
delta with this flag. Symetrically, when a primary working copy is discarded 
and becomes a compilation unit, the delta is no longer a remove delta but a 
change delta with this flag.
Comment 3 David Audel CLA 2003-07-16 04:12:53 EDT
Verified.