Workaround for 37174
diff --git a/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/streams/TimeoutOutputStream.java b/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/streams/TimeoutOutputStream.java
index 0c20579..b18cc08 100644
--- a/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/streams/TimeoutOutputStream.java
+++ b/bundles/org.eclipse.team.core/src/org/eclipse/team/internal/core/streams/TimeoutOutputStream.java
@@ -44,6 +44,9 @@
private Thread thread;
private boolean waitingForClose = false; // if true, the thread is waiting for close()
private IOException ioe = null;
+
+ // Temporary
+ private byte[] copiedBuffer;
/**
* Creates a timeout wrapper for an output stream.
@@ -60,6 +63,7 @@
this.writeTimeout = writeTimeout;
this.closeTimeout = closeTimeout;
this.iobuffer = new byte[bufferSize];
+ this.copiedBuffer = new byte[bufferSize]; /* Temporary */
thread = new Thread(new Runnable() {
public void run() {
runThread();
@@ -248,13 +252,15 @@
flushRequested = false;
bytesUntilFlush = length;
}
+ // Temporary: Copy the buffer so the srite doesn't overwrite it
+ System.arraycopy(iobuffer, 0, copiedBuffer, 0, iobuffer.length);
}
if (len != 0) {
// write out all remaining bytes from the buffer before flushing
try {
// the i/o operation might block without releasing the lock,
// so we do this outside of the synchronized block
- out.write(iobuffer, off, len);
+ out.write(copiedBuffer, off, len);
} catch (InterruptedIOException e) {
len = e.bytesTransferred;
}