Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 312596 - Sync view does not update error decorator of resources anymore
Summary: Sync view does not update error decorator of resources anymore
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Team (show other bugs)
Version: 3.6   Edit
Hardware: PC All
: P3 major (vote)
Target Milestone: 3.6 RC3   Edit
Assignee: Tomasz Zarna CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-12 08:01 EDT by Ulli Hafner CLA
Modified: 2010-05-27 06:03 EDT (History)
6 users (show)

See Also:
pawel.pogorzelski1: review+
Szymon.Brandys: review+
remy.suen: review+


Attachments
Wrong error decorator in sync view (118.10 KB, image/png)
2010-05-12 08:03 EDT, Ulli Hafner CLA
no flags Details
Fix A v01 (3.75 KB, patch)
2010-05-13 12:13 EDT, Tomasz Zarna CLA
no flags Details | Diff
mylyn/context/zip (205.33 KB, application/octet-stream)
2010-05-13 12:13 EDT, Tomasz Zarna CLA
no flags Details
Fix B v01 (3.41 KB, patch)
2010-05-13 12:14 EDT, Tomasz Zarna CLA
no flags Details | Diff
Fix A v02 (3.84 KB, patch)
2010-05-25 05:16 EDT, Tomasz Zarna CLA
no flags Details | Diff
Fix A v03 (2.93 KB, patch)
2010-05-26 07:00 EDT, Tomasz Zarna CLA
no flags Details | Diff
Fix A v04 (2.95 KB, patch)
2010-05-26 07:37 EDT, Tomasz Zarna CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ulli Hafner CLA 2010-05-12 08:01:22 EDT
Build ID: I20100429-1549

When I synchronize resources that contain compile errors, then the error decorator will be shown in the sync view. However, if I fix the error and save the file, then the sync view does not update its decorator for the resource.

Steps to reproduce:
1. Produce a compile error in file and save
2. Synchronize your workspace
3. Sync view shows the modified resource with error decorator
4. Open editor, fix error and save
5. Error decorator in package explorer and editor disappears
6. Error decorator in sync view stays

See screenshot.
Comment 1 Ulli Hafner CLA 2010-05-12 08:03:40 EDT
Created attachment 168124 [details]
Wrong error decorator in sync view
Comment 2 Tomasz Zarna CLA 2010-05-12 09:56:38 EDT
This is caused by a faulty fix in bug 291492. I'll give it a shot this week.
Comment 3 Tomasz Zarna CLA 2010-05-13 12:13:30 EDT
Created attachment 168405 [details]
Fix A v01
Comment 4 Tomasz Zarna CLA 2010-05-13 12:13:36 EDT
Created attachment 168406 [details]
mylyn/context/zip
Comment 5 Tomasz Zarna CLA 2010-05-13 12:14:29 EDT
Created attachment 168407 [details]
Fix B v01
Comment 6 Tomasz Zarna CLA 2010-05-13 12:22:32 EDT
In fix B, when a DecoratingStyledCellLabelProvider is encountered we handle it in a similar way we did with DecoratingLabelProvider. The only difference is that we need to translate IStyledLabelProvider to ILabelProvider (see CommonViewerAdvisor.toLabelProvider(IStyledLabelProvider) method). In fix A we stick to DecoratingStyledCellLabelProvider (we replace it with DecoratingLabelProvider in fix B), but to do so we need a new class that extends DecoratingLabelProvider and implements IStyledLabelProvider at the same time (see DecoratingLabelProvider2).

With both patches applied I'm still able to observe a situation when the error decorator is not reset correctly, but this happens occasionally.

These are quick fixes, prepared to illustrate possible solutions. Do not commit.
Comment 7 Tomasz Zarna CLA 2010-05-19 06:47:04 EDT
Prakash could you please take a look at the patches (at least at Fix A, as it seems to be a better approach)? I'm feeling kind of lost in the label providers jungle, and I would be very happy if you could comment whether the suggested fixes are any good. Or could you point to someone who could help.
Comment 8 Tomasz Zarna CLA 2010-05-19 06:50:14 EDT
(In reply to comment #7)
> Or could you point to someone who could help.

I remember that Boris was able to give valuable tips having just a glimpse at the code.
Comment 9 Tomasz Zarna CLA 2010-05-24 05:53:16 EDT
As a *workaround* you could re-sync (removing the current synchronization first) or simply switch to a different mode (eg from Outgoing Mode to Incoming Mode) and then switch back to the mode you started with.
Comment 10 Tomasz Zarna CLA 2010-05-24 06:22:43 EDT
It would be great to have this fixed in 3.6, but at the current stage we will need two committers and a component lead to accept the change. Since I'm not sure if the way I manipulate label providers is correct, I'm setting two reviewers from the UI team. Guys, if you have any doubts about the fix please let me know and I will try to prepare a better one for 3.6 or postpone it until 3.7.
Comment 11 Tomasz Zarna CLA 2010-05-25 05:16:39 EDT
Created attachment 169790 [details]
Fix A v02

Added check if IStyledLabelProvider passed to the nested label provider is not, by any chance an instance of ILabelProvider. Suggested by Prakash.
Comment 12 Tomasz Zarna CLA 2010-05-26 04:57:17 EDT
Apparently Boris is too busy right now, Pawel could you review the latest patch?
Comment 13 Pawel Pogorzelski CLA 2010-05-26 06:26:14 EDT
The latest patch causes labels are no longer styled. The easiest way to observe it is to have an outgoing change in Synchronize view and select update on the project.
Comment 14 Tomasz Zarna CLA 2010-05-26 07:00:25 EDT
Created attachment 169967 [details]
Fix A v03
Comment 15 Tomasz Zarna CLA 2010-05-26 07:01:53 EDT
(In reply to comment #13)
> The latest patch causes labels are no longer styled. 

Good catch! It's fixed in the latest patch. Could you give it a second chance?
Comment 16 Pawel Pogorzelski CLA 2010-05-26 07:13:32 EDT
(In reply to comment #15)
> Could you give it a second chance?

Looks good.
Comment 17 Tomasz Zarna CLA 2010-05-26 07:37:46 EDT
Created attachment 169971 [details]
Fix A v04

Missed the decoration context. Thanks Remy!
Comment 18 Remy Suen CLA 2010-05-26 07:55:54 EDT
I would have been against fixing this so late in the cycle but seeing that it
was a regression introduced in M3, I think it is worth fixing.
Comment 19 Remy Suen CLA 2010-05-26 07:56:09 EDT
Whoops.
Comment 20 Tomasz Zarna CLA 2010-05-26 08:03:00 EDT
Guys could you review the latest patch?
Comment 21 Pawel Pogorzelski CLA 2010-05-26 08:06:07 EDT
(In reply to comment #20)

It's a distracting regression, +1 for RC3.
Comment 22 Tomasz Zarna CLA 2010-05-27 06:03:01 EDT
Applied to HEAD, available in builds I20100527-0800.

Filled bug 314629 for change sets decoration issue spotted by Remy (not related to this issue since it happens in 3.6M1 as well) and bug 314435 which is basically a question why DelegatingStyledCellLabelProvider does not implement IFontProvider.

Thank you to all reviewers... and the academy ;)