Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 114197 Details for
Bug 249544
[usability] Save conflict dialog appears when saving files in the editor
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
patch to keep waiting while timestamp gets updated
patch.txt (text/plain), 2.90 KB, created by
David McKnight
on 2008-10-03 10:32:41 EDT
(
hide
)
Description:
patch to keep waiting while timestamp gets updated
Filename:
MIME Type:
Creator:
David McKnight
Created:
2008-10-03 10:32:41 EDT
Size:
2.90 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.rse.files.ui >Index: src/org/eclipse/rse/files/ui/resources/SystemUniversalTempFileListener.java >=================================================================== >RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/files/ui/resources/SystemUniversalTempFileListener.java,v >retrieving revision 1.28 >diff -u -r1.28 SystemUniversalTempFileListener.java >--- src/org/eclipse/rse/files/ui/resources/SystemUniversalTempFileListener.java 2 Jul 2008 15:01:50 -0000 1.28 >+++ src/org/eclipse/rse/files/ui/resources/SystemUniversalTempFileListener.java 3 Oct 2008 14:32:04 -0000 >@@ -23,6 +23,7 @@ > * Kevin Doyle (IBM) - [204810] Saving file in Eclipse does not update remote file > * Kevin Doyle (IBM) - [210389] Display error dialog when setting file not read-only fails when saving > * David McKnight (IBM) - [235221] Files truncated on exit of Eclipse >+ * David McKnight (IBM) - [249544] Save conflict dialog appears when saving files in the editor > ********************************************************************************/ > > package org.eclipse.rse.files.ui.resources; >@@ -302,11 +303,10 @@ > } > > // waiting to make sure the file's timestamp is uptodate >- Thread.sleep(1000); >+ remoteFile = waitForTimestampToBeUpToDate(remoteFile, monitor); >+ >+ > >- // get the remote file object again so that we have a fresh remote timestamp >- remoteFile.markStale(true); >- remoteFile = fs.getRemoteFileObject(remoteFile.getAbsolutePath(), monitor); > > registry.fireEvent(new SystemResourceChangeEvent(remoteFile, ISystemResourceChangeEvents.EVENT_PROPERTY_CHANGE, remoteFile)); > >@@ -374,4 +374,40 @@ > e.printStackTrace(); > } > } >+ >+ private IRemoteFile waitForTimestampToBeUpToDate(IRemoteFile remoteFile, IProgressMonitor monitor) >+ { >+ IRemoteFileSubSystem fs = remoteFile.getParentRemoteFileSubSystem(); >+ String path = remoteFile.getAbsolutePath(); >+ try { >+ // get the remote file object again so that we have a fresh remote timestamp >+ remoteFile.markStale(true); >+ remoteFile = fs.getRemoteFileObject(path, monitor); >+ >+ long timestamp = remoteFile.getLastModified(); >+ boolean timestampChanged = true; >+ while (timestampChanged){ // wait until the timestamp stops changing >+ try { >+ Thread.sleep(500); // sleep >+ } >+ catch (InterruptedException e){ >+ } >+ >+ // query the remote file again >+ remoteFile.markStale(true); >+ remoteFile = fs.getRemoteFileObject(path, monitor); >+ >+ // what's the timestamp now? >+ long nextTimestamp = remoteFile.getLastModified(); >+ >+ timestampChanged = (timestamp != nextTimestamp); >+ timestamp = nextTimestamp; >+ } >+ } >+ catch (SystemMessageException e){ >+ >+ } >+ >+ return remoteFile; >+ } > } >\ No newline at end of file
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 249544
:
114197
|
114226
|
114319
|
115642
|
117337