Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDani Megert2011-01-11 13:33:15 +0000
committerDani Megert2011-01-11 13:33:15 +0000
commit046c23940a921b20678a5b11a6fff0f27147e75f (patch)
treefdea45d0aebce4cd1ca020cdf3f04dc5630a11f1 /org.eclipse.core.filebuffers
parent611d6cb2a92e3175fbdeee1043d1c9e9eb860255 (diff)
downloadeclipse.platform.text-046c23940a921b20678a5b11a6fff0f27147e75f.tar.gz
eclipse.platform.text-046c23940a921b20678a5b11a6fff0f27147e75f.tar.xz
eclipse.platform.text-046c23940a921b20678a5b11a6fff0f27147e75f.zip
Part two of fix for bug 333660: [implementation] FileStoreTextFileBuffer eats IOException on external file save
Diffstat (limited to 'org.eclipse.core.filebuffers')
-rw-r--r--org.eclipse.core.filebuffers/src/org/eclipse/core/internal/filebuffers/FileStoreTextFileBuffer.java6
1 files changed, 5 insertions, 1 deletions
diff --git a/org.eclipse.core.filebuffers/src/org/eclipse/core/internal/filebuffers/FileStoreTextFileBuffer.java b/org.eclipse.core.filebuffers/src/org/eclipse/core/internal/filebuffers/FileStoreTextFileBuffer.java
index 420d1b470..00025c606 100644
--- a/org.eclipse.core.filebuffers/src/org/eclipse/core/internal/filebuffers/FileStoreTextFileBuffer.java
+++ b/org.eclipse.core.filebuffers/src/org/eclipse/core/internal/filebuffers/FileStoreTextFileBuffer.java
@@ -7,6 +7,7 @@
*
* Contributors:
* IBM Corporation - initial API and implementation
+ * James Blackburn <jamesblackburn+eclipse@gmail.com> - [implementation] FileStoreTextFileBuffer eats IOException on external file save - https://bugs.eclipse.org/333660
*******************************************************************************/
package org.eclipse.core.internal.filebuffers;
@@ -199,8 +200,10 @@ public class FileStoreTextFileBuffer extends FileStoreFileBuffer implements ITex
while (true) {
int bytesRead= -1;
bytesRead= stream.read(buffer);
- if (bytesRead == -1)
+ if (bytesRead == -1) {
+ out.close();
break;
+ }
out.write(buffer, 0, bytesRead);
if (monitor != null)
monitor.worked(1);
@@ -488,6 +491,7 @@ public class FileStoreTextFileBuffer extends FileStoreFileBuffer implements ITex
out.write(bytes, 0, bytesLength);
out.flush();
+ out.close();
} catch (IOException x) {
IStatus s= new Status(IStatus.ERROR, FileBuffersPlugin.PLUGIN_ID, IStatus.OK, x.getLocalizedMessage(), x);
throw new CoreException(s);

Back to the top