Community
Participate
Working Groups
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.
In the trace, also the kind of the empty fine-grain delta wasn't set ([?]).
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 ?
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.
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.
Entered bug 32937 for problem of kind not set for empty fine-grained delta.
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.
Consider for 2.2.
reopen
As a consequence of fix for bug 40782, I suspect no delta will be issued anylonger revealing any inconsistency...
*** Bug 44290 has been marked as a duplicate of this bug. ***
Now firing a F_CONTENTS | F_FINE_GRAINED delta when a non-structural change occurs.
Verified.