Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 337435 - Don't prompt user when clean editor is about to be brought back into sync
Summary: Don't prompt user when clean editor is about to be brought back into sync
Status: CLOSED DUPLICATE of bug 97510
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 3.7   Edit
Hardware: All All
: P3 minor (vote)
Target Milestone: ---   Edit
Assignee: Platform-Text-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 303517
Blocks:
  Show dependency tree
 
Reported: 2011-02-17 08:48 EST by James Blackburn CLA
Modified: 2011-04-27 08:21 EDT (History)
1 user (show)

See Also:


Attachments
patch 1 (832 bytes, patch)
2011-02-17 08:48 EST, James Blackburn CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description James Blackburn CLA 2011-02-17 08:48:04 EST
Created attachment 189179 [details]
patch 1

In bug 303517 we core.resources sync state in a timely manner when resources are discovered out-of-sync. 

The TextEditor should prompt the user in this case.

Backtrace looks something like:

File(Resource).isSynchronized(int) line: 1505	
ResourceTextFileBuffer(ResourceFileBuffer).isSynchronized() line: 488	
TextFileDocumentProvider.isSynchronized(Object) line: 1199	
TextEditor(AbstractTextEditor).sanityCheckState(IEditorInput) line: 4889	
TextEditor(StatusTextEditor).sanityCheckState(IEditorInput) line: 257	
TextEditor(AbstractTextEditor).safelySanityCheckState(IEditorInput) line: 4868	
AbstractTextEditor$ActivationListener.handleActivation() line: 983	

followed by:

TextEditor(AbstractTextEditor).handleEditorInputChanged() line: 4707	
TextEditor(StatusTextEditor).handleEditorInputChanged() line: 267	
TextEditor(AbstractTextEditor).sanityCheckState(IEditorInput) line: 4890	
TextEditor(StatusTextEditor).sanityCheckState(IEditorInput) line: 257	
TextEditor(AbstractTextEditor).safelySanityCheckState(IEditorInput) line: 4868	
AbstractTextEditor$ActivationListener.handleActivation() line: 983	

In the first backtrace, it's true that the file is out-of-sync, in the second the dialog is brought up.  The editor should not show the File Changed dialog if not dirty.
Comment 1 Dani Megert CLA 2011-02-17 08:51:41 EST
I'm confused now: the summary say:
  Don't prompt user when clean editor is about to be brought back into sync
comment 0 says:
  The TextEditor should prompt the user in this case.

Can you provide some simple steps?
Comment 2 James Blackburn CLA 2011-02-17 08:56:21 EST
(In reply to comment #1)
> I'm confused now: the summary say:
>   Don't prompt user when clean editor is about to be brought back into sync
> comment 0 says:
>   The TextEditor should prompt the user in this case.

Sorry, comment 0 wrong.

Steps:

  1 Create text file
  2 Open in editor (clean)
  3 Modify the file outside of eclipse
  4 Change back to editor.

At step 4, if the resource is discovered out-of-sync a "File changed" dialog is displayed. Irrespective of the dialog, if a resource change event fires, the editor is brought into sync anyway.
With bug 303517 the editor will be brought into sync soon after discovered out-of-sync.  The result is that dialog has no effect.
Comment 3 Dani Megert CLA 2011-02-17 10:22:52 EST

*** This bug has been marked as a duplicate of bug 97510 ***
Comment 4 Dani Megert CLA 2011-04-27 08:21:31 EDT
Comment on attachment 189179 [details]
patch 1

The patch is not good as textual editors can work on other models than just
core.resources (e.g. EFS). The fix needs to deal with that.