From: Matthias Sohn Date: Fri, 9 Mar 2018 23:54:51 +0000 (+0100) Subject: Remove deprecated StreamCopyThread#flush X-Git-Tag: v5.0.0.201805151920-m7~102 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=refs%2Fchanges%2F26%2F119126%2F2;p=jgit.git 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 --- 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 5c1af9efad..efdddeee95 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. *