Bug 104322 - [implementation] Class org.eclipse.ui.editors.text.FileDocumentProvider does not detect content changes
Summary: [implementation] Class org.eclipse.ui.editors.text.FileDocumentProvider does ...
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P3 major (vote)
Target Milestone: 3.1.1   Edit
Assignee: Platform-Text-Inbox CLA Friend
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-07-19 04:31 EDT by GianMaria Romanato CLA Friend
Modified: 2005-08-09 05:42 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description GianMaria Romanato CLA Friend 2005-07-19 04:31:08 EDT
The following code fragment from method visit() of the above class shows that if
delta kind equals to CHANGED and delta flags equals to CONTENT, then the file
timestamp will never be checked because the Runnable instance evaluated in the
first condition of the "if" statement is always null.

-------------------------------------

Runnable runnable= null;

switch (delta.getKind()) {
 case IResourceDelta.CHANGED:
	FileInfo info= (FileInfo)getElementInfo(fFileEditorInput);
	if (info == null || info.fCanBeSaved)
	     break;

       boolean isSynchronized= computeModificationStamp(getFile()) ==           
                   info.fModificationStamp;
	if ((IResourceDelta.ENCODING & delta.getFlags()) != 0 && isSynchronized) 
                {
		runnable= new SafeChange(fFileEditorInput) {
		      protected void execute(IFileEditorInput input) 
                         throws Exception {						                         
handleElementContentChanged(input);
			}
 		    };
		}

	if (runnable != null && (IResourceDelta.CONTENT & delta.getFlags()) != 0
                      && !isSynchronized) {
---------------------------------------
Comment 1 Dani Megert CLA Friend 2005-07-19 05:33:08 EDT
Fixed in HEAD.
Comment 2 Dani Megert CLA Friend 2005-07-19 10:06:33 EDT
Fixed in 3.1.1
Reviewed by Tom.
Comment 3 Dirk Baeumer CLA Friend 2005-08-09 05:10:58 EDT
Start verifying...
Comment 4 Dirk Baeumer CLA Friend 2005-08-09 05:40:26 EDT
Verified by code inspecting. Code is in and makes sense.
Comment 5 Dani Megert CLA Friend 2005-08-09 05:42:57 EDT
You can use org.eclipse.ui.examples.javaeditor project which contains the
Template editor that still uses FileDocumentProvider.