Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 356331 - Editor remains dirty after save
Summary: Editor remains dirty after save
Status: RESOLVED FIXED
Alias: None
Product: Dali JPA Tools
Classification: WebTools
Component: Diagram Editor (show other bugs)
Version: 3.0   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 3.0.1   Edit
Assignee: Stefan Dimov CLA
QA Contact: Stefan Dimov CLA
URL:
Whiteboard: PMC_approved
Keywords:
: 325442 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-08-31 09:51 EDT by Stefan Dimov CLA
Modified: 2011-09-13 10:53 EDT (History)
3 users (show)

See Also:
stefan.dimov: indigo+
stefan.dimov: juno+
stefan.dimov: pmc_approved? (david_williams)
stefan.dimov: pmc_approved? (raghunathan.srinivasan)
stefan.dimov: pmc_approved? (naci.dai)
stefan.dimov: pmc_approved? (deboer)
neil.hauge: pmc_approved+
stefan.dimov: pmc_approved? (kaloyan)
cbridgha: pmc_approved+
stefan.dimov: review+
petya.sabeva: review+


Attachments
patch for both HEAD and R3_0_maintenance branches (8.70 KB, patch)
2011-08-31 10:01 EDT, Stefan Dimov CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Stefan Dimov CLA 2011-08-31 09:51:11 EDT
Very often the diagram editor remains dirty after save
Comment 1 Stefan Dimov CLA 2011-08-31 10:01:19 EDT
Created attachment 202525 [details]
patch for both HEAD and R3_0_maintenance branches
Comment 2 Stefan Dimov CLA 2011-08-31 10:13:16 EDT
This is important bug, because the user will very often see how she/he saves a diagram and it remains dirty and it will create a bad impression.

The workaround is to save once more the diagram, but it's annoying and also creates easily bad impression.

The fix was tested manually and there is also a new JUnit test, which comes with the patch and which tests the used underlying API.

There is a separate thread in the editor, which checks for certain changes and updates the diagram. One of the checks it makes is if the user has changed an entity name from outside the editor. The thread checks if the current name of an entity matches its name in the diagram, but it doesn't takes into account that "EntityName" and "* EntityName" are actually equal, so it finds them different and updates the diagram, which makes it dirty again. Petya will review the fix.

The risk is very low.
Comment 3 Chuck Bridgham CLA 2011-08-31 10:26:26 EDT
Why can't the thread making the changes be fixed to recognize equal entities, and prevent the update?  It looks like your just tricking the editor into thinking the contents hasn't changed?
Comment 4 Stefan Dimov CLA 2011-08-31 10:33:58 EDT
(In reply to comment #3)
> Why can't the thread making the changes be fixed to recognize equal entities,
> and prevent the update?  It looks like your just tricking the editor into
> thinking the contents hasn't changed?

Actually the thread just checks for specific changes, such like entity title change. It doesn't check the whole entity and if there is no change in the title the thread does nothing. Well, adding "* " in front of the title is not an actual title change, so the thread should do nothing. That's what this fix is about.
Comment 5 Stefan Dimov CLA 2011-08-31 11:10:26 EDT
The thread has never been responsible for the content changes. It just tracks titles (and a few other things), so this fix doesn't trick the editor. It just recognized "Title" and "* Title" as equal and prevents the title update.
Comment 6 Chuck Bridgham CLA 2011-08-31 11:23:03 EDT
thanks for the comments - I approve
Comment 7 Petya Sabeva CLA 2011-09-01 02:45:27 EDT
*** Bug 325442 has been marked as a duplicate of this bug. ***
Comment 8 Stefan Dimov CLA 2011-09-01 07:32:28 EDT
Since I couldn't commit the patch yesterday, now I'll have to wait until the weekly build is declared. Does it mean that this bug has to get one more PMC vote in order to be committed?
Comment 9 Neil Hauge CLA 2011-09-06 14:25:28 EDT
This seems like a reasonable change for maintenance, but it may be wise to review this functionality in the head stream.
Comment 10 Neil Hauge CLA 2011-09-06 16:14:31 EDT
Stefan asked me to check this in for him since he is out of the office.  Patch has been committed and released in maintenance branch only.
Comment 11 Stefan Dimov CLA 2011-09-07 14:38:34 EDT
(In reply to comment #10)
> Stefan asked me to check this in for him since he is out of the office.  Patch
> has been committed and released in maintenance branch only.

Neil, you are correct. This thread is a kind of compromise and it would be better to remove it in Juno ...
Comment 12 Stefan Dimov CLA 2011-09-07 14:40:59 EDT
... but it should be tracked in another bug ...
Comment 13 Stefan Dimov CLA 2011-09-07 15:33:49 EDT
Little correction: the comment:

 "This thread is a kind of compromise and it would be
better to remove it in Juno "

is a response of the comment #9
Comment 14 Stefan Dimov CLA 2011-09-12 06:57:51 EDT
(In reply to comment #10)
> Stefan asked me to check this in for him since he is out of the office.  Patch
> has been committed and released in maintenance branch only.

Thanx Neil!
Comment 15 Stefan Dimov CLA 2011-09-12 06:58:20 EDT
The patch was also submitted in the HEAD branch ...