From bfe89332a4e55bd709ec001a646ecf4dd30d8a97 Mon Sep 17 00:00:00 2001 From: Matthias Sohn Date: Sat, 10 Mar 2018 00:54:51 +0100 Subject: [PATCH] Remove deprecated StreamCopyThread#flush StreamCopyThread: Do not let flush interrupt a write. flush calls interrupt() to interrupt a pending read and trigger a flush. Unfortunately that interrupt() call can also interrupt a pending write, putting Jsch in a bad state and triggering "Short read of block" errors. Change-Id: I11f8a014fd72df06617cc8731d992eb14cc32a67 Signed-off-by: Matthias Sohn --- .../org/eclipse/jgit/util/io/StreamCopyThread.java | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/util/io/StreamCopyThread.java b/org.eclipse.jgit/src/org/eclipse/jgit/util/io/StreamCopyThread.java index 5c1af9efa..efdddeee9 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/util/io/StreamCopyThread.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/util/io/StreamCopyThread.java @@ -80,20 +80,6 @@ public class StreamCopyThread extends Thread { writeLock = new Object(); } - /** - * Request the thread to flush the output stream as soon as possible. - *

- * This is an asynchronous request to the thread. The actual flush will - * happen at some future point in time, when the thread wakes up to process - * the request. - */ - @Deprecated - public void flush() { - synchronized (writeLock) { - interrupt(); - } - } - /** * Request that the thread terminate, and wait for it. *