Bug 417727 - Template View out of sync with Template Preferences
Summary: Template View out of sync with Template Preferences
Status: CLOSED WORKSFORME
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.3   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: needinfo
Depends on:
Blocks:
 
Reported: 2013-09-20 17:06 EDT by Tod CLA
Modified: 2013-09-30 10:43 EDT (History)
2 users (show)

See Also:


Attachments
Screen shot showing differing versions of template in Kepler. (208.92 KB, image/png)
2013-09-20 17:06 EDT, Tod CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tod CLA 2013-09-20 17:06:19 EDT
Created attachment 235676 [details]
Screen shot showing differing versions of template in Kepler.

When editing repeatedly in the Template View (clicking on the pencil icon) eventually the edits appear to fail to sync with the "real" template. If I navigate to the Preferences view of templates the template stored there differs from the one loaded in the template view. Attached is a screen shot showing the two view simultaneously in Kepler. 

I also created an unlisted youtube video that shows the problem in detail (although this demo is in Juno - I was able to duplicate the bug in Kepler), it can be found at  

http://youtu.be/amq9OPDPdZ4

I am not able to repeat this at will. You can make quite a few edits and it works correctly then all of sudden I'll notice my template is "stalled". 

This was in a CDT version of Eclipse. I haven't tried to duplicate it in a JDT version yet.
Comment 1 Noopur Gupta CLA 2013-09-24 04:49:04 EDT
I am not able to reproduce the issue in Eclipse 4.4 (I20130916-0900) JDT (as shown in your video) by editing the template multiple times in Templates view.

It would help if you could attach an example and the exact steps which reproduce the issue.
Comment 2 Tod CLA 2013-09-24 15:34:13 EDT
I can't really provide repeatable steps. It takes a while to happen and I have yet to discern what triggers the disconnect. Here's a little more detail (but I don't think it's very helpful).

For a week or so I've been working on a section of a course explaining templates. I work all day writing templates, testing, editing etc. I mostly work solely in the template view (as opposed to the preferences view). Eventually this bug creeps up but I can't give you exact steps, other than I'm just repeating the steps over and over. I edit many times and create new templates. When I was done I had only added about 14 templates so it's not a huge number. All told over the week I saw the bug three times so far. 

Once the problem happens it is as if the template view is completely disconnected. No matter how many times you edit the template from that view it will never update. That is, when you run the template it doesn't show your changes. When you go back to edit it in template view it does show your changes. When you go to edit it in preferences view it shows the last "connected" edit that worked. There has to be some kind of denormalization going on here, the text for the template is obviously stored in two places. 

Once the problem happens the only way I have found to "fix" the problem is to use the preferences editor view. The other thing that is interesting is to try this:
1. Create or modify a template in template view and leave that view visible so you can see the preview. A template of a simple comment will work
2. Run the template
3. Go to preferences view and modify the template
4. Run the newly modified template.
5. All should work as expected, look at the preview, notice the preview is out of synch (this is not a problem in my opinion)
6. Click on the template in the template view (the preview will update to show the newly edited version)

The only reason I find this interesting is this is NOT what happens when the problem occurs. If you watch the video you'll notice that when things get out of synch and you modify the template in the preferences editor the preview of the template in the template view automatically closes. When you next open that template it has the value as updated in the preferences view. Just thought it might be a clue to someone who knows the inner workings. 

Sorry I can't be more help.
Comment 3 Noopur Gupta CLA 2013-09-30 10:43:22 EDT
The issue could not be reproduced with the given information.
Marking as WORKSFORME until more information is present to reproduce it in JDT with the latest Kepler build.