Bug 32639 - Missing empty fine-grain delta when reconciling
Summary: Missing empty fine-grain delta when reconciling
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.1   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: 3.0 M4   Edit
Assignee: Jerome Lanneluc CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 44290 (view as bug list)
Depends on:
Blocks:
 
Reported: 2003-02-24 08:07 EST by Philipe Mulet CLA
Modified: 2003-10-13 07:33 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Philipe Mulet CLA 2003-02-24 08:07:23 EST
Build 2.1RC1

Consider following unit in default package, opened in Java editor
public class X {
}

When working copy X is modified to add a field, a fine-grain delta is issued 
(field addition)

public class X {
  int i;
}

Save editor.
However, when a comment is added anywhere, no notification is sent:

public class X {
  int i; // some comment
}

If saving the editor contents, an empty fine grain compilation unit delta is 
notified though. This is somewhat inconsistent.
Comment 1 Philipe Mulet CLA 2003-02-24 08:08:35 EST
In the trace, also the kind of the empty fine-grain delta wasn't set ([?]).
Comment 2 Philipe Mulet CLA 2003-02-24 08:10:01 EST
Unclear we want to take action at this stage, since clients may rely on this 
behavior (optimization for reconcilers ? no delta means no refresh ?).

Dirk, can you please comment about your expectations if we did notify an empty 
fine grain delta in reconciler ?
Comment 3 Dirk Baeumer CLA 2003-02-24 13:53:25 EST
I my opinion sending out empty fine grained deltas should not cause any harm to 
JDT/UI. We are getting deltas when editing a Java file anyway. So getting one 
when the user adds a comment should not end in a performance problem.

If an empty delta is sent out in this case I would expect a special flag. On a 
content changed I would assume that some major changes have happend to the CU 
and that we have to refresh the whole UI for this element.
Comment 4 Jerome Lanneluc CLA 2003-02-25 06:25:13 EST
We usually use the F_FINE_GRAINED flag in conjunction with the F_CONTENT flag 
to determine if major changes have happened (see 
AllTypesCache.TypeCacheDeltaListener.isPossibleStructuralChange(int))

Would it be possible for the JavaOutlineViewer to use the same technique? In 
this case, we would notify a F_CONTENT | F_FINE_GRAINED delta on the working 
copy during reconcile as we do on the cu when it is saved.
Comment 5 Jerome Lanneluc CLA 2003-02-25 07:08:11 EST
Entered bug 32937 for problem of kind not set for empty fine-grained delta.
Comment 6 Philipe Mulet CLA 2003-02-25 07:55:22 EST
Deferring, since changing this behavior at this point is quite dangerous.

Considering as enhancement for 2.2, since outliners could take advantage of 
notifications of no structural change, where actual file content did change 
(spaces added, format change, comment change) so as to react.
Comment 7 Jerome Lanneluc CLA 2003-02-28 12:16:19 EST
Consider for 2.2.
Comment 8 Philipe Mulet CLA 2003-04-02 06:41:35 EST
reopen
Comment 9 Philipe Mulet CLA 2003-09-03 03:16:45 EDT
As a consequence of fix for bug 40782, I suspect no delta will be issued 
anylonger revealing any inconsistency...
Comment 10 Jerome Lanneluc CLA 2003-10-07 12:48:59 EDT
*** Bug 44290 has been marked as a duplicate of this bug. ***
Comment 11 Jerome Lanneluc CLA 2003-10-07 13:19:37 EDT
Now firing a F_CONTENTS | F_FINE_GRAINED delta when a non-structural change 
occurs.
Comment 12 David Audel CLA 2003-10-13 07:33:06 EDT
Verified.