Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndre Weinand2003-12-11 14:16:19 +0000
committerAndre Weinand2003-12-11 14:16:19 +0000
commit3338cc76f0f224c5bea035074e2ecb3cbba55dba (patch)
tree66d251251065a10123f5f71ecd2871c3aa320641
parent7c1110a9343d35a1b2ca3043806af68b0ddba737 (diff)
downloadeclipse.platform.team-3338cc76f0f224c5bea035074e2ecb3cbba55dba.tar.gz
eclipse.platform.team-3338cc76f0f224c5bea035074e2ecb3cbba55dba.tar.xz
eclipse.platform.team-3338cc76f0f224c5bea035074e2ecb3cbba55dba.zip
fixed #47866
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/ResourceNode.java17
-rw-r--r--bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/ResourceNode.java17
2 files changed, 30 insertions, 4 deletions
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/ResourceNode.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/ResourceNode.java
index e82d480af..4c08c8111 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/ResourceNode.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/ResourceNode.java
@@ -177,8 +177,21 @@ public class ResourceNode extends BufferedContent
* @exception CoreException if the contents of this storage could not be accessed
*/
protected InputStream createStream() throws CoreException {
- if (fResource instanceof IStorage)
- return new BufferedInputStream(((IStorage)fResource).getContents());
+ if (fResource instanceof IStorage) {
+ InputStream is= null;
+ IStorage storage= (IStorage) fResource;
+ try {
+ is= storage.getContents();
+ } catch (CoreException e) {
+ if (e.getStatus().getCode() == IResourceStatus.OUT_OF_SYNC_LOCAL) {
+ fResource.refreshLocal(IResource.DEPTH_INFINITE, null);
+ is= storage.getContents();
+ } else
+ throw e;
+ }
+ if (is != null)
+ return new BufferedInputStream(is);
+ }
return null;
}
diff --git a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/ResourceNode.java b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/ResourceNode.java
index e82d480af..4c08c8111 100644
--- a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/ResourceNode.java
+++ b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/ResourceNode.java
@@ -177,8 +177,21 @@ public class ResourceNode extends BufferedContent
* @exception CoreException if the contents of this storage could not be accessed
*/
protected InputStream createStream() throws CoreException {
- if (fResource instanceof IStorage)
- return new BufferedInputStream(((IStorage)fResource).getContents());
+ if (fResource instanceof IStorage) {
+ InputStream is= null;
+ IStorage storage= (IStorage) fResource;
+ try {
+ is= storage.getContents();
+ } catch (CoreException e) {
+ if (e.getStatus().getCode() == IResourceStatus.OUT_OF_SYNC_LOCAL) {
+ fResource.refreshLocal(IResource.DEPTH_INFINITE, null);
+ is= storage.getContents();
+ } else
+ throw e;
+ }
+ if (is != null)
+ return new BufferedInputStream(is);
+ }
return null;
}

Back to the top